Commit 94296c96 authored by Sergey Lyubka's avatar Sergey Lyubka

Corrected check for websocket connection close

parent ed236ddd
......@@ -4103,9 +4103,9 @@ static void read_websocket(struct mg_connection *conn) {
// Exit the loop if callback signalled to exit,
// or "connection close" opcode received.
if ((conn->ctx->callbacks.websocket_data != NULL &&
!conn->ctx->callbacks.websocket_data(conn, bits, data, data_len)) ||
(bits & 0xf) == 8) { // Opcode == 8, connection close
if ((bits & WEBSOCKET_OPCODE_CONNECTION_CLOSE) ||
(conn->ctx->callbacks.websocket_data != NULL &&
!conn->ctx->callbacks.websocket_data(conn, bits, data, data_len))) {
stop = 1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment