comparison src/http/modules/ngx_http_scgi_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
comparison
equal deleted inserted replaced
5946:ee941e49bd88 5947:d9025ea1f5a5
1187 ngx_http_core_loc_conf_t *clcf; 1187 ngx_http_core_loc_conf_t *clcf;
1188 1188
1189 if (conf->upstream.store == NGX_CONF_UNSET) { 1189 if (conf->upstream.store == NGX_CONF_UNSET) {
1190 ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0); 1190 ngx_conf_merge_value(conf->upstream.store, prev->upstream.store, 0);
1191 1191
1192 if (conf->upstream.store_lengths == NULL) { 1192 conf->upstream.store_lengths = prev->upstream.store_lengths;
1193 conf->upstream.store_lengths = prev->upstream.store_lengths; 1193 conf->upstream.store_values = prev->upstream.store_values;
1194 conf->upstream.store_values = prev->upstream.store_values;
1195 }
1196 } 1194 }
1197 1195
1198 ngx_conf_merge_uint_value(conf->upstream.store_access, 1196 ngx_conf_merge_uint_value(conf->upstream.store_access,
1199 prev->upstream.store_access, 0600); 1197 prev->upstream.store_access, 0600);
1200 1198
1758 ngx_http_scgi_loc_conf_t *scf = conf; 1756 ngx_http_scgi_loc_conf_t *scf = conf;
1759 1757
1760 ngx_str_t *value; 1758 ngx_str_t *value;
1761 ngx_http_script_compile_t sc; 1759 ngx_http_script_compile_t sc;
1762 1760
1763 if (scf->upstream.store != NGX_CONF_UNSET || scf->upstream.store_lengths) { 1761 if (scf->upstream.store != NGX_CONF_UNSET) {
1764 return "is duplicate"; 1762 return "is duplicate";
1765 } 1763 }
1766 1764
1767 value = cf->args->elts; 1765 value = cf->args->elts;
1768 1766
1779 return "is incompatible with \"scgi_cache\""; 1777 return "is incompatible with \"scgi_cache\"";
1780 } 1778 }
1781 1779
1782 #endif 1780 #endif
1783 1781
1782 scf->upstream.store = 1;
1783
1784 if (ngx_strcmp(value[1].data, "on") == 0) { 1784 if (ngx_strcmp(value[1].data, "on") == 0) {
1785 scf->upstream.store = 1;
1786 return NGX_CONF_OK; 1785 return NGX_CONF_OK;
1787 } 1786 }
1788 1787
1789 /* include the terminating '\0' into script */ 1788 /* include the terminating '\0' into script */
1790 value[1].len++; 1789 value[1].len++;
1825 if (ngx_strcmp(value[1].data, "off") == 0) { 1824 if (ngx_strcmp(value[1].data, "off") == 0) {
1826 scf->upstream.cache = NULL; 1825 scf->upstream.cache = NULL;
1827 return NGX_CONF_OK; 1826 return NGX_CONF_OK;
1828 } 1827 }
1829 1828
1830 if (scf->upstream.store > 0 || scf->upstream.store_lengths) { 1829 if (scf->upstream.store > 0) {
1831 return "is incompatible with \"scgi_store\""; 1830 return "is incompatible with \"scgi_store\"";
1832 } 1831 }
1833 1832
1834 scf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, 1833 scf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
1835 &ngx_http_scgi_module); 1834 &ngx_http_scgi_module);