comparison 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
comparison
equal deleted inserted replaced
343:81bf600d64d5 344:eae74a780a84
122 sw_http_HTTP, 122 sw_http_HTTP,
123 sw_first_major_digit, 123 sw_first_major_digit,
124 sw_major_digit, 124 sw_major_digit,
125 sw_first_minor_digit, 125 sw_first_minor_digit,
126 sw_minor_digit, 126 sw_minor_digit,
127 sw_spaces_after_digit,
127 sw_almost_done 128 sw_almost_done
128 } state; 129 } state;
129 130
130 state = r->state; 131 state = r->state;
131 132
634 635
635 if (ch == LF) { 636 if (ch == LF) {
636 goto done; 637 goto done;
637 } 638 }
638 639
640 if (ch == ' ') {
641 state = sw_spaces_after_digit;
642 break;
643 }
644
639 if (ch < '0' || ch > '9') { 645 if (ch < '0' || ch > '9') {
640 return NGX_HTTP_PARSE_INVALID_REQUEST; 646 return NGX_HTTP_PARSE_INVALID_REQUEST;
641 } 647 }
642 648
643 r->http_minor = r->http_minor * 10 + ch - '0'; 649 r->http_minor = r->http_minor * 10 + ch - '0';
650 break;
651
652 case sw_spaces_after_digit:
653 switch (ch) {
654 case ' ':
655 break;
656 case CR:
657 state = sw_almost_done;
658 break;
659 case LF:
660 goto done;
661 default:
662 return NGX_HTTP_PARSE_INVALID_REQUEST;
663 }
644 break; 664 break;
645 665
646 /* end of request line */ 666 /* end of request line */
647 case sw_almost_done: 667 case sw_almost_done:
648 r->request_end = p - 1; 668 r->request_end = p - 1;