diff options
author | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
---|---|---|
committer | Jerome Loyet <fat@php.net> | 2012-09-27 23:57:06 +0200 |
commit | 0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc (patch) | |
tree | 04bbcd1a5da16ea5246d39c1bcae45b9eb67c526 /sapi/cli/php_http_parser.c | |
parent | 1fa8ecd082607858084994ad7081ef06e37db5f5 (diff) | |
parent | 6a50a8640c562a41d90c7ab46affa767b97d2621 (diff) | |
download | php-git-0bffdd723fb1acbc8b1ef62768fa2f33c2d02bbc.tar.gz |
Merge branch 'PHP-5.4' of git.php.net:php-src into PHP-5.4
* 'PHP-5.4' of git.php.net:php-src: (367 commits)
fix unix/win dir separators
Fix bug #63173: Crash when invoking invalid array callback
Correct the test summary
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Fixed bug #60723 (error_log error time has changed to UTC ignoring default timezo)
Avoid calling select if maxfd returned by curl_multi_fdset is -1
Fixing NEWS file
Fixed bug #63111 (is_callable() lies for abstract static method)
updated lib versions
Fix folding
fix bug #63015 (Incorrect arginfo for DOMErrorHandler)
Bug #63000: MCAST_JOIN_GROUP on OSX is broken
Fixed bug #61442 (exception threw in __autoload can not be catched)
Merging PR #116
Merged GitHub PR #190: Support for the HTTP PATCH method in CLI webserver
updated libary versions
split tests for the new zlib version on win
Fixed Bug #63103 (ext\curl\tests\bug62839.phpt broken)
update news
Support building PHP with the native client toolchain.
...
Diffstat (limited to 'sapi/cli/php_http_parser.c')
-rw-r--r-- | sapi/cli/php_http_parser.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sapi/cli/php_http_parser.c b/sapi/cli/php_http_parser.c index 13b9ea12bc..d3bc496f4e 100644 --- a/sapi/cli/php_http_parser.c +++ b/sapi/cli/php_http_parser.c @@ -81,6 +81,7 @@ static const char *method_strings[] = , "HEAD" , "POST" , "PUT" + , "PATCH" , "CONNECT" , "OPTIONS" , "TRACE" @@ -99,6 +100,7 @@ static const char *method_strings[] = , "NOTIFY" , "SUBSCRIBE" , "UNSUBSCRIBE" + , "NOTIMPLEMENTED" }; @@ -589,7 +591,7 @@ size_t php_http_parser_execute (php_http_parser *parser, case 'S': parser->method = PHP_HTTP_SUBSCRIBE; break; case 'T': parser->method = PHP_HTTP_TRACE; break; case 'U': parser->method = PHP_HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; - default: goto error; + default: parser->method = PHP_HTTP_NOT_IMPLEMENTED; break; } state = s_req_method; break; @@ -602,7 +604,7 @@ size_t php_http_parser_execute (php_http_parser *parser, goto error; matcher = method_strings[parser->method]; - if (ch == ' ' && matcher[index] == '\0') { + if (ch == ' ' && (matcher[index] == '\0' || parser->method == PHP_HTTP_NOT_IMPLEMENTED)) { state = s_req_spaces_before_url; } else if (ch == matcher[index]) { ; /* nada */ @@ -626,12 +628,14 @@ size_t php_http_parser_execute (php_http_parser *parser, parser->method = PHP_HTTP_PROPFIND; /* or HTTP_PROPPATCH */ } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'U') { parser->method = PHP_HTTP_PUT; + } else if (index == 1 && parser->method == PHP_HTTP_POST && ch == 'A') { + parser->method = PHP_HTTP_PATCH; } else if (index == 2 && parser->method == PHP_HTTP_UNLOCK && ch == 'S') { parser->method = PHP_HTTP_UNSUBSCRIBE; } else if (index == 4 && parser->method == PHP_HTTP_PROPFIND && ch == 'P') { parser->method = PHP_HTTP_PROPPATCH; } else { - goto error; + parser->method = PHP_HTTP_NOT_IMPLEMENTED; } ++index; |