0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-05 10:08:36 +02:00

wsockd: use text frames

This commit is contained in:
William Pitcock 2016-04-03 15:15:00 -05:00
parent c0483ac17b
commit 5902547a10

View file

@ -389,7 +389,7 @@ conn_mod_write_short_frame(conn_t * conn, void *data, int len)
{
ws_frame_hdr_t hdr;
ws_frame_set_opcode(&hdr, WEBSOCKET_OPCODE_BINARY_FRAME);
ws_frame_set_opcode(&hdr, WEBSOCKET_OPCODE_TEXT_FRAME);
ws_frame_set_fin(&hdr, 1);
hdr.payload_length_mask = (len + 2) & 0x7f;
@ -403,7 +403,7 @@ conn_mod_write_long_frame(conn_t * conn, void *data, int len)
{
ws_frame_ext_t hdr;
ws_frame_set_opcode(&hdr.header, WEBSOCKET_OPCODE_BINARY_FRAME);
ws_frame_set_opcode(&hdr.header, WEBSOCKET_OPCODE_TEXT_FRAME);
ws_frame_set_fin(&hdr.header, 1);
hdr.header.payload_length_mask = 126;
hdr.payload_length_extended = htons(len + 2);