Skip to content

Commit

Permalink
Respect WEBSOCKET_OPCODE_CONNECTION_CLOSE coming from client
Browse files Browse the repository at this point in the history
  • Loading branch information
cpq committed Apr 1, 2015
1 parent a66663f commit 773efb0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -3032,7 +3032,8 @@ static size_t deliver_websocket_frame(struct connection *conn) {
}

// 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;
}
iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len);
Expand Down

0 comments on commit 773efb0

Please sign in to comment.