From e46d210b5d866a16737d960f57fa9f0c50b9f86a Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Fri, 6 Apr 2018 21:29:34 -0400 Subject: [PATCH] fix Client.conn data race during pong; closes #11 --- builtin.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin.go b/builtin.go index e7ccc19..12257ca 100644 --- a/builtin.go +++ b/builtin.go @@ -113,7 +113,9 @@ func handlePING(c *Client, e Event) { } func handlePONG(c *Client, e Event) { + c.conn.mu.Lock() c.conn.lastPong = time.Now() + c.conn.mu.Unlock() } // handleJOIN ensures that the state has updated users and channels.