Pass mg_http_message to MG_EV_WS_OPEN

This commit is contained in:
cpq committed 2021-01-17 11:16:19 +00:00
1 parent ae6fd6aa35
commit 12c32d09fb
5 files changed
+26 -20

No files matched your search

+3 -1
View File
@@ -119,8 +119,10 @@ static void mg_ws_cb(struct mg_connection *c, int ev, void *ev_data,
("%lu WS handshake error: %.*s", c->id, 15, c->recv.buf));
c->is_closing = 1;
} else {
struct mg_http_message hm;
mg_http_parse((char *) c->recv.buf, c->recv.len, &hm);
c->is_websocket = 1;
mg_call(c, MG_EV_WS_OPEN, NULL);
mg_call(c, MG_EV_WS_OPEN, &hm);
}
mg_iobuf_delete(&c->recv, n);
} else {