comparison src/http/ngx_http_parse.c @ 822:a908ba404078

handle the most frequent case first
author Igor Sysoev <igor@sysoev.ru>
date Sat, 28 Oct 2006 10:47:11 +0000
parents 8634fcbfe075
children ccf3c59f8040
comparison
equal deleted inserted replaced
821:8634fcbfe075 822:a908ba404078
118 break; 118 break;
119 119
120 /* space* before URI */ 120 /* space* before URI */
121 case sw_spaces_before_uri: 121 case sw_spaces_before_uri:
122 122
123 if (ch == '/' ){
124 r->uri_start = p;
125 state = sw_after_slash_in_uri;
126 break;
127 }
128
123 c = (u_char) (ch | 0x20); 129 c = (u_char) (ch | 0x20);
124 if (c >= 'a' && c <= 'z') { 130 if (c >= 'a' && c <= 'z') {
125 r->schema_start = p; 131 r->schema_start = p;
126 state = sw_schema; 132 state = sw_schema;
127 break; 133 break;
128 } 134 }
129 135
130 switch (ch) { 136 switch (ch) {
131 case '/':
132 r->uri_start = p;
133 state = sw_after_slash_in_uri;
134 break;
135 case ' ': 137 case ' ':
136 break; 138 break;
137 default: 139 default:
138 return NGX_HTTP_PARSE_INVALID_REQUEST; 140 return NGX_HTTP_PARSE_INVALID_REQUEST;
139 } 141 }