mirror of
https://github.com/fosrl/newt.git
synced 2026-02-08 05:56:40 +00:00
Stop sending requests when you get a terminate
This commit is contained in:
5
main.go
5
main.go
@@ -479,6 +479,11 @@ persistent_keepalive_interval=5`, fixKey(privateKey.String()), fixKey(wgData.Pub
|
|||||||
// Close the WireGuard device and TUN
|
// Close the WireGuard device and TUN
|
||||||
closeWgTunnel()
|
closeWgTunnel()
|
||||||
|
|
||||||
|
if stopFunc != nil {
|
||||||
|
stopFunc() // stop the ws from sending more requests
|
||||||
|
stopFunc = nil // reset stopFunc to nil to avoid double stopping
|
||||||
|
}
|
||||||
|
|
||||||
// Mark as disconnected
|
// Mark as disconnected
|
||||||
connected = false
|
connected = false
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user