From ebb0bdbe0dbb977a503878205c5d4ca0de8f6651 Mon Sep 17 00:00:00 2001 From: lesismal Date: Tue, 16 Jul 2024 15:35:21 +0800 Subject: [PATCH] websocket: fix callback for nil close message --- nbhttp/websocket/conn.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbhttp/websocket/conn.go b/nbhttp/websocket/conn.go index 87d0bac7..79cde0bc 100644 --- a/nbhttp/websocket/conn.go +++ b/nbhttp/websocket/conn.go @@ -482,7 +482,7 @@ func (c *Conn) Parse(data []byte) error { c.handleDataFrame(msgType, fin, frame) frame = nil } - if protocolMessage != nil { + if fin && opcode == CloseMessage { //protocolMessage != nil { c.handleProtocolMessage(opcode, protocolMessage) protocolMessage = nil }