diff src/http/ngx_http_core_module.c @ 38:2879cd3a40cb NGINX_0_1_19

nginx 0.1.19 *) Bugfix: now, if request contains the zero, then the 404 error is returned for the local requests. *) Bugfix: nginx could not be built on NetBSD 2.0. *) Bugfix: the timeout may occur while reading of the the client request body via SSL connections.
author Igor Sysoev <http://sysoev.ru>
date Wed, 16 Feb 2005 00:00:00 +0300
parents a39d1b793287
children 6cfc63e68377
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -415,6 +415,8 @@ ngx_http_handler(ngx_http_request_t *r)
 
     r->uri_changed = 1;
     r->uri_changes = 11;
+    r->phase = NGX_HTTP_REWRITE_PHASE;
+    r->phase_handler = 0;
 
     ngx_http_core_run_phases(r);
 }
@@ -447,11 +449,7 @@ ngx_http_core_run_phases(ngx_http_reques
 
     for (/* void */; r->phase < NGX_HTTP_LAST_PHASE; r->phase++) {
 
-        if (r->phase == NGX_HTTP_FIND_CONFIG_PHASE && !r->uri_changed) {
-            continue;
-        }
-
-        if (r->phase == NGX_HTTP_FIND_CONFIG_PHASE + 1 && r->uri_changed) {
+        if (r->phase == NGX_HTTP_REWRITE_PHASE + 1 && r->uri_changed) {
 
             ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                            "uri changes: %d", r->uri_changes);
@@ -472,8 +470,7 @@ ngx_http_core_run_phases(ngx_http_reques
                 return;
             }
 
-            r->uri_changed = 0;
-            r->phase = NGX_HTTP_REWRITE_PHASE;
+            r->phase = NGX_HTTP_FIND_CONFIG_PHASE;
         }
 
         if (r->phase == NGX_HTTP_CONTENT_PHASE && r->content_handler) {
@@ -525,7 +522,7 @@ ngx_http_core_run_phases(ngx_http_reques
 
     /* no content handler was found */
 
-    if (r->uri.data[r->uri.len - 1] == '/') {
+    if (r->uri.data[r->uri.len - 1] == '/' && !r->zero_in_uri) {
 
         clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
 
@@ -550,6 +547,9 @@ ngx_http_find_location_config(ngx_http_r
     ngx_http_core_loc_conf_t  *clcf;
     ngx_http_core_srv_conf_t  *cscf;
 
+    r->content_handler = NULL;
+    r->uri_changed = 0;
+
     cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
 
     rc = ngx_http_core_find_location(r, &cscf->locations, 0);
@@ -955,10 +955,6 @@ ngx_http_internal_redirect(ngx_http_requ
     cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
     r->loc_conf = cscf->ctx->loc_conf;
 
-    r->phase = 0;
-    r->phase_handler = 0;
-    r->content_handler = NULL;
-
     ngx_http_handler(r);
 
     return NGX_DONE;