mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
Fix: 'OpenVPN' is recorded to the log instead of 'WireGuard'
This commit is contained in:
@@ -352,6 +352,15 @@ bool IosController::startWireGuard(const QString &config)
|
|||||||
|
|
||||||
void IosController::startTunnel()
|
void IosController::startTunnel()
|
||||||
{
|
{
|
||||||
|
NSString *protocolName = @"Unknown";
|
||||||
|
|
||||||
|
NETunnelProviderProtocol *tunnelProtocol = (NETunnelProviderProtocol *)m_currentTunnel.protocolConfiguration;
|
||||||
|
if (tunnelProtocol.providerConfiguration[@"wireguard"] != nil) {
|
||||||
|
protocolName = @"WireGuard";
|
||||||
|
} else if (tunnelProtocol.providerConfiguration[@"ovpn"] != nil) {
|
||||||
|
protocolName = @"OpenVPN";
|
||||||
|
}
|
||||||
|
|
||||||
m_rxBytes = 0;
|
m_rxBytes = 0;
|
||||||
m_txBytes = 0;
|
m_txBytes = 0;
|
||||||
|
|
||||||
@@ -373,7 +382,7 @@ void IosController::startTunnel()
|
|||||||
|
|
||||||
[m_currentTunnel loadFromPreferencesWithCompletionHandler:^(NSError *loadError) {
|
[m_currentTunnel loadFromPreferencesWithCompletionHandler:^(NSError *loadError) {
|
||||||
if (loadError) {
|
if (loadError) {
|
||||||
qDebug() << "IosController::startOpenVPN : Connect OpenVPN Tunnel Load Error" << loadError.localizedDescription.UTF8String;
|
qDebug().nospace() << "IosController::start" << protocolName << ": Connect " << protocolName << " Tunnel Load Error" << loadError.localizedDescription.UTF8String;
|
||||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -401,11 +410,11 @@ void IosController::startTunnel()
|
|||||||
BOOL started = [m_currentTunnel.connection startVPNTunnelWithOptions:nil andReturnError:&startError];
|
BOOL started = [m_currentTunnel.connection startVPNTunnelWithOptions:nil andReturnError:&startError];
|
||||||
|
|
||||||
if (!started || startError) {
|
if (!started || startError) {
|
||||||
qDebug() << "IosController::startOpenVPN : Connect OpenVPN Tunnel Start Error"
|
qDebug().nospace() << "IosController::start" << protocolName << " : Connect " << protocolName << " Tunnel Start Error"
|
||||||
<< (startError ? startError.localizedDescription.UTF8String : "");
|
<< (startError ? startError.localizedDescription.UTF8String : "");
|
||||||
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
emit connectionStateChanged(Vpn::ConnectionState::Error);
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "IosController::startOpenVPN : Starting the tunnel succeeded";
|
qDebug().nospace() << "IosController::start" << protocolName << " : Starting the tunnel succeeded";
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user