diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-04-17 13:37:22 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | 924dd1fdec6cf4d1d5a304e2f5a1a1d7662372bb (patch) | |
| tree | 3879eb65b55bdee5dfe3c2c05f0a9741036d49d8 | |
| parent | 539d39d4ce2a4d9076d24c958389a8dae5fedce4 (diff) | |
Client: Re-create failover object on new call
This additional bookkeeping is not needed now because we have contexts
| -rw-r--r-- | client/client.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/client/client.go b/client/client.go index 28080b0..d6b3597 100644 --- a/client/client.go +++ b/client/client.go @@ -109,9 +109,6 @@ type Client struct { // Whether to enable debugging Debug bool `json:"-"` - // The Failover monitor for the current VPN connection - Failover *failover.DroppedConMon `json:"-"` - // TokenSetter sets the tokens in the client TokenSetter func(srv srvtypes.Current, tok srvtypes.Tokens) `json:"-"` @@ -840,12 +837,8 @@ func (c *Client) RenewSession(ck *cookie.Cookie) (err error) { return c.callbacks(ck, srv, true) } -func (c *Client) StartFailover(ck *cookie.Cookie, gateway string, wgMTU int, readRxBytes func() (int64, error)) (bool, error) { - if c.Failover != nil { - return false, errors.New("another failover process is already started") - } - - c.Failover = failover.New(readRxBytes) +func (c *Client) StartFailover(ck *cookie.Cookie, gateway string, mtu int, readRxBytes func() (int64, error)) (bool, error) { + f := failover.New(readRxBytes) - return c.Failover.Start(ck.Context(), gateway, wgMTU) + return f.Start(ck.Context(), gateway, mtu) } |
