mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 00:38:21 +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.opcode = WS_PONG;
|
||||||
pheader.plen = len;
|
pheader.plen = len;
|
||||||
pheader.mask = 0;
|
pheader.mask = 0;
|
||||||
uint8_t data[len];
|
uint8_t *data = (uint8_t*)malloc(len);
|
||||||
if(antd_recv(client,data, len) < 0) return;
|
if(!data) return;
|
||||||
|
if(antd_recv(client,data, len) < 0)
|
||||||
|
{
|
||||||
|
free(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ws_send_frame(client,data,pheader);
|
ws_send_frame(client,data,pheader);
|
||||||
|
free(data);
|
||||||
//_send_header(client, pheader);
|
//_send_header(client, pheader);
|
||||||
//send(client, data, len, 0);
|
//send(client, data, len, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user