Browse files

Reset url_mark on s_req_host

add a new scan test. Report and fix by Master Becker.
  • Loading branch information...
1 parent 4afe80a commit 03b8eaa5f8d312f44893cdb61de550993ce3e0c0 @ry ry committed Jul 6, 2010
Showing with 10 additions and 3 deletions.
  1. +1 −0 http_parser.c
  2. +9 −3 test.c
View
1 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;
View
12 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;

0 comments on commit 03b8eaa

Please sign in to comment.