aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_fastcgi_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2014-11-19 17:33:21 +0300
committerRoman Arutyunyan <arut@nginx.com>2014-11-19 17:33:21 +0300
commit62dfdf1814f9e73db526f30db26d0e04b79ba97b (patch)
treeed2c548421ec50a93b8f4098df99813c456f803b /src/http/modules/ngx_http_fastcgi_module.c
parent3b33056522dcf79b5450e06ebc8186857e7b2868 (diff)
downloadnginx-62dfdf1814f9e73db526f30db26d0e04b79ba97b.tar.gz
nginx-62dfdf1814f9e73db526f30db26d0e04b79ba97b.zip
Upstream: moved header initializations to separate functions.
No functional changes.
Diffstat (limited to 'src/http/modules/ngx_http_fastcgi_module.c')
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 75fd20d34..aad8ecdf0 100644
--- 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_variables(ngx_conf_t *cf);
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_t *cf, void *parent, void *child)
}
#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_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)
+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 *cf,
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