aboutsummaryrefslogtreecommitdiff
path: root/hotline/client_conn.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 15:27:54 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2022-06-05 15:27:54 -0700
commit0a92e50b2704c1eb02233c9aa5778d21455d345b (patch)
tree27739e4471b5771a90cc58ac568fe268578f5c28 /hotline/client_conn.go
parentd1cd666473e5d9097b34bad3388c8c0595612089 (diff)
Fix some data races
Diffstat (limited to 'hotline/client_conn.go')
-rw-r--r--hotline/client_conn.go4
1 files changed, 2 insertions, 2 deletions
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