diff src/http/modules/ngx_http_uwsgi_module.c @ 5947:d9025ea1f5a5

Upstream: simplified proxy_store and friends configuration code. This changes internal API related to handling of the "store" flag in ngx_http_upstream_conf_t. Previously, a non-null value of "store_lengths" was enough to enable store functionality with custom path. Now, the "store" flag is also required to be set. No functional changes.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 22 Dec 2014 12:58:56 +0300
parents e3b3b89d74e8
children f2ff0aa89126
line wrap: on
line diff
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1403,10 +1403,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t
     if (conf->upstream.store == NGX_CONF_UNSET) {
         ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
 
-        if (conf->upstream.store_lengths == NULL) {
-            conf->upstream.store_lengths = prev->upstream.store_lengths;
-            conf->upstream.store_values = prev->upstream.store_values;
-        }
+        conf->upstream.store_lengths = prev->upstream.store_lengths;
+        conf->upstream.store_values = prev->upstream.store_values;
     }
 
     ngx_conf_merge_uint_value(conf->upstream.store_access,
@@ -2047,8 +2045,7 @@ ngx_http_uwsgi_store(ngx_conf_t *cf, ngx
     ngx_str_t                  *value;
     ngx_http_script_compile_t   sc;
 
-    if (uwcf->upstream.store != NGX_CONF_UNSET || uwcf->upstream.store_lengths)
-    {
+    if (uwcf->upstream.store != NGX_CONF_UNSET) {
         return "is duplicate";
     }
 
@@ -2069,8 +2066,9 @@ ngx_http_uwsgi_store(ngx_conf_t *cf, ngx
 
 #endif
 
+    uwcf->upstream.store = 1;
+
     if (ngx_strcmp(value[1].data, "on") == 0) {
-        uwcf->upstream.store = 1;
         return NGX_CONF_OK;
     }
 
@@ -2115,7 +2113,7 @@ ngx_http_uwsgi_cache(ngx_conf_t *cf, ngx
         return NGX_CONF_OK;
     }
 
-    if (uwcf->upstream.store > 0 || uwcf->upstream.store_lengths) {
+    if (uwcf->upstream.store > 0) {
         return "is incompatible with \"uwsgi_store\"";
     }