mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-05-08 14:33:23 +00:00
feat: add network status check for awg/wg protocol (#1894)
* Add network status check for AWG/WG protocol * Use service for PingSender * Cleanup unused code * Use networkchecker for all protocols * fix android build * add delay for ping checker stop * handle for interafe problems on windows * Restart IpcClient after OS suspend * Add DBus network checker for Linux * Use ping check for tun interfce * Windows suspend mode handler * MacOS suspend mode handler draft * Add delay for Linux wakeup reconnect * Add delay for Linux wakeup reconnect * Fix macOS wakeup/sleep prob Fix macOS not receiving wakeup/sleep events * fix done * Update deploy.yml fix CICD * Update vpnconnection.cpp update fix build CICD * Update vpnconnection.cpp update fix build cicd macos * Update deploy.yml fix CICD build macos * Update deploy.yml fix CICD macos * feat: implement SCP write buffer, improve network check and refactor macOS OpenGL support * feat: add tunnel addresses updated signal and handle network check based on gateway and local address availability * refactor: improve IpcClient connection handling and instance management * fix: scp revert. * fix: cmake reverted. * fix: submodules updated --------- Co-authored-by: Mykola Baibuz <mykola.baibuz@gmail.com> Co-authored-by: Yaroslav Yashin <yaroslav.yashin@gmail.com> Co-authored-by: vkamn <vk@amnezia.org>
This commit is contained in:
@@ -18,6 +18,22 @@ bool IpcClient::isSocketConnected() const
|
||||
return m_isSocketConnected;
|
||||
}
|
||||
|
||||
void IpcClient::closeAndResetInstance(bool deleteSelf)
|
||||
{
|
||||
if (m_localSocket)
|
||||
{
|
||||
m_localSocket->disconnectFromServer();
|
||||
m_localSocket->deleteLater();
|
||||
m_localSocket.clear();
|
||||
}
|
||||
m_ipcClient.reset();
|
||||
m_Tun2SocksClient.reset();
|
||||
m_isSocketConnected = false;
|
||||
if (deleteSelf) {
|
||||
m_instance = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
IpcClient *IpcClient::Instance()
|
||||
{
|
||||
return m_instance;
|
||||
@@ -39,6 +55,10 @@ QSharedPointer<IpcProcessTun2SocksReplica> IpcClient::InterfaceTun2Socks()
|
||||
|
||||
bool IpcClient::init(IpcClient *instance)
|
||||
{
|
||||
if (m_instance && m_instance != instance) {
|
||||
m_instance->closeAndResetInstance(false);
|
||||
m_instance->deleteLater();
|
||||
}
|
||||
m_instance = instance;
|
||||
|
||||
Instance()->m_localSocket = new QLocalSocket(Instance());
|
||||
|
||||
@@ -23,6 +23,7 @@ public:
|
||||
static QSharedPointer<PrivilegedProcess> CreatePrivilegedProcess();
|
||||
|
||||
bool isSocketConnected() const;
|
||||
void closeAndResetInstance(bool deleteSelf = false);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user