From bd1ce11306527514218acbe0d12f7bcc23114239 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Thu, 26 May 2022 18:19:24 -0700 Subject: Fix multiple issues with v1.8+ login sequence Squashed bugs: * A v1.8+ user that has connected but not agreed will show up in chat and the userlist as a blank user name * Race condition where a v1.8+ user in connected but not agreed state duplicated the ID of the next user to connect * A v1.8+ user that is connected but not agreed will receive the user list --- hotline/client_conn.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hotline/client_conn.go') diff --git a/hotline/client_conn.go b/hotline/client_conn.go index 367b70f..8e9a614 100644 --- a/hotline/client_conn.go +++ b/hotline/client_conn.go @@ -37,6 +37,7 @@ type ClientConn struct { Idle bool AutoReply *[]byte Transfers map[int][]*FileTransfer + Agreed bool } func (cc *ClientConn) sendAll(t int, fields ...Field) { @@ -168,7 +169,7 @@ func (cc ClientConn) Disconnect() { // NotifyOthers sends transaction t to other clients connected to the server func (cc ClientConn) NotifyOthers(t Transaction) { for _, c := range sortedClients(cc.Server.Clients) { - if c.ID != cc.ID { + if c.ID != cc.ID && c.Agreed { t.clientID = c.ID cc.Server.outbox <- t } -- cgit