Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 88aaff9

Browse files
committedJan 25, 2015
deps: update http_parser to 2.4.2
Fix: nodejs#588 PR-URL: nodejs#604 Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 804ab7e commit 88aaff9

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed
 

‎deps/http_parser/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# IN THE SOFTWARE.
2020

2121
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
22-
SONAME ?= libhttp_parser.so.2.4.1
22+
SONAME ?= libhttp_parser.so.2.4.2
2323

2424
CC?=gcc
2525
AR?=ar

‎deps/http_parser/http_parser.c

+2
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ size_t http_parser_execute (http_parser *parser,
16181618
h_state = h_matching_connection_upgrade;
16191619
} else if (STRICT_TOKEN(c)) {
16201620
h_state = h_matching_connection_token;
1621+
} else if (c == ' ' || c == '\t') {
1622+
/* Skip lws */
16211623
} else {
16221624
h_state = h_general;
16231625
}

‎deps/http_parser/http_parser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
/* Also update SONAME in the Makefile whenever you change these. */
2828
#define HTTP_PARSER_VERSION_MAJOR 2
2929
#define HTTP_PARSER_VERSION_MINOR 4
30-
#define HTTP_PARSER_VERSION_PATCH 1
30+
#define HTTP_PARSER_VERSION_PATCH 2
3131

3232
#include <sys/types.h>
3333
#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600)

‎deps/http_parser/test.c

+49
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,55 @@ const struct message requests[] =
986986
,.body= ""
987987
}
988988

989+
#define CONNECTION_MULTI_LWS 36
990+
, {.name = "multiple connection header values with folding and lws"
991+
,.type= HTTP_REQUEST
992+
,.raw= "GET /demo HTTP/1.1\r\n"
993+
"Connection: keep-alive, upgrade\r\n"
994+
"Upgrade: WebSocket\r\n"
995+
"\r\n"
996+
"Hot diggity dogg"
997+
,.should_keep_alive= TRUE
998+
,.message_complete_on_eof= FALSE
999+
,.http_major= 1
1000+
,.http_minor= 1
1001+
,.method= HTTP_GET
1002+
,.query_string= ""
1003+
,.fragment= ""
1004+
,.request_path= "/demo"
1005+
,.request_url= "/demo"
1006+
,.num_headers= 2
1007+
,.upgrade="Hot diggity dogg"
1008+
,.headers= { { "Connection", "keep-alive, upgrade" }
1009+
, { "Upgrade", "WebSocket" }
1010+
}
1011+
,.body= ""
1012+
}
1013+
1014+
#define CONNECTION_MULTI_LWS_CRLF 37
1015+
, {.name = "multiple connection header values with folding and lws"
1016+
,.type= HTTP_REQUEST
1017+
,.raw= "GET /demo HTTP/1.1\r\n"
1018+
"Connection: keep-alive, \r\n upgrade\r\n"
1019+
"Upgrade: WebSocket\r\n"
1020+
"\r\n"
1021+
"Hot diggity dogg"
1022+
,.should_keep_alive= TRUE
1023+
,.message_complete_on_eof= FALSE
1024+
,.http_major= 1
1025+
,.http_minor= 1
1026+
,.method= HTTP_GET
1027+
,.query_string= ""
1028+
,.fragment= ""
1029+
,.request_path= "/demo"
1030+
,.request_url= "/demo"
1031+
,.num_headers= 2
1032+
,.upgrade="Hot diggity dogg"
1033+
,.headers= { { "Connection", "keep-alive, upgrade" }
1034+
, { "Upgrade", "WebSocket" }
1035+
}
1036+
,.body= ""
1037+
}
9891038

9901039
, {.name= NULL } /* sentinel */
9911040
};

0 commit comments

Comments
 (0)
Please sign in to comment.