fix(ios-vpn): activateUrlFilter — Tunnel-Status bis .connected pollen
Die Warte-Schleife lief nur solange status==.connecting. Direkt nach startVPNTunnel() steht der Status aber oft noch kurz auf .disconnected → Schleife uebersprungen → sofort false-negative 'tunnel_not_connected', obwohl der Tunnel Sekundenbruchteile spaeter sauber connected. Jetzt: pollen bis .connected oder .invalid oder ~6s Timeout. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
1aa86c2c0c
commit
e946fbe443
@ -130,11 +130,14 @@ public class RebreakProtectionModule: Module {
|
|||||||
SharedLogStore.append("🚀 [activateUrlFilter] startVPNTunnel...")
|
SharedLogStore.append("🚀 [activateUrlFilter] startVPNTunnel...")
|
||||||
try session.startVPNTunnel()
|
try session.startVPNTunnel()
|
||||||
|
|
||||||
// Auf stabilen Status warten (max ~3,2s) — direkt nach dem Start
|
// Auf .connected warten. Direkt nach startVPNTunnel() steht der Status
|
||||||
// steht er auf .connecting.
|
// oft noch kurz auf .disconnected, BEVOR er auf .connecting → .connected
|
||||||
|
// wechselt. Daher pollen bis .connected ODER Timeout (≈6s) — NICHT nur
|
||||||
|
// solange .connecting (sonst false-negative tunnel_not_connected in der
|
||||||
|
// frühen .disconnected-Phase). .invalid = Konfig-Fehler → sofort raus.
|
||||||
var status = manager.connection.status
|
var status = manager.connection.status
|
||||||
var waited = 0
|
var waited = 0
|
||||||
while (status == .connecting || status == .reasserting) && waited < 8 {
|
while status != .connected && status != .invalid && waited < 15 {
|
||||||
try? await Task.sleep(nanoseconds: 400_000_000)
|
try? await Task.sleep(nanoseconds: 400_000_000)
|
||||||
status = manager.connection.status
|
status = manager.connection.status
|
||||||
waited += 1
|
waited += 1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user