comparison 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
comparison
equal deleted inserted replaced
5906:548f704c1907 5907:195561ef367f
148 148
149 static ngx_int_t ngx_http_fastcgi_add_variables(ngx_conf_t *cf); 149 static ngx_int_t ngx_http_fastcgi_add_variables(ngx_conf_t *cf);
150 static void *ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf); 150 static void *ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf);
151 static char *ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, 151 static char *ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf,
152 void *parent, void *child); 152 void *parent, void *child);
153 static ngx_int_t ngx_http_fastcgi_merge_params(ngx_conf_t *cf, 153 static ngx_int_t ngx_http_fastcgi_init_params(ngx_conf_t *cf,
154 ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev); 154 ngx_http_fastcgi_loc_conf_t *conf);
155 155
156 static ngx_int_t ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r, 156 static ngx_int_t ngx_http_fastcgi_script_name_variable(ngx_http_request_t *r,
157 ngx_http_variable_value_t *v, uintptr_t data); 157 ngx_http_variable_value_t *v, uintptr_t data);
158 static ngx_int_t ngx_http_fastcgi_path_info_variable(ngx_http_request_t *r, 158 static ngx_int_t ngx_http_fastcgi_path_info_variable(ngx_http_request_t *r,
159 ngx_http_variable_value_t *v, uintptr_t data); 159 ngx_http_variable_value_t *v, uintptr_t data);
2701 conf->split_regex = prev->split_regex; 2701 conf->split_regex = prev->split_regex;
2702 conf->split_name = prev->split_name; 2702 conf->split_name = prev->split_name;
2703 } 2703 }
2704 #endif 2704 #endif
2705 2705
2706 if (ngx_http_fastcgi_merge_params(cf, conf, prev) != NGX_OK) { 2706 if (conf->params_source == NULL) {
2707 conf->params_source = prev->params_source;
2708
2709 #if (NGX_HTTP_CACHE)
2710 if ((conf->upstream.cache == NULL) == (prev->upstream.cache == NULL))
2711 #endif
2712 {
2713 conf->flushes = prev->flushes;
2714 conf->params_len = prev->params_len;
2715 conf->params = prev->params;
2716 conf->headers_hash = prev->headers_hash;
2717 conf->header_params = prev->header_params;
2718 }
2719 }
2720
2721 if (ngx_http_fastcgi_init_params(cf, conf) != NGX_OK) {
2707 return NGX_CONF_ERROR; 2722 return NGX_CONF_ERROR;
2708 } 2723 }
2709 2724
2710 return NGX_CONF_OK; 2725 return NGX_CONF_OK;
2711 } 2726 }
2712 2727
2713 2728
2714 static ngx_int_t 2729 static ngx_int_t
2715 ngx_http_fastcgi_merge_params(ngx_conf_t *cf, 2730 ngx_http_fastcgi_init_params(ngx_conf_t *cf, ngx_http_fastcgi_loc_conf_t *conf)
2716 ngx_http_fastcgi_loc_conf_t *conf, ngx_http_fastcgi_loc_conf_t *prev)
2717 { 2731 {
2718 u_char *p; 2732 u_char *p;
2719 size_t size; 2733 size_t size;
2720 uintptr_t *code; 2734 uintptr_t *code;
2721 ngx_uint_t i, nsrc; 2735 ngx_uint_t i, nsrc;
2727 ngx_hash_init_t hash; 2741 ngx_hash_init_t hash;
2728 ngx_http_upstream_param_t *src; 2742 ngx_http_upstream_param_t *src;
2729 ngx_http_script_compile_t sc; 2743 ngx_http_script_compile_t sc;
2730 ngx_http_script_copy_code_t *copy; 2744 ngx_http_script_copy_code_t *copy;
2731 2745
2732 if (conf->params_source == NULL) { 2746 if (conf->headers_hash.buckets) {
2733 conf->params_source = prev->params_source; 2747 return NGX_OK;
2734
2735 if (prev->headers_hash.buckets
2736 #if (NGX_HTTP_CACHE)
2737 && ((conf->upstream.cache == NULL)
2738 == (prev->upstream.cache == NULL))
2739 #endif
2740 )
2741 {
2742 conf->flushes = prev->flushes;
2743 conf->params_len = prev->params_len;
2744 conf->params = prev->params;
2745 conf->headers_hash = prev->headers_hash;
2746 conf->header_params = prev->header_params;
2747
2748 return NGX_OK;
2749 }
2750 } 2748 }
2751 2749
2752 if (conf->params_source == NULL 2750 if (conf->params_source == NULL
2753 #if (NGX_HTTP_CACHE) 2751 #if (NGX_HTTP_CACHE)
2754 && (conf->upstream.cache == NULL) 2752 && (conf->upstream.cache == NULL)