Fix some http-parser bugs; clean up dill.

This commit is contained in:
C. Guy Yarvin 2013-11-13 21:25:24 -08:00
parent 840679e731
commit 66c4e463e9
2 changed files with 4 additions and 3 deletions

View File

@ -410,8 +410,9 @@ int http_message_needs_eof(http_parser *parser);
static enum state static enum state
parse_url_char(enum state s, const char ch, int is_connect) parse_url_char(enum state s, const char ch, int is_connect)
{ {
assert(!isspace(ch)); if ( isspace(ch) ) {
return s_dead;
}
switch (s) { switch (s) {
case s_req_spaces_before_url: case s_req_spaces_before_url:
if (ch == '/' || ch == '*') { if (ch == '/' || ch == '*') {

View File

@ -642,7 +642,7 @@ _http_heds_to_list(u2_hhed* hed_u)
return u2_nul; return u2_nul;
} else { } else {
return u2nc(u2nc(u2_ci_string(hed_u->nam_c), return u2nc(u2nc(u2_ci_string(hed_u->nam_c),
u2_ci_string(hed_u->val_c)), hed_u->val_c ? u2_ci_string(hed_u->val_c) : u2_nul),
_http_heds_to_list(hed_u->nex_u)); _http_heds_to_list(hed_u->nex_u));
} }
} }