iOS connection fixes (#278)

iOS VPN connection fixes
This commit is contained in:
pokamest 2023-08-08 19:02:41 -07:00 committed by GitHub
parent a1a6185fd6
commit 5510ff7dce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 50 deletions

View file

@ -30,6 +30,12 @@ IOSVpnProtocol::IOSVpnProtocol(Proto proto, const QJsonObject &configuration, QO
connect(this, &IOSVpnProtocol::newTransmittedDataCount, this, &IOSVpnProtocol::setBytesChanged);
}
IOSVpnProtocol::~IOSVpnProtocol()
{
qDebug() << "IOSVpnProtocol::~IOSVpnProtocol()";
IOSVpnProtocol::stop();
}
IOSVpnProtocol* IOSVpnProtocol::instance() {
return s_instance;
}
@ -158,9 +164,12 @@ void IOSVpnProtocol::checkStatus()
}
m_checkingStatus = true;
QPointer<IOSVpnProtocol> weakSelf = this;
[m_controller checkStatusWithCallback:^(NSString* serverIpv4Gateway, NSString* deviceIpv4Address,
NSString* configString) {
if (!weakSelf) return;
QString config = QString::fromNSString(configString);
m_checkingStatus = false;
@ -185,7 +194,7 @@ void IOSVpnProtocol::checkStatus()
}
}
emit newTransmittedDataCount(rxBytes, txBytes);
emit weakSelf->newTransmittedDataCount(rxBytes, txBytes);
}];
}