Mercurial > hg > nginx-vendor-0-8
diff src/http/ngx_http_parse.c @ 344:eae74a780a84 NGINX_0_6_16
nginx 0.6.16
*) Change: now the uname(2) is used on Linux instead of procfs.
Thanks to Ilya Novikov.
*) Bugfix: if the "?" character was in a "error_page" directive, then
it was escaped in a proxied request; bug appeared in 0.6.11.
*) Bugfix: compatibility with mget.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 29 Oct 2007 00:00:00 +0300 |
parents | 4276c2f1f434 |
children | b743d290eb3b |
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -124,6 +124,7 @@ ngx_http_parse_request_line(ngx_http_req sw_major_digit, sw_first_minor_digit, sw_minor_digit, + sw_spaces_after_digit, sw_almost_done } state; @@ -636,6 +637,11 @@ ngx_http_parse_request_line(ngx_http_req goto done; } + if (ch == ' ') { + state = sw_spaces_after_digit; + break; + } + if (ch < '0' || ch > '9') { return NGX_HTTP_PARSE_INVALID_REQUEST; } @@ -643,6 +649,20 @@ ngx_http_parse_request_line(ngx_http_req r->http_minor = r->http_minor * 10 + ch - '0'; break; + case sw_spaces_after_digit: + switch (ch) { + case ' ': + break; + case CR: + state = sw_almost_done; + break; + case LF: + goto done; + default: + return NGX_HTTP_PARSE_INVALID_REQUEST; + } + break; + /* end of request line */ case sw_almost_done: r->request_end = p - 1;