From fadbd7c37eaa926deba38804f0597f0fd87ce117 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 11 Mar 2024 17:48:33 -0400 Subject: [PATCH] fix: use RUnlock --- net/ws.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ws.go b/net/ws.go index 695ab25..3a2d4eb 100644 --- a/net/ws.go +++ b/net/ws.go @@ -149,7 +149,7 @@ func (p *WebSocketPeer) GetChallenge() []byte { func (p *WebSocketPeer) GetIP() net.Addr { p.BasePeer.lock.RLock() - defer p.BasePeer.lock.Unlock() + defer p.BasePeer.lock.RUnlock() if p.ip != nil { return p.ip } @@ -176,6 +176,6 @@ func (b *WebSocketPeer) GetIPString() string { func (p *WebSocketPeer) Abuser() bool { p.BasePeer.lock.RLock() - defer p.BasePeer.lock.Unlock() + defer p.BasePeer.lock.RUnlock() return p.abuser }