TunnelsManager: Handle deactivation of a waiting tunnel
This commit is contained in:
parent
42729a0fe7
commit
66bb9c94d4
|
@ -402,8 +402,13 @@ class TunnelContainer: NSObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
fileprivate func startDeactivation() {
|
fileprivate func startDeactivation() {
|
||||||
assert(status == .active || status == .waiting)
|
|
||||||
let session = (tunnelProvider.connection as! NETunnelProviderSession)
|
let session = (tunnelProvider.connection as! NETunnelProviderSession)
|
||||||
|
if (status == .waiting && (session.status == .disconnected || session.status == .invalid)) {
|
||||||
|
status = .inactive
|
||||||
|
self.onDeactivationComplete?()
|
||||||
|
self.onDeactivationComplete = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
session.stopTunnel()
|
session.stopTunnel()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue