From 7d34ac37dbd9f057df9d590d246275e8b69b08eb Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Mon, 15 Jan 2024 13:40:41 -0500 Subject: [PATCH] fix: flag abused before closing --- net/ws.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/ws.go b/net/ws.go index ace8c6f..95e15de 100644 --- a/net/ws.go +++ b/net/ws.go @@ -105,13 +105,12 @@ func (p *WebSocketPeer) End() error { return nil } func (p *WebSocketPeer) EndForAbuse() error { + p.abused = true err := p.socket.Close(websocket.StatusPolicyViolation, "") if err != nil { return err } - p.abused = true - return nil } func (p *WebSocketPeer) SetId(id *encoding.NodeId) {