From: Andy Green Date: Sun, 25 Sep 2011 08:32:54 +0000 (+0100) Subject: v08v13 add support v13 default X-Git-Tag: 1.2~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d85cb2083d2525e38acac88ccd727deac2287804;p=profile%2Fivi%2Flibwebsockets.git v08v13 add support v13 default Signed-off-by: Andy Green --- diff --git a/lib/client-handshake.c b/lib/client-handshake.c index 235ee07..346b741 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -252,6 +252,8 @@ libwebsocket_client_connect(struct libwebsocket_context *context, case 5: case 6: case 7: + case 8: + case 13: wsi->xor_mask = xor_mask_05; break; default: diff --git a/lib/handshake.c b/lib/handshake.c index d41414b..41ba01c 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -699,6 +699,8 @@ libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi case 5: case 6: case 7: + case 8: + case 13: wsi->xor_mask = xor_mask_05; debug("libwebsocket_parse calling handshake_04\n"); if (handshake_0405(context, wsi)) diff --git a/lib/parsers.c b/lib/parsers.c index 32b9be5..52f1b7d 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -297,7 +297,7 @@ libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c) case LWS_RXPS_NEW: switch (wsi->ietf_spec_revision) { - /* Firefox 4.0b6 likes this as of 30 Oct */ + /* Firefox 4.0b6 likes this as of 30 Oct 2010 */ case 0: if (c == 0xff) wsi->lws_rx_parse_state = LWS_RXPS_SEEN_76_FF; @@ -317,6 +317,8 @@ libwebsocket_rx_sm(struct libwebsocket *wsi, unsigned char c) wsi->lws_rx_parse_state = LWS_RXPS_04_MASK_NONCE_1; break; case 7: + case 8: + case 13: /* * no prepended frame key any more */ @@ -847,6 +849,8 @@ int libwebsocket_client_rx_sm(struct libwebsocket *wsi, unsigned char c) case 5: case 6: case 7: + case 8: + case 13: /* * 04 logical framing from the spec (all this is masked when * incoming and has to be unmasked) @@ -1573,8 +1577,8 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, return -1; switch (wsi->ietf_spec_revision) { - /* chrome likes this as of 30 Oct */ - /* Firefox 4.0b6 likes this as of 30 Oct */ + /* chrome likes this as of 30 Oct 2010 */ + /* Firefox 4.0b6 likes this as of 30 Oct 2010 */ case 0: if ((protocol & 0xf) == LWS_WRITE_BINARY) { /* in binary mode we send 7-bit used length blocks */ @@ -1607,6 +1611,8 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf, break; case 7: + case 8: + case 13: if (masked7) { pre += 4; dropmask = &buf[0 - pre]; diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index e706bf5..b4b63ac 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -114,7 +114,7 @@ void debug(const char *format, ...) #define MAX_BROADCAST_PAYLOAD 2048 #define LWS_MAX_PROTOCOLS 10 #define LWS_MAX_EXTENSIONS_ACTIVE 10 -#define SPEC_LATEST_SUPPORTED 7 +#define SPEC_LATEST_SUPPORTED 13 #define MAX_WEBSOCKET_04_KEY_LEN 128 #define SYSTEM_RANDOM_FILEPATH "/dev/urandom"