]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed inheritance of proxy_store and friends.
authorValentin Bartenev <vbart@nginx.com>
Thu, 9 Oct 2014 16:30:11 +0000 (20:30 +0400)
committerValentin Bartenev <vbart@nginx.com>
Thu, 9 Oct 2014 16:30:11 +0000 (20:30 +0400)
The proxy_store, fastcgi_store, scgi_store and uwsgi_store were inherited
incorrectly if a directive with variables was defined, and then redefined
to the "on" value, i.e. in configurations like:

    proxy_store /data/www$upstream_http_x_store;

    location / {
        proxy_store on;
    }

src/http/modules/ngx_http_fastcgi_module.c
src/http/modules/ngx_http_proxy_module.c
src/http/modules/ngx_http_scgi_module.c
src/http/modules/ngx_http_uwsgi_module.c

index 8520c0066e9e143303a6d51bbbefb846dfa3d697..1c63786c8e1eb84798e7f412776284b1781a1206 100644 (file)
@@ -2432,7 +2432,7 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_hash_init_t               hash;
     ngx_http_core_loc_conf_t     *clcf;
 
-    if (conf->upstream.store != 0) {
+    if (conf->upstream.store == NGX_CONF_UNSET) {
         ngx_conf_merge_value(conf->upstream.store,
                               prev->upstream.store, 0);
 
index f04436de4edb42445b8e41b19dd8267cbe27a409..c3105e2999b3f24e7b1307e4f49e8ea5dbb21c2f 100644 (file)
@@ -2624,7 +2624,7 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_http_proxy_rewrite_t   *pr;
     ngx_http_script_compile_t   sc;
 
-    if (conf->upstream.store != 0) {
+    if (conf->upstream.store == NGX_CONF_UNSET) {
         ngx_conf_merge_value(conf->upstream.store,
                               prev->upstream.store, 0);
 
index c6e3b88633c5c4fadc4b2d830e4deeb09c52306a..c8cf9aaa8a4d008b309ed574b62e86688848c95b 100644 (file)
@@ -1186,7 +1186,7 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_hash_init_t               hash;
     ngx_http_core_loc_conf_t     *clcf;
 
-    if (conf->upstream.store != 0) {
+    if (conf->upstream.store == NGX_CONF_UNSET) {
         ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
 
         if (conf->upstream.store_lengths == NULL) {
index ae069eb8369898b18f54dbc67df7cd9b3c2ce649..8e269d7e94c7f1e51f3f554fff70f9e5d226bd02 100644 (file)
@@ -1400,7 +1400,7 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
     ngx_hash_init_t               hash;
     ngx_http_core_loc_conf_t     *clcf;
 
-    if (conf->upstream.store != 0) {
+    if (conf->upstream.store == NGX_CONF_UNSET) {
         ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
 
         if (conf->upstream.store_lengths == NULL) {