diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-04-22 16:24:21 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-04-22 16:44:25 +0200 |
| commit | 8bc4f9badd3faa44e245fd3fb1e4cebdd215bc9c (patch) | |
| tree | 5d41ab7053d631bad3d5852fff30b39576597e9d /client/client.go | |
| parent | b2954faf2746ac6811ee830c2d898c7133bdba88 (diff) | |
Client: Cancel ProxyGuard in Cleanup function
Clients like Android currently do not cleanup ProxyGuard, whilst they
should, it makes sense to just cancel it for them. Cleanup should be
called if possible by the client anyways.
Diffstat (limited to 'client/client.go')
| -rw-r--r-- | client/client.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/client.go b/client/client.go index 773df54..7a6747b 100644 --- a/client/client.go +++ b/client/client.go @@ -49,6 +49,9 @@ type Client struct { // cfg is the config cfg *config.Config + // proxy is proxyguard + proxy Proxy + mu sync.Mutex } @@ -486,6 +489,11 @@ func (c *Client) retrieveTokens(sid string, t srvtypes.Type) (*eduoauth.Token, e // Cleanup cleans up the VPN connection by sending a /disconnect func (c *Client) Cleanup(ck *cookie.Cookie) error { + // cleanup proxyguard + cerr := c.proxy.Cancel() + if cerr != nil { + log.Logger.Debugf("ProxyGuard cancel gave an error: %v", cerr) + } srv, err := c.Servers.CurrentServer() if err != nil { return i18nerr.Wrap(err, "The current server was not found when cleaning up the connection") |
