Respect WEBSOCKET_OPCODE_CONNECTION_CLOSE coming from client

This commit is contained in:
Sergey Lyubka 2015-04-01 18:37:13 +01:00
parent a66663f0f6
commit 773efb0745

View File

@ -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);