From 9514bf88391529c6995be71d3b9a2e33a6fa6c93 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sat, 26 Feb 2011 11:13:56 +0000 Subject: [PATCH] carry over 05 specific stuff to 06 Signed-off-by: Andy Green --- lib/client-handshake.c | 1 + lib/handshake.c | 3 ++- lib/parsers.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/client-handshake.c b/lib/client-handshake.c index 49a31bca3..183277efd 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -103,6 +103,7 @@ libwebsocket_client_connect(struct libwebsocket_context *this, wsi->xor_mask = xor_mask_04; break; case 5: + case 6: wsi->xor_mask = xor_mask_05; break; default: diff --git a/lib/handshake.c b/lib/handshake.c index b4779f412..38a18113d 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -569,7 +569,8 @@ libwebsocket_read(struct libwebsocket_context *this, struct libwebsocket *wsi, if (handshake_0405(wsi)) goto bail; break; - case 5: /* 05 */ + case 5: + case 6: wsi->xor_mask = xor_mask_05; debug("libwebsocket_parse calling handshake_04\n"); if (handshake_0405(wsi)) diff --git a/lib/parsers.c b/lib/parsers.c index 481caf1fd..8a0f564d8 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -279,6 +279,7 @@ static int libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c) break; case 4: case 5: + case 6: wsi->all_zero_nonce = 1; wsi->frame_masking_nonce_04[0] = c; if (c) @@ -678,6 +679,7 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c) break; case 4: case 5: + case 6: /* * 04 logical framing from the spec (all this is masked when * incoming and has to be unmasked) @@ -1124,6 +1126,7 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, case 4: case 5: + case 6: switch (protocol & 0xf) { case LWS_WRITE_TEXT: n = LWS_WS_OPCODE_04__TEXT_FRAME;