diff src/http/ngx_http_upstream.c @ 230:38e7b94d63ac NGINX_0_4_0

nginx 0.4.0 *) Change in internal API: the HTTP modules initialization was moved from the init module phase to the HTTP postconfiguration phase. *) Change: now the request body is not read beforehand for the ngx_http_perl_module: it's required to start the reading using the $r->has_request_body method. *) Feature: the ngx_http_perl_module supports the DECLINED return code. *) Feature: the ngx_http_dav_module supports the incoming "Date" header line for the PUT method. *) Feature: the "ssi" directive is available inside the "if" block. *) Bugfix: a segmentation fault occurred if there was an "index" directive with variables and the first index name was without variables; bug appeared in 0.1.29.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Aug 2006 00:00:00 +0400
parents 9909a161eb28
children 500a3242dff6
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1134,11 +1134,11 @@ 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);
 
-        umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
         part = &r->upstream->headers_in.headers.part;
         h = part->elts;
 
@@ -1188,29 +1188,6 @@ ngx_http_upstream_process_header(ngx_eve
         return;
     }
 
-    ngx_http_upstream_send_response(r, u);
-}
-
-
-static void
-ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
-{
-    int                             tcp_nodelay;
-    ssize_t                         size;
-    ngx_int_t                       rc;
-    ngx_uint_t                      i;
-    ngx_list_part_t                *part;
-    ngx_table_elt_t                *h;
-    ngx_event_pipe_t               *p;
-    ngx_connection_t               *c;
-    ngx_pool_cleanup_t             *cl;
-    ngx_pool_cleanup_file_t        *clf;
-    ngx_http_core_loc_conf_t       *clcf;
-    ngx_http_upstream_header_t     *hh;
-    ngx_http_upstream_main_conf_t  *umcf;
-
-    umcf = ngx_http_get_module_main_conf(r, ngx_http_upstream_module);
-
     part = &r->upstream->headers_in.headers.part;
     h = part->elts;
 
@@ -1270,6 +1247,22 @@ ngx_http_upstream_send_response(ngx_http
         u->length = NGX_MAX_SIZE_T_VALUE;
     }
 
+    ngx_http_upstream_send_response(r, u);
+}
+
+
+static void
+ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
+{
+    int                        tcp_nodelay;
+    ssize_t                    size;
+    ngx_int_t                  rc;
+    ngx_event_pipe_t          *p;
+    ngx_connection_t          *c;
+    ngx_pool_cleanup_t        *cl;
+    ngx_pool_cleanup_file_t   *clf;
+    ngx_http_core_loc_conf_t  *clcf;
+
     rc = ngx_http_send_header(r);
 
     if (rc == NGX_ERROR || rc > NGX_OK || r->post_action) {