From b4be281671ecfe5c1e6f831614ca1dde48522cd7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Tue, 25 Oct 2022 11:44:04 +0200 Subject: 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 --- client/fsm.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client/fsm.go') 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 } -- cgit v1.2.3