Always correctly add websocket frame length.

In certain scenarios the addition frame length
would not be set, found the hard way.
This commit is contained in:
Joris Vink 2015-07-16 06:55:44 +02:00
parent 1003cbcd50
commit a572a9eeae
1 changed files with 1 additions and 1 deletions

View File

@ -174,7 +174,7 @@ websocket_frame_build(struct kore_buf *frame, u_int8_t op, const void *data,
len_1 &= ~(1 << 7);
kore_buf_append(frame, &len_1, sizeof(len_1));
if (len_1 != len) {
if (len_1 > WEBSOCKET_PAYLOAD_SINGLE) {
switch (len_1) {
case WEBSOCKET_PAYLOAD_EXTEND_1:
net_write16((u_int8_t *)&len16, len);