From 110025f8e9afd6d6cb5d62a5162d986aac007446 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 15 Feb 2016 13:17:36 -0800 Subject: [PATCH 1/3] Fix regression in IS_HEADER_CHAR check --- http_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/http_parser.c b/http_parser.c index 98e0b9f2..86bede92 100644 --- a/http_parser.c +++ b/http_parser.c @@ -440,7 +440,7 @@ enum http_host_state * character or %x80-FF **/ #define IS_HEADER_CHAR(ch) \ - (ch == CR || ch == LF || ch == 9 || (ch > 31 && ch != 127)) + (ch == CR || ch == LF || ch == 9 || ((unsigned char)ch > 31 && ch != 127)) #define start_state (parser->type == HTTP_REQUEST ? s_start_req : s_start_res) From a3efadaedc69de603a48cac2ad60ccf9fb0e2469 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 15 Feb 2016 13:17:56 -0800 Subject: [PATCH 2/3] Bump to version 2.6.2 --- Makefile | 2 +- http_parser.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b3e0ff4a..9f853da9 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ CC = winegcc BINEXT = .exe.so HELPER = wine else -SONAME ?= libhttp_parser.so.2.6.1 +SONAME ?= libhttp_parser.so.2.6.2 SOEXT ?= so endif diff --git a/http_parser.h b/http_parser.h index e33c0620..0cee4cc8 100644 --- a/http_parser.h +++ b/http_parser.h @@ -27,7 +27,7 @@ extern "C" { /* Also update SONAME in the Makefile whenever you change these. */ #define HTTP_PARSER_VERSION_MAJOR 2 #define HTTP_PARSER_VERSION_MINOR 6 -#define HTTP_PARSER_VERSION_PATCH 1 +#define HTTP_PARSER_VERSION_PATCH 2 #include #if defined(_WIN32) && !defined(__MINGW32__) && \ From 9666c9db246378cf9a6478d375a8850711b5d118 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Fri, 4 Mar 2016 10:06:51 -0800 Subject: [PATCH 3/3] Add requested test case --- test.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test.c b/test.c index 4fcebaf7..b0942282 100644 --- a/test.c +++ b/test.c @@ -1153,6 +1153,26 @@ const struct message requests[] = ,.body= "" } +#define HEADER_OBSTEXT 42 +, {.name = "header obstext" + ,.type=HTTP_REQUEST + ,.raw= "GET /foo HTTP/1.1\r\n" + "X-Foo: Düsseldorf\r\n" + "\r\n" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_GET + ,.request_path= "/foo" + ,.request_url= "/foo" + ,.query_string= "" + ,.fragment= "" + ,.num_headers= 1 + ,.headers= {{"X-Foo", "Düsseldorf"}} + ,.body= "" + } + , {.name= NULL } /* sentinel */ };