fix: flag abused before closing

This commit is contained in:
Derrick Hammer 2024-01-15 13:40:41 -05:00
parent c2ab3b4651
commit 7d34ac37db
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 1 additions and 2 deletions

View File

@ -105,13 +105,12 @@ func (p *WebSocketPeer) End() error {
return nil return nil
} }
func (p *WebSocketPeer) EndForAbuse() error { func (p *WebSocketPeer) EndForAbuse() error {
p.abused = true
err := p.socket.Close(websocket.StatusPolicyViolation, "") err := p.socket.Close(websocket.StatusPolicyViolation, "")
if err != nil { if err != nil {
return err return err
} }
p.abused = true
return nil return nil
} }
func (p *WebSocketPeer) SetId(id *encoding.NodeId) { func (p *WebSocketPeer) SetId(id *encoding.NodeId) {