fix: safe IpcClient calls (#2076)

* fix: safe IpcClient calls

* fix: double free by specifying parent

* fix: windows includes for ikev2
This commit is contained in:
Yaroslav Gurov
2025-12-19 04:09:50 +01:00
committed by GitHub
parent 6178b05643
commit 91cd9474ea
10 changed files with 274 additions and 201 deletions

View File

@@ -74,7 +74,11 @@ GatewayController::EncryptedRequestData GatewayController::prepareRequest(const
QString host = QUrl(encRequestData.request.url()).host();
QString ip = NetworkUtilities::getIPAddress(host);
if (!ip.isEmpty()) {
IpcClient::Interface()->addKillSwitchAllowedRange(QStringList { ip });
IpcClient::withInterface([&](QSharedPointer<IpcInterfaceReplica> iface) {
QRemoteObjectPendingReply<bool> reply = iface->addKillSwitchAllowedRange(QStringList { ip });
if (!reply.waitForFinished(1000) || !reply.returnValue())
qWarning() << "GatewayController::prepareRequest(): Failed to execute remote addKillSwitchAllowedRange call";
});
}
}
#endif