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.
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index c3105e2..323d03d 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -2628,10 +2628,8 @@
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,
@@ -3794,9 +3792,7 @@
ngx_str_t *value;
ngx_http_script_compile_t sc;
- if (plcf->upstream.store != NGX_CONF_UNSET
- || plcf->upstream.store_lengths)
- {
+ if (plcf->upstream.store != NGX_CONF_UNSET) {
return "is duplicate";
}
@@ -3817,8 +3813,9 @@
#endif
+ plcf->upstream.store = 1;
+
if (ngx_strcmp(value[1].data, "on") == 0) {
- plcf->upstream.store = 1;
return NGX_CONF_OK;
}
@@ -3863,7 +3860,7 @@
return NGX_CONF_OK;
}
- if (plcf->upstream.store > 0 || plcf->upstream.store_lengths) {
+ if (plcf->upstream.store > 0) {
return "is incompatible with \"proxy_store\"";
}