mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 11:09:01 +08:00
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
This commit is contained in:
parent
d6259332d4
commit
51466df7b9
@ -5633,7 +5633,7 @@ void mg_http_handler(struct mg_connection *nc, int ev, void *ev_data) {
|
||||
|
||||
/* Send handshake */
|
||||
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) {
|
||||
mg_ws_handshake(nc, vec);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user