fix: use RUnlock
This commit is contained in:
parent
605b6a6a09
commit
fadbd7c37e
|
@ -149,7 +149,7 @@ func (p *WebSocketPeer) GetChallenge() []byte {
|
||||||
|
|
||||||
func (p *WebSocketPeer) GetIP() net.Addr {
|
func (p *WebSocketPeer) GetIP() net.Addr {
|
||||||
p.BasePeer.lock.RLock()
|
p.BasePeer.lock.RLock()
|
||||||
defer p.BasePeer.lock.Unlock()
|
defer p.BasePeer.lock.RUnlock()
|
||||||
if p.ip != nil {
|
if p.ip != nil {
|
||||||
return p.ip
|
return p.ip
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,6 @@ func (b *WebSocketPeer) GetIPString() string {
|
||||||
|
|
||||||
func (p *WebSocketPeer) Abuser() bool {
|
func (p *WebSocketPeer) Abuser() bool {
|
||||||
p.BasePeer.lock.RLock()
|
p.BasePeer.lock.RLock()
|
||||||
defer p.BasePeer.lock.Unlock()
|
defer p.BasePeer.lock.RUnlock()
|
||||||
return p.abuser
|
return p.abuser
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue