mirror of https://github.com/ospab/ostp.git
Two separate problems reported after waking a laptop: the app sits on "connecting" forever, and there is NO working internet at all — not just no tunnel. Plus typing in the GUI's exclusion fields lagged by seconds. 1. Resume reconnect retried forever (a regression I introduced when making the resume reconnect retry instead of firing once). handle_keepalive(force=true) deliberately skips the hard-timeout branch, and that branch is the one that releases the SystemProxyGuard. So a resume campaign that never succeeded also never gave up, and the system proxy stayed pointed at our local listener indefinitely — which kills all browser traffic, tunnel or not, and explains "no internet even from my ISP". Now bounded: after 45s of failed resume reconnects, hand back to the ordinary stall path, which restores the proxy (or, with kill switch on, keeps blocking deliberately). Measured on the wall clock, because Instant does not advance across suspend on Windows — QPC stops — so a monotonic deadline cannot bound anything that starts at wake. That same property is why the pre-existing 25s/180s stall checks never fired here either. 2. GUI froze while typing. Every debounced save (400ms, so it fires during natural pauses in typing) called set_autostart — a Windows registry write — even when the checkbox had not changed, and, while connected, wrote the config and ran reload_tunnel, tearing down and rebuilding the tunnel. Worst in the exclusion fields, which is exactly where it was reported. Autostart now applies only on change; the tunnel hot-reload only when a setting the tunnel actually reads has changed, on a 1.5s debounce so it lands after editing rather than between keystrokes. The cheap local save still runs on every keystroke. |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| test_udp.rs | ||