Fix leaks when reconnecting from menu
LightVPNManager implementation was still disabling/enabling VPN manually instead of using reconnect() atomically, which led to an IP leak in between the two steps.
This commit is contained in:
parent
7a700408a8
commit
0f790a9401
|
@ -92,11 +92,7 @@ class DefaultLightVPNManager: LightVPNManager {
|
||||||
@MainActor
|
@MainActor
|
||||||
func reconnect() {
|
func reconnect() {
|
||||||
Task {
|
Task {
|
||||||
if isEnabled {
|
await vpnManager.reconnect()
|
||||||
await vpnManager.disable()
|
|
||||||
try? await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)
|
|
||||||
}
|
|
||||||
try? await vpnManager.connectWithActiveProfile(toServer: nil)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue