|
@ -93,6 +93,10 @@ static const char *method_strings[] = |
|
|
, "MKACTIVITY" |
|
|
, "MKACTIVITY" |
|
|
, "CHECKOUT" |
|
|
, "CHECKOUT" |
|
|
, "MERGE" |
|
|
, "MERGE" |
|
|
|
|
|
, "M-SEARCH" |
|
|
|
|
|
, "NOTIFY" |
|
|
|
|
|
, "SUBSCRIBE" |
|
|
|
|
|
, "UNSUBSCRIBE" |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -575,12 +579,14 @@ size_t http_parser_execute (http_parser *parser, |
|
|
case 'G': parser->method = HTTP_GET; break; |
|
|
case 'G': parser->method = HTTP_GET; break; |
|
|
case 'H': parser->method = HTTP_HEAD; break; |
|
|
case 'H': parser->method = HTTP_HEAD; break; |
|
|
case 'L': parser->method = HTTP_LOCK; break; |
|
|
case 'L': parser->method = HTTP_LOCK; break; |
|
|
case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE */ break; |
|
|
case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH */ break; |
|
|
|
|
|
case 'N': parser->method = HTTP_NOTIFY; break; |
|
|
case 'O': parser->method = HTTP_OPTIONS; break; |
|
|
case 'O': parser->method = HTTP_OPTIONS; break; |
|
|
case 'P': parser->method = HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break; |
|
|
case 'P': parser->method = HTTP_POST; /* or PROPFIND or PROPPATCH or PUT */ break; |
|
|
case 'R': parser->method = HTTP_REPORT; break; |
|
|
case 'R': parser->method = HTTP_REPORT; break; |
|
|
|
|
|
case 'S': parser->method = HTTP_SUBSCRIBE; break; |
|
|
case 'T': parser->method = HTTP_TRACE; break; |
|
|
case 'T': parser->method = HTTP_TRACE; break; |
|
|
case 'U': parser->method = HTTP_UNLOCK; break; |
|
|
case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; |
|
|
default: goto error; |
|
|
default: goto error; |
|
|
} |
|
|
} |
|
|
state = s_req_method; |
|
|
state = s_req_method; |
|
@ -608,6 +614,8 @@ size_t http_parser_execute (http_parser *parser, |
|
|
parser->method = HTTP_MOVE; |
|
|
parser->method = HTTP_MOVE; |
|
|
} else if (index == 1 && ch == 'E') { |
|
|
} else if (index == 1 && ch == 'E') { |
|
|
parser->method = HTTP_MERGE; |
|
|
parser->method = HTTP_MERGE; |
|
|
|
|
|
} else if (index == 1 && ch == '-') { |
|
|
|
|
|
parser->method = HTTP_MSEARCH; |
|
|
} else if (index == 2 && ch == 'A') { |
|
|
} else if (index == 2 && ch == 'A') { |
|
|
parser->method = HTTP_MKACTIVITY; |
|
|
parser->method = HTTP_MKACTIVITY; |
|
|
} |
|
|
} |
|
@ -615,6 +623,8 @@ size_t http_parser_execute (http_parser *parser, |
|
|
parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ |
|
|
parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ |
|
|
} else if (index == 1 && parser->method == HTTP_POST && ch == 'U') { |
|
|
} else if (index == 1 && parser->method == HTTP_POST && ch == 'U') { |
|
|
parser->method = HTTP_PUT; |
|
|
parser->method = HTTP_PUT; |
|
|
|
|
|
} else if (index == 2 && parser->method == HTTP_UNLOCK && ch == 'S') { |
|
|
|
|
|
parser->method = HTTP_UNSUBSCRIBE; |
|
|
} else if (index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') { |
|
|
} else if (index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') { |
|
|
parser->method = HTTP_PROPPATCH; |
|
|
parser->method = HTTP_PROPPATCH; |
|
|
} else { |
|
|
} else { |
|
@ -628,7 +638,7 @@ size_t http_parser_execute (http_parser *parser, |
|
|
{ |
|
|
{ |
|
|
if (ch == ' ') break; |
|
|
if (ch == ' ') break; |
|
|
|
|
|
|
|
|
if (ch == '/') { |
|
|
if (ch == '/' || ch == '*') { |
|
|
MARK(url); |
|
|
MARK(url); |
|
|
MARK(path); |
|
|
MARK(path); |
|
|
state = s_req_path; |
|
|
state = s_req_path; |
|
|