mirror of
https://github.com/lxsang/ant-http
synced 2024-11-17 17:08:20 +01:00
fix websocket plen
This commit is contained in:
parent
d391b78109
commit
4c9808da78
10
lib/ws.c
10
lib/ws.c
@ -250,9 +250,15 @@ void pong(void* client, int len)
|
||||
pheader.opcode = WS_PONG;
|
||||
pheader.plen = len;
|
||||
pheader.mask = 0;
|
||||
uint8_t data[len];
|
||||
if(antd_recv(client,data, len) < 0) return;
|
||||
uint8_t *data = (uint8_t*)malloc(len);
|
||||
if(!data) return;
|
||||
if(antd_recv(client,data, len) < 0)
|
||||
{
|
||||
free(data);
|
||||
return;
|
||||
}
|
||||
ws_send_frame(client,data,pheader);
|
||||
free(data);
|
||||
//_send_header(client, pheader);
|
||||
//send(client, data, len, 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user