mirror of
https://github.com/cesanta/mongoose.git
synced 2025-06-11 12:14:41 +08:00
Fix #373
This commit is contained in:
parent
6a54704b29
commit
abcea07641
@ -2712,6 +2712,12 @@ size_t mg_websocket_write(struct mg_connection* conn, int opcode,
|
||||
free(copy);
|
||||
}
|
||||
|
||||
// If we send closing frame, schedule a connection to be closed after
|
||||
// data is drained to the client.
|
||||
if (opcode == WEBSOCKET_OPCODE_CONNECTION_CLOSE) {
|
||||
MG_CONN_2_CONN(conn)->ns_conn->flags |= NSF_FINISHED_SENDING_DATA;
|
||||
}
|
||||
|
||||
return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user