From 0a92e50b2704c1eb02233c9aa5778d21455d345b Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sun, 5 Jun 2022 15:27:54 -0700 Subject: Fix some data races --- hotline/client_conn.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hotline/client_conn.go') diff --git a/hotline/client_conn.go b/hotline/client_conn.go index 4a471b3..65e18ee 100644 --- a/hotline/client_conn.go +++ b/hotline/client_conn.go @@ -151,7 +151,7 @@ func (cc *ClientConn) Authorize(access int) bool { } // Disconnect notifies other clients that a client has disconnected -func (cc ClientConn) Disconnect() { +func (cc *ClientConn) Disconnect() { cc.Server.mux.Lock() defer cc.Server.mux.Unlock() @@ -165,7 +165,7 @@ func (cc ClientConn) Disconnect() { } // notifyOthers sends transaction t to other clients connected to the server -func (cc ClientConn) notifyOthers(t Transaction) { +func (cc *ClientConn) notifyOthers(t Transaction) { for _, c := range sortedClients(cc.Server.Clients) { if c.ID != cc.ID && c.Agreed { t.clientID = c.ID -- cgit