mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-15 10:29:47 +00:00
Echo WS CLOSE payload back
This commit is contained in:
1 parent
cfe2e83e6b
commit
ce8fa4c24b
2 files changed
+6
-4
No files matched your search
@@ -192,9 +192,10 @@ static void mg_ws_cb(struct mg_connection *c, int ev, void *ev_data,
|
||||
if (final) mg_call(c, MG_EV_WS_MSG, &m);
|
||||
break;
|
||||
case WEBSOCKET_OP_CLOSE:
|
||||
MG_DEBUG(("%lu Got WS CLOSE", c->id));
|
||||
MG_DEBUG(("%lu WS CLOSE", c->id));
|
||||
mg_call(c, MG_EV_WS_CTL, &m);
|
||||
mg_ws_send(c, "", 0, WEBSOCKET_OP_CLOSE);
|
||||
// Echo the payload of the received CLOSE message back to the sender
|
||||
mg_ws_send(c, m.data.ptr, m.data.len, WEBSOCKET_OP_CLOSE);
|
||||
c->is_draining = 1;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user