aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-03 19:03:27 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-03 19:22:30 +0530
commit582092abb1edb766dc42620ec90cd1f18d7cc01e (patch)
treee1e518c47cbe7fd8e20c11495dd09370ea3ed66a
parentVPN: We should never get a status change to .disconnected if we're resolving endpoints (diff)
downloadwireguard-apple-582092abb1edb766dc42620ec90cd1f18d7cc01e.tar.xz
wireguard-apple-582092abb1edb766dc42620ec90cd1f18d7cc01e.zip
VPN: Start observing the status only if startTunnel() succeeds
This should fix the status change to .disconnected when we're resolving endpoints Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index a36d5d0..05388cd 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -341,7 +341,6 @@ class TunnelContainer: NSObject {
}
// Start the tunnel
- startObservingTunnelStatus()
let session = (tunnelProvider.connection as! NETunnelProviderSession)
do {
os_log("startActivation: Generating options", log: OSLog.default, type: .debug)
@@ -350,6 +349,7 @@ class TunnelContainer: NSObject {
os_log("startActivation: Starting tunnel", log: OSLog.default, type: .debug)
try session.startTunnel(options: tunnelOptions)
os_log("startActivation: Success", log: OSLog.default, type: .debug)
+ startObservingTunnelStatus()
completionHandler(nil)
} catch (let error) {
os_log("startActivation: Error starting tunnel. Examining error", log: OSLog.default, type: .debug)