diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-10-25 11:44:04 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-10-25 11:44:04 +0200 |
| commit | b4be281671ecfe5c1e6f831614ca1dde48522cd7 (patch) | |
| tree | 60607908ae545d32aabc08d86d22444003744d65 /client/fsm.go | |
| parent | c9603e4a2ec682ca30399205ccbf533f55230ad4 (diff) | |
Client + FSM: Remove background argument from transition
This fixes a race condition reported by Go's -race flag
In the future we should use waitgroups to ensure the OAuth local listener is started before we sent the URL
Diffstat (limited to 'client/fsm.go')
| -rw-r--r-- | client/fsm.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/fsm.go b/client/fsm.go index a1d82f7..767ceaa 100644 --- a/client/fsm.go +++ b/client/fsm.go @@ -292,7 +292,7 @@ func (client *Client) SetConnected() error { return client.handleError(errorMessage, currentServerErr) } - client.FSM.GoTransitionWithData(STATE_CONNECTED, currentServer, false) + client.FSM.GoTransitionWithData(STATE_CONNECTED, currentServer) return nil } @@ -321,7 +321,7 @@ func (client *Client) SetConnecting() error { return client.handleError(errorMessage, currentServerErr) } - client.FSM.GoTransitionWithData(STATE_CONNECTING, currentServer, false) + client.FSM.GoTransitionWithData(STATE_CONNECTING, currentServer) return nil } @@ -350,7 +350,7 @@ func (client *Client) SetDisconnecting() error { return client.handleError(errorMessage, currentServerErr) } - client.FSM.GoTransitionWithData(STATE_DISCONNECTING, currentServer, false) + client.FSM.GoTransitionWithData(STATE_DISCONNECTING, currentServer) return nil } @@ -385,7 +385,7 @@ func (client *Client) SetDisconnected(cleanup bool) error { server.Disconnect(currentServer) } - client.FSM.GoTransitionWithData(STATE_DISCONNECTED, currentServer, false) + client.FSM.GoTransitionWithData(STATE_DISCONNECTED, currentServer) return nil } @@ -414,7 +414,7 @@ func (client *Client) GoBack() error { } // FIXME: Abitrary back transitions don't work because we need the approriate data - client.FSM.GoTransitionWithData(STATE_NO_SERVER, client.Servers, false) + client.FSM.GoTransitionWithData(STATE_NO_SERVER, client.Servers) return nil } |
