Delete websuckets
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#include "ui_startupencryption.h"
|
||||
#include "ui_removeencryption.h"
|
||||
#include "ui_seedrestore.h"
|
||||
#include "websockets.h"
|
||||
#include "sodium.h"
|
||||
#include "sodium/crypto_generichash_blake2b.h"
|
||||
#include <QRegularExpression>
|
||||
@@ -305,16 +304,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
|
||||
restoreSavedStates();
|
||||
|
||||
if (AppDataServer::getInstance()->isAppConnected()) {
|
||||
qDebug() << __func__ << ": app is connected to wormhole";
|
||||
auto ads = AppDataServer::getInstance();
|
||||
|
||||
QString wormholecode = "";
|
||||
if (ads->getAllowInternetConnection())
|
||||
wormholecode = ads->getWormholeCode(ads->getSecretHex());
|
||||
|
||||
createWebsocket(wormholecode);
|
||||
}
|
||||
}
|
||||
|
||||
bool MainWindow::fileExists(QString path)
|
||||
@@ -323,36 +312,6 @@ bool MainWindow::fileExists(QString path)
|
||||
return (check_file.exists() && check_file.isFile());
|
||||
}
|
||||
|
||||
void MainWindow::createWebsocket(QString wormholecode) {
|
||||
qDebug() << "Listening for app connections on port 8777";
|
||||
// Create the websocket server, for listening to direct connections
|
||||
wsserver = new WSServer(8777, false, this);
|
||||
|
||||
if (!wormholecode.isEmpty()) {
|
||||
// Connect to the wormhole service
|
||||
wormhole = new WormholeClient(this, wormholecode);
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::stopWebsocket() {
|
||||
delete wsserver;
|
||||
wsserver = nullptr;
|
||||
|
||||
delete wormhole;
|
||||
wormhole = nullptr;
|
||||
|
||||
qDebug() << "Websockets for app connections shut down";
|
||||
}
|
||||
|
||||
bool MainWindow::isWebsocketListening() {
|
||||
return wsserver != nullptr;
|
||||
}
|
||||
|
||||
void MainWindow::replaceWormholeClient(WormholeClient* newClient) {
|
||||
delete wormhole;
|
||||
wormhole = newClient;
|
||||
}
|
||||
|
||||
void MainWindow::restoreSavedStates() {
|
||||
QSettings s;
|
||||
restoreGeometry(s.value("geometry").toByteArray());
|
||||
@@ -2735,8 +2694,6 @@ MainWindow::~MainWindow()
|
||||
delete loadingMovie;
|
||||
delete logger;
|
||||
|
||||
delete wsserver;
|
||||
delete wormhole;
|
||||
}
|
||||
void MainWindow::on_givemeZaddr_clicked()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user