Skip to content

Commit

Permalink
Reset temporary changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsymons committed Jul 9, 2024
1 parent 4078537 commit cc0bd6d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Sources/NetworkProtection/PacketTunnelProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,10 @@ open class PacketTunnelProvider: NEPacketTunnelProvider {
let startupOptions = StartupOptions(options: options ?? [:])
os_log("Starting tunnel with options: %{public}s", log: .networkProtection, startupOptions.description)

// Reset snooze if the VPN is restarting.
// TODO: Only reset if the user initiated the startup - if the VPN crashed and was restarted by Connect on Demand, then restore snooze mode.
self.snoozeTimingStore.reset()

do {
try load(options: startupOptions)
try loadVendorOptions(from: tunnelProviderProtocol)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public class ConnectionErrorObserverThroughSession: ConnectionErrorObserver {

private func handleStatusChangeNotification(_ notification: Notification) {
do {
guard let session = ConnectionSessionUtilities.session(from: notification) else {
guard let session = ConnectionSessionUtilities.session(from: notification),
session.status == .disconnected else {

return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public class ConnectionServerInfoObserverThroughSession: ConnectionServerInfoObs
// MARK: - Obtaining the NetP VPN status

private func updateServerInfo(session: NETunnelProviderSession) async {
guard session.status == .connected else {
return
}

let serverAddress = await self.serverAddress(from: session)
let serverLocation = await self.serverLocation(from: session)

Expand Down

0 comments on commit cc0bd6d

Please sign in to comment.