From 4b23c725868b238bfafd03156404bd37134dff4a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 20 Dec 2010 09:19:37 +0000 Subject: [PATCH] clean--move-v2-support-to-claim-v3.patch Signed-off-by: Andy Green --- lib/handshake.c | 2 +- lib/parsers.c | 22 +++++++++++----------- libwebsockets.spec | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/handshake.c b/lib/handshake.c index 74f3954..f1ad601 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -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 " diff --git a/lib/parsers.c b/lib/parsers.c index 2c9d6c2..42f821a 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -22,16 +22,16 @@ #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 */ diff --git a/libwebsockets.spec b/libwebsockets.spec index 95eca4d..44af184 100644 --- a/libwebsockets.spec +++ b/libwebsockets.spec @@ -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 -- 2.7.4