add delay for ping checker stop

This commit is contained in:
Mykola Baibuz 2025-03-27 21:46:10 +02:00
parent 681eb5aa86
commit 26994c21b1
3 changed files with 5 additions and 13 deletions

View file

@ -6,7 +6,6 @@
#include <QHostInfo>
#include <QJsonObject>
#include "core/controllers/serverController.h"
#include <configurators/cloak_configurator.h>
#include <configurators/openvpn_configurator.h>
#include <configurators/shadowsocks_configurator.h>
@ -14,7 +13,6 @@
#ifdef AMNEZIA_DESKTOP
#include "core/ipcclient.h"
#include "ipc.h"
#include <protocols/wireguardprotocol.h>
#endif
@ -91,7 +89,8 @@ void VpnConnection::onConnectionStateChanged(Vpn::ConnectionState state)
} else if (state == Vpn::ConnectionState::Error) {
IpcClient::Interface()->flushDns();
IpcClient::Interface()->stopNetworkCheck();
auto result = IpcClient::Interface()->stopNetworkCheck();
result.waitForFinished(3000);
if (m_settings->isSitesSplitTunnelingEnabled()) {
if (m_settings->routeMode() == Settings::VpnOnlyForwardSites) {
@ -101,7 +100,8 @@ void VpnConnection::onConnectionStateChanged(Vpn::ConnectionState state)
} else if (state == Vpn::ConnectionState::Connecting) {
} else if (state == Vpn::ConnectionState::Disconnected) {
IpcClient::Interface()->stopNetworkCheck();
auto result = IpcClient::Interface()->stopNetworkCheck();
result.waitForFinished(3000);
}
}
#endif