mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-05 22:08:23 +00:00
Corrected check for websocket connection close
This commit is contained in:
1 parent
ed236dddeb
commit
94296c9697
1 file changed
+3
-3
+3
-3
@@ -4103,9 +4103,9 @@ static void read_websocket(struct mg_connection *conn) {
|
|||||||
|
|
||||||
// Exit the loop if callback signalled to exit,
|
// Exit the loop if callback signalled to exit,
|
||||||
// or "connection close" opcode received.
|
// or "connection close" opcode received.
|
||||||
if ((conn->ctx->callbacks.websocket_data != NULL &&
|
if ((bits & WEBSOCKET_OPCODE_CONNECTION_CLOSE) ||
|
||||||
!conn->ctx->callbacks.websocket_data(conn, bits, data, data_len)) ||
|
(conn->ctx->callbacks.websocket_data != NULL &&
|
||||||
(bits & 0xf) == 8) { // Opcode == 8, connection close
|
!conn->ctx->callbacks.websocket_data(conn, bits, data, data_len))) {
|
||||||
stop = 1;
|
stop = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user