v08v13 add support v13 default
authorAndy Green <andy@warmcat.com>
Sun, 25 Sep 2011 08:32:54 +0000 (09:32 +0100)
committerAndy Green <andy@warmcat.com>
Sun, 25 Sep 2011 08:32:54 +0000 (09:32 +0100)
Signed-off-by: Andy Green <andy@warmcat.com>
lib/client-handshake.c
lib/handshake.c
lib/parsers.c
lib/private-libwebsockets.h

index 235ee07..346b741 100644 (file)
@@ -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:
index d41414b..41ba01c 100644 (file)
@@ -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))
index 32b9be5..52f1b7d 100644 (file)
@@ -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];
index e706bf5..b4b63ac 100644 (file)
@@ -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"