diff src/http/ngx_http_upstream.c @ 244:500a3242dff6 NGINX_0_4_7

nginx 0.4.7 *) Feature: the ngx_http_flv_module. *) Feature: the $request_body_file variable. *) Feature: the "charset" and "source_charset" directives support the variables. *) Bugfix: if an "include" SSI command were before another "include" SSI command with an "wait" parameter, then the "wait" parameter might not work. *) Bugfix: if the "proxy_buffering off" directive was used or while working with memcached the connections might not be closed on timeout. *) Bugfix: nginx did not run on 64-bit platforms except amd64, sparc64, and ppc64.
author Igor Sysoev <http://sysoev.ru>
date Tue, 10 Oct 2006 00:00:00 +0400
parents 38e7b94d63ac
children acd2ec3541cb
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1137,6 +1137,7 @@ ngx_http_upstream_process_header(ngx_eve
     umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
 
     if (r->upstream->headers_in.x_accel_redirect) {
+
         ngx_http_upstream_finalize_request(r, u, NGX_DECLINED);
 
         part = &r->upstream->headers_in.headers.part;
@@ -1159,8 +1160,8 @@ ngx_http_upstream_process_header(ngx_eve
 
             if (hh && hh->redirect) {
                 if (hh->copy_handler(r, &h[i], hh->conf) != NGX_OK) {
-                    ngx_http_upstream_finalize_request(r, u,
-                                               NGX_HTTP_INTERNAL_SERVER_ERROR);
+                    ngx_http_finalize_request(r, 
+                                              NGX_HTTP_INTERNAL_SERVER_ERROR);
                     return;
                 }
             }
@@ -1172,7 +1173,7 @@ ngx_http_upstream_process_header(ngx_eve
         flags = 0;
 
         if (ngx_http_parse_unsafe_uri(r, uri, &args, &flags) != NGX_OK) {
-            ngx_http_upstream_finalize_request(r, u, NGX_HTTP_NOT_FOUND);
+            ngx_http_finalize_request(r, NGX_HTTP_NOT_FOUND);
             return;
         }
 
@@ -1500,6 +1501,8 @@ ngx_http_upstream_process_non_buffered_b
     ngx_http_core_loc_conf_t  *clcf;
 
     c = ev->data;
+    r = c->data;
+    u = r->upstream;
 
     if (ev->write) {
         ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
@@ -1520,10 +1523,11 @@ ngx_http_upstream_process_non_buffered_b
         } else {
             ngx_connection_error(c, NGX_ETIMEDOUT, "upstream timed out");
         }
+
+        ngx_http_upstream_finalize_request(r, u, 0);
+        return;
     }
 
-    r = c->data;
-    u = r->upstream;
     client = r->connection;
 
     b = &u->buffer;
@@ -2941,7 +2945,7 @@ ngx_http_upstream_init_main_conf(ngx_con
     hash.hash = &umcf->headers_in_hash;
     hash.key = ngx_hash_key_lc;
     hash.max_size = 512;
-    hash.bucket_size = ngx_cacheline_size;
+    hash.bucket_size = ngx_align(64, ngx_cacheline_size);
     hash.name = "upstream_headers_in_hash";
     hash.pool = cf->pool;
     hash.temp_pool = NULL;