clean--move-v2-support-to-claim-v3.patch
authorAndy Green <andy@warmcat.com>
Mon, 20 Dec 2010 09:19:37 +0000 (09:19 +0000)
committerAndy Green <andy@warmcat.com>
Mon, 20 Dec 2010 09:19:37 +0000 (09:19 +0000)
Signed-off-by: Andy Green <andy@warmcat.com>
lib/handshake.c
lib/parsers.c
libwebsockets.spec

index 74f3954..f1ad601 100644 (file)
@@ -132,7 +132,7 @@ libwebsocket_read(struct libwebsocket *wsi, unsigned char * buf, size_t len)
                                   atoi(wsi->utf8_token[WSI_TOKEN_DRAFT].token);
                        switch (wsi->ietf_spec_revision) {
                        case 76:
-                       case 2:
+                       case 3:
                                break;
                        default:
                                fprintf(stderr, "Rejecting handshake on seeing "
index 2c9d6c2..42f821a 100644 (file)
 #include "private-libwebsockets.h"
 
 const struct lws_tokens lws_tokens[WSI_TOKEN_COUNT] = {
-       { "GET ", 4 },
-       { "Host:", 5 },
-       { "Connection:", 11 },
-       { "Sec-WebSocket-Key1:", 19 },
-       { "Sec-WebSocket-Key2:", 19 },
-       { "Sec-WebSocket-Protocol:", 23 },
-       { "Upgrade:", 8 },
-       { "Origin:", 7 },
-       { "Sec-WebSocket-Draft:", 20 },
-       { "\x0d\x0a", 2 },
+       [WSI_TOKEN_GET_URI]     = { "GET ",                     4 },
+       [WSI_TOKEN_HOST]        = { "Host:",                    5 },
+       [WSI_TOKEN_CONNECTION]  = { "Connection:",              11 },
+       [WSI_TOKEN_KEY1]        = { "Sec-WebSocket-Key1:",      19 },
+       [WSI_TOKEN_KEY2]        = { "Sec-WebSocket-Key2:",      19 },
+       [WSI_TOKEN_PROTOCOL]    = { "Sec-WebSocket-Protocol:",  23 },
+       [WSI_TOKEN_UPGRADE]     = { "Upgrade:",                 8 },
+       [WSI_TOKEN_ORIGIN]      = { "Origin:",                  7 },
+       [WSI_TOKEN_DRAFT]       = { "Sec-WebSocket-Draft:",     20 },
+       [WSI_TOKEN_CHALLENGE]   = { "\x0d\x0a",                 2 },
 };
 
 int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c)
@@ -363,7 +363,7 @@ int libwebsocket_write(struct libwebsocket *wsi, unsigned char *buf,
                break;
 
        /* just an unimplemented spec right now apparently */
-       case 2:
+       case 3:
                n = 4; /* text */
                if (protocol == LWS_WRITE_BINARY)
                        n = 5; /* binary */
index 95eca4d..44af184 100644 (file)
@@ -1,6 +1,6 @@
 Name: libwebsockets
 Version: 0.1
-Release: 34.gmaster_8f037e4c%{?dist}
+Release: 35.gmaster_8322b370%{?dist}
 Summary: Websocket Server Library
 
 Group: System