Commit 773efb07 authored by Sergey Lyubka's avatar Sergey Lyubka

Respect WEBSOCKET_OPCODE_CONNECTION_CLOSE coming from client

parent a66663f0
...@@ -3032,7 +3032,8 @@ static size_t deliver_websocket_frame(struct connection *conn) { ...@@ -3032,7 +3032,8 @@ static size_t deliver_websocket_frame(struct connection *conn) {
} }
// Call the handler and remove frame from the iobuf // Call the handler and remove frame from the iobuf
if (call_user(conn, MG_REQUEST) == MG_FALSE) { if (call_user(conn, MG_REQUEST) == MG_FALSE ||
(buf[0] & 0x0f) == WEBSOCKET_OPCODE_CONNECTION_CLOSE) {
conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
} }
iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len); iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len);
......
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