changeset 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
files src/http/ngx_http_parse.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_parse.c	Sat Oct 28 10:42:24 2006 +0000
+++ b/src/http/ngx_http_parse.c	Sat Oct 28 10:47:11 2006 +0000
@@ -120,6 +120,12 @@
         /* 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 @@
             }
 
             switch (ch) {
-            case '/':
-                r->uri_start = p;
-                state = sw_after_slash_in_uri;
-                break;
             case ' ':
                 break;
             default: