diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-07 15:01:37 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-07 15:01:37 +0100 |
commit | 394a0cbeb03d41af9d791db1c09054e4ad547f6b (patch) | |
tree | c773e491aafdce7f1a56af2a2ccb8e433a8f4ece /WireGuard/WireGuard | |
parent | TunnelsManager: When creating/modifying a tunnel, update the associated object (diff) | |
download | wireguard-apple-394a0cbeb03d41af9d791db1c09054e4ad547f6b.tar.xz wireguard-apple-394a0cbeb03d41af9d791db1c09054e4ad547f6b.zip |
PacketTunnelProvider: proper fix for 32073323
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'WireGuard/WireGuard')
-rw-r--r-- | WireGuard/WireGuard/Tunnel/TunnelsManager.swift | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift index a2fc00b..f0ba84a 100644 --- a/WireGuard/WireGuard/Tunnel/TunnelsManager.swift +++ b/WireGuard/WireGuard/Tunnel/TunnelsManager.swift @@ -442,21 +442,6 @@ class TunnelContainer: NSObject { } func refreshStatus() { - #if os(macOS) - // In macOS, we wait for a few seconds after deactivation to work around a system bug. - // If a tunnel gets activated in this time interval, it's stopped by the system automatically in ~25 seconds. - if self.status == .deactivating && tunnelProvider.connection.status == .disconnected { - self.deactivationTimer?.invalidate() - let deactivationTimer = Timer(timeInterval: 6 /* seconds */, repeats: false) { [weak self] _ in - guard let self = self else { return } - self.status = TunnelStatus(from: self.tunnelProvider.connection.status) - self.isActivateOnDemandEnabled = self.tunnelProvider.isOnDemandEnabled - } - self.deactivationTimer = deactivationTimer - RunLoop.main.add(deactivationTimer, forMode: .common) - return - } - #endif status = TunnelStatus(from: tunnelProvider.connection.status) isActivateOnDemandEnabled = tunnelProvider.isOnDemandEnabled } |