Cleanup
This commit is contained in:
parent
ed6a417d7e
commit
997c8c87d0
3 changed files with 0 additions and 38 deletions
|
@ -12,23 +12,18 @@
|
||||||
WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject* parent) :
|
WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject* parent) :
|
||||||
VpnProtocol(configuration, parent)
|
VpnProtocol(configuration, parent)
|
||||||
{
|
{
|
||||||
//m_configFile.setFileTemplate(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
|
|
||||||
m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
|
m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
|
||||||
readWireguardConfiguration(configuration);
|
readWireguardConfiguration(configuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
WireguardProtocol::~WireguardProtocol()
|
WireguardProtocol::~WireguardProtocol()
|
||||||
{
|
{
|
||||||
//qDebug() << "WireguardProtocol::~WireguardProtocol() 1";
|
|
||||||
WireguardProtocol::stop();
|
WireguardProtocol::stop();
|
||||||
QThread::msleep(200);
|
QThread::msleep(200);
|
||||||
//qDebug() << "WireguardProtocol::~WireguardProtocol() 2";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WireguardProtocol::stop()
|
void WireguardProtocol::stop()
|
||||||
{
|
{
|
||||||
//qDebug() << "WireguardProtocol::stop() 1";
|
|
||||||
|
|
||||||
#ifndef Q_OS_IOS
|
#ifndef Q_OS_IOS
|
||||||
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
||||||
qCritical() << "Wireguard executable missing!";
|
qCritical() << "Wireguard executable missing!";
|
||||||
|
@ -74,7 +69,6 @@ void WireguardProtocol::stop()
|
||||||
setConnectionState(VpnProtocol::Disconnected);
|
setConnectionState(VpnProtocol::Disconnected);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//qDebug() << "WireguardProtocol::stop() 2";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configuration)
|
void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configuration)
|
||||||
|
@ -97,11 +91,6 @@ void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configurat
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//bool WireguardProtocol::openVpnProcessIsRunning() const
|
|
||||||
//{
|
|
||||||
// return Utils::processIsRunning("openvpn");
|
|
||||||
//}
|
|
||||||
|
|
||||||
QString WireguardProtocol::configPath() const
|
QString WireguardProtocol::configPath() const
|
||||||
{
|
{
|
||||||
return m_configFileName;
|
return m_configFileName;
|
||||||
|
@ -119,15 +108,12 @@ void WireguardProtocol::updateRouteGateway(QString line)
|
||||||
|
|
||||||
ErrorCode WireguardProtocol::start()
|
ErrorCode WireguardProtocol::start()
|
||||||
{
|
{
|
||||||
//qDebug() << "WireguardProtocol::start() 1";
|
|
||||||
|
|
||||||
#ifndef Q_OS_IOS
|
#ifndef Q_OS_IOS
|
||||||
if (!m_isConfigLoaded) {
|
if (!m_isConfigLoaded) {
|
||||||
setLastError(ErrorCode::ConfigMissing);
|
setLastError(ErrorCode::ConfigMissing);
|
||||||
return lastError();
|
return lastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
//qDebug() << "Start Wireguard connection";
|
|
||||||
WireguardProtocol::stop();
|
WireguardProtocol::stop();
|
||||||
|
|
||||||
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
if (!QFileInfo::exists(Utils::wireguardExecPath())) {
|
||||||
|
@ -145,7 +131,6 @@ ErrorCode WireguardProtocol::start()
|
||||||
m_wireguardStartProcess = IpcClient::CreatePrivilegedProcess();
|
m_wireguardStartProcess = IpcClient::CreatePrivilegedProcess();
|
||||||
|
|
||||||
if (!m_wireguardStartProcess) {
|
if (!m_wireguardStartProcess) {
|
||||||
//qWarning() << "IpcProcess replica is not created!";
|
|
||||||
setLastError(ErrorCode::AmneziaServiceConnectionFailed);
|
setLastError(ErrorCode::AmneziaServiceConnectionFailed);
|
||||||
return ErrorCode::AmneziaServiceConnectionFailed;
|
return ErrorCode::AmneziaServiceConnectionFailed;
|
||||||
}
|
}
|
||||||
|
@ -199,8 +184,6 @@ ErrorCode WireguardProtocol::start()
|
||||||
m_wireguardStartProcess->start();
|
m_wireguardStartProcess->start();
|
||||||
m_wireguardStartProcess->waitForFinished(10000);
|
m_wireguardStartProcess->waitForFinished(10000);
|
||||||
|
|
||||||
//qDebug() << "WireguardProtocol::start() 2";
|
|
||||||
|
|
||||||
return ErrorCode::NoError;
|
return ErrorCode::NoError;
|
||||||
#else
|
#else
|
||||||
return ErrorCode::NotImplementedError;
|
return ErrorCode::NotImplementedError;
|
||||||
|
|
|
@ -20,18 +20,6 @@ IpcServerProcess::IpcServerProcess(QObject *parent) :
|
||||||
qDebug() << "IpcServerProcess errorOccurred " << error;
|
qDebug() << "IpcServerProcess errorOccurred " << error;
|
||||||
});
|
});
|
||||||
|
|
||||||
// connect(m_process.data(), &QProcess::readyReadStandardError, this, [this](){
|
|
||||||
// qDebug() << "IpcServerProcess StandardError " << m_process->readAllStandardError();
|
|
||||||
|
|
||||||
// });
|
|
||||||
// connect(m_process.data(), &QProcess::readyReadStandardOutput, this, [this](){
|
|
||||||
// qDebug() << "IpcServerProcess StandardOutput " << m_process->readAllStandardOutput();
|
|
||||||
// });
|
|
||||||
|
|
||||||
// connect(m_process.data(), &QProcess::readyRead, this, [this](){
|
|
||||||
// qDebug() << "IpcServerProcess StandardOutput " << m_process->readAll();
|
|
||||||
// });
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcServerProcess::~IpcServerProcess()
|
IpcServerProcess::~IpcServerProcess()
|
||||||
|
@ -39,14 +27,6 @@ IpcServerProcess::~IpcServerProcess()
|
||||||
qDebug() << "IpcServerProcess::~IpcServerProcess";
|
qDebug() << "IpcServerProcess::~IpcServerProcess";
|
||||||
}
|
}
|
||||||
|
|
||||||
//void IpcServerProcess::start(const QString &program, const QStringList &arguments)
|
|
||||||
//{
|
|
||||||
// m_process->start(program, arguments);
|
|
||||||
// qDebug() << "IpcServerProcess started, " << arguments;
|
|
||||||
|
|
||||||
// m_process->waitForStarted();
|
|
||||||
//}
|
|
||||||
|
|
||||||
void IpcServerProcess::start()
|
void IpcServerProcess::start()
|
||||||
{
|
{
|
||||||
if (m_process->program().isEmpty()) {
|
if (m_process->program().isEmpty()) {
|
||||||
|
|
|
@ -13,7 +13,6 @@ public:
|
||||||
explicit IpcServerProcess(QObject *parent = nullptr);
|
explicit IpcServerProcess(QObject *parent = nullptr);
|
||||||
virtual ~IpcServerProcess();
|
virtual ~IpcServerProcess();
|
||||||
|
|
||||||
//void start(const QString &program, const QStringList &arguments) override;
|
|
||||||
void start() override;
|
void start() override;
|
||||||
void close() override;
|
void close() override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue