fix: use RUnlock

This commit is contained in:
Derrick Hammer 2024-03-11 17:48:33 -04:00
parent 605b6a6a09
commit fadbd7c37e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 2 additions and 2 deletions

View File

@ -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
}