kore

Kore is a web application platform for writing scalable, concurrent web based processes in C or Python.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit a572a9eeaeee753f0277924b6ff7d32c1e5605ff
parent 1003cbcd503534e5ca9f47da8e295e9ca180b9ca
Author: Joris Vink <joris@coders.se>
Date:   Thu, 16 Jul 2015 06:55:44 +0200

Always correctly add websocket frame length.

In certain scenarios the addition frame length
would not be set, found the hard way.

Diffstat:
src/websocket.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/websocket.c b/src/websocket.c @@ -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);