aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_fastcgi_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_fastcgi_module.c')
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index aa2dcd7e5..39e9cd0aa 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -2352,6 +2352,7 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
* conf->upstream.bufs.num = 0;
* conf->upstream.ignore_headers = 0;
* conf->upstream.next_upstream = 0;
+ * conf->upstream.cache_zone = NULL;
* conf->upstream.cache_use_stale = 0;
* conf->upstream.cache_methods = 0;
* conf->upstream.temp_path = NULL;
@@ -2390,7 +2391,7 @@ ngx_http_fastcgi_create_loc_conf(ngx_conf_t *cf)
conf->upstream.pass_request_body = NGX_CONF_UNSET;
#if (NGX_HTTP_CACHE)
- conf->upstream.cache = NGX_CONF_UNSET_PTR;
+ conf->upstream.cache = NGX_CONF_UNSET;
conf->upstream.cache_min_uses = NGX_CONF_UNSET_UINT;
conf->upstream.cache_bypass = NGX_CONF_UNSET_PTR;
conf->upstream.no_cache = NGX_CONF_UNSET_PTR;
@@ -2435,12 +2436,10 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
#if (NGX_HTTP_CACHE)
if (conf->upstream.store > 0) {
- conf->upstream.cache = NULL;
+ conf->upstream.cache = 0;
}
- if (conf->upstream.cache != NGX_CONF_UNSET_PTR
- && conf->upstream.cache != NULL)
- {
+ if (conf->upstream.cache > 0) {
conf->upstream.store = 0;
}
@@ -2613,13 +2612,17 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
#if (NGX_HTTP_CACHE)
- ngx_conf_merge_ptr_value(conf->upstream.cache,
- prev->upstream.cache, NULL);
+ if (conf->upstream.cache == NGX_CONF_UNSET) {
+ ngx_conf_merge_value(conf->upstream.cache,
+ prev->upstream.cache, 0);
+
+ conf->upstream.cache_zone = prev->upstream.cache_zone;
+ }
- if (conf->upstream.cache && conf->upstream.cache->data == NULL) {
+ if (conf->upstream.cache_zone && conf->upstream.cache_zone->data == NULL) {
ngx_shm_zone_t *shm_zone;
- shm_zone = conf->upstream.cache;
+ shm_zone = conf->upstream.cache_zone;
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"fastcgi_cache\" zone \"%V\" is unknown",
@@ -3230,13 +3233,9 @@ ngx_http_fastcgi_store(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
#if (NGX_HTTP_CACHE)
-
- if (flcf->upstream.cache != NGX_CONF_UNSET_PTR
- && flcf->upstream.cache != NULL)
- {
+ if (flcf->upstream.cache > 0) {
return "is incompatible with \"fastcgi_cache\"";
}
-
#endif
flcf->upstream.store = 1;
@@ -3277,12 +3276,12 @@ ngx_http_fastcgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
value = cf->args->elts;
- if (flcf->upstream.cache != NGX_CONF_UNSET_PTR) {
+ if (flcf->upstream.cache != NGX_CONF_UNSET) {
return "is duplicate";
}
if (ngx_strcmp(value[1].data, "off") == 0) {
- flcf->upstream.cache = NULL;
+ flcf->upstream.cache = 0;
return NGX_CONF_OK;
}
@@ -3290,9 +3289,11 @@ ngx_http_fastcgi_cache(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return "is incompatible with \"fastcgi_store\"";
}
- flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0,
- &ngx_http_fastcgi_module);
- if (flcf->upstream.cache == NULL) {
+ flcf->upstream.cache = 1;
+
+ flcf->upstream.cache_zone = ngx_shared_memory_add(cf, &value[1], 0,
+ &ngx_http_fastcgi_module);
+ if (flcf->upstream.cache_zone == NULL) {
return NGX_CONF_ERROR;
}