mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Respect WEBSOCKET_OPCODE_CONNECTION_CLOSE coming from client
This commit is contained in:
parent
a66663f0f6
commit
773efb0745
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user