# HG changeset patch # User Igor Sysoev # Date 1162032431 0 # Node ID a908ba404078694123197d342b0cab2970793312 # Parent 8634fcbfe075fd44bfc96ddf18ab439b0316bb90 handle the most frequent case first diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c --- a/src/http/ngx_http_parse.c +++ b/src/http/ngx_http_parse.c @@ -120,6 +120,12 @@ ngx_http_parse_request_line(ngx_http_req /* space* before URI */ case sw_spaces_before_uri: + if (ch == '/' ){ + r->uri_start = p; + state = sw_after_slash_in_uri; + break; + } + c = (u_char) (ch | 0x20); if (c >= 'a' && c <= 'z') { r->schema_start = p; @@ -128,10 +134,6 @@ ngx_http_parse_request_line(ngx_http_req } switch (ch) { - case '/': - r->uri_start = p; - state = sw_after_slash_in_uri; - break; case ' ': break; default: