From 02a3a82cb2d14bc43102aea56437bab4a5d588b2 Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sat, 7 Feb 2026 18:45:19 -0600 Subject: start and stop vpn polling --- src/slskd/Core/ConnectionWatchdog.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/slskd/Core/ConnectionWatchdog.cs b/src/slskd/Core/ConnectionWatchdog.cs index 6250a0ba..2dd2f791 100644 --- a/src/slskd/Core/ConnectionWatchdog.cs +++ b/src/slskd/Core/ConnectionWatchdog.cs @@ -115,6 +115,11 @@ namespace slskd /// This should be called at application startup. public virtual void Start() { + if (OptionsAtStartup.Integration.Vpn.Enabled) + { + VPN.StartPolling(); + } + WatchdogTimer.Enabled = true; UpdateApplicationState(); @@ -147,6 +152,13 @@ namespace slskd /// This should be called when the application is reasonably certain that the connection is connected. public virtual void Stop(bool abortReconnect = false) { + // if the VPN is required, we have to keep polling in the background so we can disconnect if it drops + // this is a belt-and-suspenders effort to ensure maximum protection in case someone doesn't have a kill switch + if (OptionsAtStartup.Integration.Vpn.Required) + { + VPN.StopPolling(); + } + // stop the timer first to avoid having it start the connection process again when the cts is cancelled WatchdogTimer.Enabled = false; UpdateApplicationState(); -- cgit v1.2.3