comparison src/http/ngx_http_parse.c @ 206:3866d57d9cfd NGINX_0_3_50

nginx 0.3.50 *) Change: the "proxy_redirect_errors" and "fastcgi_redirect_errors" directives was renamed to the "proxy_intercept_errors" and "fastcgi_intercept_errors" directives. *) Feature: the ngx_http_charset_module supports the recoding from the single byte encodings to the UTF-8 encoding and back. *) Feature: the "X-Accel-Charset" response header line is supported in proxy and FastCGI mode. *) Bugfix: the "\" escape symbol in the "\"" and "\'" pairs in the SSI command was removed only if the command also has the "$" symbol. *) Bugfix: the "<!--" string might be added on some conditions in the SSI after inclusion. *) Bugfix: if the "Content-Length: 0" header line was in response, then in nonbuffered proxying mode the client connection was not closed.
author Igor Sysoev <http://sysoev.ru>
date Wed, 28 Jun 2006 00:00:00 +0400
parents e6da4931e0e0
children fa32d59d9a15
comparison
equal deleted inserted replaced
205:e53bd15c244a 206:3866d57d9cfd
335 #endif 335 #endif
336 case '%': 336 case '%':
337 r->quoted_uri = 1; 337 r->quoted_uri = 1;
338 state = sw_uri; 338 state = sw_uri;
339 break; 339 break;
340 case '+':
341 r->plus_in_uri = 1;
342 break;
343 case '?': 340 case '?':
344 r->args_start = p + 1; 341 r->args_start = p + 1;
345 state = sw_uri; 342 state = sw_uri;
343 break;
344 case '+':
345 r->plus_in_uri = 1;
346 break; 346 break;
347 case '\0': 347 case '\0':
348 r->zero_in_uri = 1; 348 r->zero_in_uri = 1;
349 break; 349 break;
350 } 350 }
364 break; 364 break;
365 case LF: 365 case LF:
366 r->uri_end = p; 366 r->uri_end = p;
367 r->http_minor = 9; 367 r->http_minor = 9;
368 goto done; 368 goto done;
369 case '+':
370 r->plus_in_uri = 1;
371 break;
372 case '\0': 369 case '\0':
373 r->zero_in_uri = 1; 370 r->zero_in_uri = 1;
374 break; 371 break;
375 } 372 }
376 break; 373 break;
826 goto done; 823 goto done;
827 case '.': 824 case '.':
828 r->uri_ext = u + 1; 825 r->uri_ext = u + 1;
829 *u++ = ch; 826 *u++ = ch;
830 break; 827 break;
828 case '+':
829 r->plus_in_uri = 1;
831 default: 830 default:
832 *u++ = ch; 831 *u++ = ch;
833 break; 832 break;
834 } 833 }
835 ch = *p++; 834 ch = *p++;
851 state = sw_quoted; 850 state = sw_quoted;
852 break; 851 break;
853 case '?': 852 case '?':
854 r->args_start = p; 853 r->args_start = p;
855 goto done; 854 goto done;
855 case '+':
856 r->plus_in_uri = 1;
856 default: 857 default:
857 state = sw_usual; 858 state = sw_usual;
858 *u++ = ch; 859 *u++ = ch;
859 break; 860 break;
860 } 861 }
879 state = sw_quoted; 880 state = sw_quoted;
880 break; 881 break;
881 case '?': 882 case '?':
882 r->args_start = p; 883 r->args_start = p;
883 goto done; 884 goto done;
885 case '+':
886 r->plus_in_uri = 1;
884 default: 887 default:
885 state = sw_usual; 888 state = sw_usual;
886 *u++ = ch; 889 *u++ = ch;
887 break; 890 break;
888 } 891 }
915 case '.': 918 case '.':
916 state = sw_dot_dot_dot; 919 state = sw_dot_dot_dot;
917 *u++ = ch; 920 *u++ = ch;
918 break; 921 break;
919 #endif 922 #endif
923 case '+':
924 r->plus_in_uri = 1;
920 default: 925 default:
921 state = sw_usual; 926 state = sw_usual;
922 *u++ = ch; 927 *u++ = ch;
923 break; 928 break;
924 } 929 }
950 state = sw_quoted; 955 state = sw_quoted;
951 break; 956 break;
952 case '?': 957 case '?':
953 r->args_start = p; 958 r->args_start = p;
954 goto done; 959 goto done;
960 case '+':
961 r->plus_in_uri = 1;
955 default: 962 default:
956 state = sw_usual; 963 state = sw_usual;
957 *u++ = ch; 964 *u++ = ch;
958 break; 965 break;
959 } 966 }
990 break; 997 break;
991 } 998 }
992 999
993 if (ch == '\0') { 1000 if (ch == '\0') {
994 r->zero_in_uri = 1; 1001 r->zero_in_uri = 1;
995 *u++ = ch;
996 ch = *p++;
997 } 1002 }
998 1003
999 state = quoted_state; 1004 state = quoted_state;
1000 break; 1005 break;
1001 } 1006 }
1002 1007
1003 c = (u_char) (ch | 0x20); 1008 c = (u_char) (ch | 0x20);
1004 if (c >= 'a' && c <= 'f') { 1009 if (c >= 'a' && c <= 'f') {
1005 ch = (u_char) ((decoded << 4) + c - 'a' + 10); 1010 ch = (u_char) ((decoded << 4) + c - 'a' + 10);
1011
1006 if (ch == '?') { 1012 if (ch == '?') {
1007 *u++ = ch; 1013 *u++ = ch;
1008 ch = *p++; 1014 ch = *p++;
1009 } 1015
1016 } else if (ch == '+') {
1017 r->plus_in_uri = 1;
1018 }
1019
1010 state = quoted_state; 1020 state = quoted_state;
1011 break; 1021 break;
1012 } 1022 }
1013 1023
1014 return NGX_HTTP_PARSE_INVALID_REQUEST; 1024 return NGX_HTTP_PARSE_INVALID_REQUEST;