diff src/http/modules/ngx_http_fastcgi_module.c @ 5907:195561ef367f

Upstream: moved header initializations to separate functions. No functional changes.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 19 Nov 2014 17:33:21 +0300
parents 2f7e557eab5b
children f8e80f8c7fc7
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -150,8 +150,8 @@ static ngx_int_t ngx_http_fastcgi_add_va
 static void *ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf);
 static char *ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf,
     void *parent, void *child);
-static ngx_int_t ngx_http_fastcgi_merge_params(ngx_conf_t *cf,
-    ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev);
+static ngx_int_t ngx_http_fastcgi_init_params(ngx_conf_t *cf,
+    ngx_http_fastcgi_loc_conf_t *conf);
 
 static ngx_int_t ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
     ngx_http_variable_value_t *v, uintptr_t data);
@@ -2703,7 +2703,22 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf
     }
 #endif
 
-    if (ngx_http_fastcgi_merge_params(cf, conf, prev) != NGX_OK) {
+    if (conf->params_source == NULL) {
+        conf->params_source = prev->params_source;
+
+#if (NGX_HTTP_CACHE)
+        if ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
+#endif
+        {
+            conf->flushes = prev->flushes;
+            conf->params_len = prev->params_len;
+            conf->params = prev->params;
+            conf->headers_hash = prev->headers_hash;
+            conf->header_params = prev->header_params;
+        }
+    }
+
+    if (ngx_http_fastcgi_init_params(cf, conf) != NGX_OK) {
         return NGX_CONF_ERROR;
     }
 
@@ -2712,8 +2727,7 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf
 
 
 static ngx_int_t
-ngx_http_fastcgi_merge_params(ngx_conf_t *cf,
-    ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev)
+ngx_http_fastcgi_init_params(ngx_conf_t *cf, ngx_http_fastcgi_loc_conf_t *conf)
 {
     u_char                       *p;
     size_t                        size;
@@ -2729,24 +2743,8 @@ ngx_http_fastcgi_merge_params(ngx_conf_t
     ngx_http_script_compile_t     sc;
     ngx_http_script_copy_code_t  *copy;
 
-    if (conf->params_source == NULL) {
-        conf->params_source = prev->params_source;
-
-        if (prev->headers_hash.buckets
-#if (NGX_HTTP_CACHE)
-            && ((conf->upstream.cache == NULL)
-                == (prev->upstream.cache == NULL))
-#endif
-           )
-        {
-            conf->flushes = prev->flushes;
-            conf->params_len = prev->params_len;
-            conf->params = prev->params;
-            conf->headers_hash = prev->headers_hash;
-            conf->header_params = prev->header_params;
-
-            return NGX_OK;
-        }
+    if (conf->headers_hash.buckets) {
+        return NGX_OK;
     }
 
     if (conf->params_source == NULL