Commit 51466df7 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by Cesanta Bot

Check for SEND_AND_CLOSE after HANDSHAKE_REQUEST

Assume handshake request was declined if either MG_F_CLOSE_IMMEDIATELY _or_ MG_F_SEND_AND_CLOSE is set.

PUBLISHED_FROM=60af32a3f8890e826205465b9add2f58b1d46e5f
parent d6259332
...@@ -5633,7 +5633,7 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) { ...@@ -5633,7 +5633,7 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) {
/* Send handshake */ /* Send handshake */
mg_call(nc, nc->handler, MG_EV_WEBSOCKET_HANDSHAKE_REQUEST, hm); mg_call(nc, nc->handler, MG_EV_WEBSOCKET_HANDSHAKE_REQUEST, hm);
if (!(nc->flags & MG_F_CLOSE_IMMEDIATELY)) { if (!(nc->flags & (MG_F_CLOSE_IMMEDIATELY | MG_F_SEND_AND_CLOSE))) {
if (nc->send_mbuf.len == 0) { if (nc->send_mbuf.len == 0) {
mg_ws_handshake(nc, vec); mg_ws_handshake(nc, vec);
} }
......
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