TunnelsManager: Handle deactivation of a waiting tunnel
Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
parent
707f292e4e
commit
b491b9c371
|
@ -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