Delay tunnel disposal (#311)
Postpone reconnection due to on-demand trigger.
This commit is contained in:
parent
d7fbeb0d90
commit
11ae9e4141
|
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- Upgrade OpenSSL to 1.1.1q.
|
- Upgrade OpenSSL to 1.1.1q.
|
||||||
- Use natively async methods from NetworkExtension. [#284](https://github.com/passepartoutvpn/tunnelkit/pull/284)
|
- Use natively async methods from NetworkExtension. [#284](https://github.com/passepartoutvpn/tunnelkit/pull/284)
|
||||||
- OpenVPN: Unmask PUSH_REPLY and network settings in logs.
|
- OpenVPN: Unmask PUSH_REPLY and network settings in logs.
|
||||||
|
- OpenVPN: Delay tunnel disposal. [#311](https://github.com/passepartoutvpn/tunnelkit/pull/311)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|
|
@ -331,6 +331,13 @@ open class OpenVPNTunnelProvider: NEPacketTunnelProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func disposeTunnel(error: Error?) {
|
private func disposeTunnel(error: Error?) {
|
||||||
|
log.info("Dispose tunnel in \(reconnectionDelay) milliseconds...")
|
||||||
|
tunnelQueue.asyncAfter(deadline: .now() + .milliseconds(reconnectionDelay)) { [weak self] in
|
||||||
|
self?.reallyDisposeTunnel(error: error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private func reallyDisposeTunnel(error: Error?) {
|
||||||
flushLog()
|
flushLog()
|
||||||
|
|
||||||
// failed to start
|
// failed to start
|
||||||
|
|
Loading…
Reference in New Issue