fix websocket plen

This commit is contained in:
lxsang 2019-12-21 17:38:20 +01:00
parent d391b78109
commit 4c9808da78

View File

@ -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);
} }