aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Tunnel
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-08 00:17:05 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-08 02:34:30 +0530
commitecd66defe59d80b184e1b15c6272c33dbf42744c (patch)
treebe0e3814b8f9a883f43b091bdb6e0233e8c7135f /WireGuard/WireGuard/Tunnel
parentTunnelsManager: Log startDeactivation calls (diff)
downloadwireguard-apple-ecd66defe59d80b184e1b15c6272c33dbf42744c.tar.xz
wireguard-apple-ecd66defe59d80b184e1b15c6272c33dbf42744c.zip
TunnelsManager: Don't lose .restarting state
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/Tunnel/TunnelsManager.swift9
1 files changed, 5 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
index cd120a52..e5b59841 100644
--- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
+++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift
@@ -336,10 +336,8 @@ class TunnelsManager {
}
}
- if (tunnel.status == .restarting) && (session.status == .disconnected || session.status == .disconnecting) {
- if session.status == .disconnected {
- tunnel.startActivation(activationDelegate: self.activationDelegate)
- }
+ if tunnel.status == .restarting && session.status == .disconnected {
+ tunnel.startActivation(activationDelegate: self.activationDelegate)
return
}
@@ -442,6 +440,9 @@ class TunnelContainer: NSObject {
}
func refreshStatus() {
+ if (status == .restarting) && (tunnelProvider.connection.status == .disconnected || tunnelProvider.connection.status == .disconnecting) {
+ return
+ }
status = TunnelStatus(from: tunnelProvider.connection.status)
isActivateOnDemandEnabled = tunnelProvider.isOnDemandEnabled
}