nginx-0.1.19-RELEASE import
*) 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.
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 8b66a79..b3c1a14 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -415,6 +415,8 @@
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 @@
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 @@
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 @@
/* 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_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 @@
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;