Skip to content

Commit

Permalink
Reset url_mark on s_req_host
Browse files Browse the repository at this point in the history
add a new scan test. Report and fix by Master Becker.
  • Loading branch information
ry committed Jul 6, 2010
1 parent 4afe80a commit 03b8eaa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 9 additions & 3 deletions test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 03b8eaa

Please sign in to comment.