aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hop.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/hop.go b/hop.go
index d64ec21..ae856ef 100644
--- a/hop.go
+++ b/hop.go
@@ -31,7 +31,10 @@ func (cc *clientConn) hop(serverName string) error {
// This needs to be done before the serverConn is closed
// so the clientConn isn't closed by the packet handler
+ cc.mu.Lock()
cc.server().clt = nil
+ cc.mu.Unlock()
+
cc.server().Close()
// Reset the client to its initial state