]> git.kaiwu.me - nginx.git/commitdiff
handle the most frequent case first
authorIgor Sysoev <igor@sysoev.ru>
Sat, 28 Oct 2006 10:47:11 +0000 (10:47 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 28 Oct 2006 10:47:11 +0000 (10:47 +0000)
src/http/ngx_http_parse.c

index 59787712eba1b43ead11337bd3bfed8fa667a941..6943b5f780803ffd17b037c5159bef7172c36114 100644 (file)
@@ -120,6 +120,12 @@ ngx_http_parse_request_line(ngx_http_request_t *r, ngx_buf_t *b)
         /* 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_request_t *r, ngx_buf_t *b)
             }
 
             switch (ch) {
-            case '/':
-                r->uri_start = p;
-                state = sw_after_slash_in_uri;
-                break;
             case ' ':
                 break;
             default: