mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
fix: remove double disconnect for Win IPSec (#1800)
This commit is contained in:
@@ -30,7 +30,6 @@ Ikev2Protocol::Ikev2Protocol(const QJsonObject &configuration, QObject* parent)
|
|||||||
Ikev2Protocol::~Ikev2Protocol()
|
Ikev2Protocol::~Ikev2Protocol()
|
||||||
{
|
{
|
||||||
qDebug() << "IpsecProtocol::~IpsecProtocol()";
|
qDebug() << "IpsecProtocol::~IpsecProtocol()";
|
||||||
disconnect_vpn();
|
|
||||||
Ikev2Protocol::stop();
|
Ikev2Protocol::stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +310,9 @@ bool Ikev2Protocol::connect_to_vpn(const QString & vpn_name){
|
|||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
bool Ikev2Protocol::disconnect_vpn(){
|
bool Ikev2Protocol::disconnect_vpn(){
|
||||||
if ( hRasConn != nullptr ){
|
if ( hRasConn != nullptr ){
|
||||||
if ( RasHangUp(hRasConn) != ERROR_SUCCESS)
|
auto ret = RasHangUp(hRasConn);
|
||||||
|
qDebug() << "RasHangUp " << ret;
|
||||||
|
if (ret != ERROR_SUCCESS)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
QThread::msleep(3000);
|
QThread::msleep(3000);
|
||||||
|
|||||||
Reference in New Issue
Block a user