From 03b8eaa5f8d312f44893cdb61de550993ce3e0c0 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 6 Jul 2010 12:00:06 +0200 Subject: [PATCH] Reset url_mark on s_req_host add a new scan test. Report and fix by Master Becker. --- http_parser.c | 1 + test.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/http_parser.c b/http_parser.c index ac6366b..1f66803 100644 --- a/http_parser.c +++ b/http_parser.c @@ -324,6 +324,7 @@ size_t http_parser_execute (http_parser *parser, if (state == s_req_path || state == s_req_schema || state == s_req_schema_slash || state == s_req_schema_slash_slash || state == s_req_port || state == s_req_query_string_start || state == s_req_query_string + || state == s_req_host || state == s_req_fragment_start || state == s_req_fragment) url_mark = data; diff --git a/test.c b/test.c index 7d6a13c..09b0cf5 100644 --- a/test.c +++ b/test.c @@ -1675,24 +1675,30 @@ main (void) } } - printf("request scan 1/3 "); + printf("request scan 1/4 "); test_scan( &requests[GET_NO_HEADERS_NO_BODY] , &requests[GET_ONE_HEADER_NO_BODY] , &requests[GET_NO_HEADERS_NO_BODY] ); - printf("request scan 2/3 "); + printf("request scan 2/4 "); test_scan( &requests[POST_CHUNKED_ALL_YOUR_BASE] , &requests[POST_IDENTITY_BODY_WORLD] , &requests[GET_FUNKY_CONTENT_LENGTH] ); - printf("request scan 3/3 "); + printf("request scan 3/4 "); test_scan( &requests[TWO_CHUNKS_MULT_ZERO_END] , &requests[CHUNKED_W_TRAILING_HEADERS] , &requests[CHUNKED_W_BULLSHIT_AFTER_LENGTH] ); + printf("request scan 4/4 "); + test_scan( &requests[QUERY_URL_WITH_QUESTION_MARK_GET] + , &requests[PREFIX_NEWLINE_GET ] + , &requests[CONNECT_REQUEST] + ); + puts("requests okay"); return 0;