Skip to content

Commit

Permalink
Tentatively fixes connectivity and tunnel start issues
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Jul 3, 2024
1 parent 912001a commit 35d37c2
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Sources/NetworkProtection/PacketTunnelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
// expired. In either case it should be enough to record the manual failures
// for these prerequisited to avoid flooding our metrics.
providerEvents.fire(.tunnelStartOnDemandWithoutAccessToken)
try? await Task.sleep(interval: .seconds(15))
try await Task.sleep(interval: .seconds(15))
} else {
// If the VPN was started manually without the basic prerequisites we always
// want to know as this should not be possible.
Expand Down Expand Up @@ -631,7 +631,7 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
// We add a delay when the VPN is started by
// on-demand and there's an error, to avoid frenetic ON/OFF
// cycling.
try? await Task.sleep(interval: .seconds(15))
try await Task.sleep(interval: .seconds(15))
}

let errorDescription = (error as? LocalizedError)?.localizedDescription ?? String(describing: error)
Expand Down Expand Up @@ -1297,13 +1297,6 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
connectionStatus = .connected(connectedDate: Date())
}

if !settings.disableRekeying {
guard !isKeyExpired else {
try await rekey()
return
}
}

os_log("🔵 Tunnel interface is %{public}@", log: .networkProtection, type: .info, adapter.interfaceName ?? "unknown")

// These cases only make sense in the context of a connection that had trouble
Expand Down

0 comments on commit 35d37c2

Please sign in to comment.