Mercurial > hg > nginx
diff src/http/modules/ngx_http_fastcgi_module.c @ 2944:f892042956e3 stable-0.7
merge r2895, r2896, r2926, r2927, r2928, r2930, and r2936:
various proxy/fastcgi cache features and fixes:
*) report about proxy/fastcgi_store and proxy/fastcgi_cache incompatibility
*) delete useless r->cache->uses
*) proxy_cache_use_stale/fastcgi_cache_use_stale updating
*) inherit proxy_set_header, proxy_hide_header, and fastcgi_hide_header
only if cache settings are similar
*) add response file uniq while loading cold cache on demand
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 15 Jun 2009 09:30:59 +0000 |
parents | 6e1941b321b7 |
children | 8393cadef25d |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -178,6 +178,7 @@ static ngx_conf_bitmask_t ngx_http_fast { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, + { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING }, { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, { ngx_null_string, 0 } }; @@ -1911,7 +1912,7 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf if (conf->upstream.store != 0) { ngx_conf_merge_value(conf->upstream.store, - prev->upstream.store, 0); + prev->upstream.store, 0); if (conf->upstream.store_lengths == NULL) { conf->upstream.store_lengths = prev->upstream.store_lengths; @@ -2541,20 +2542,31 @@ ngx_http_fastcgi_store(ngx_conf_t *cf, n ngx_str_t *value; ngx_http_script_compile_t sc; - if (flcf->upstream.store != NGX_CONF_UNSET || flcf->upstream.store_lengths) + if (flcf->upstream.store != NGX_CONF_UNSET + || flcf->upstream.store_lengths) { return "is duplicate"; } value = cf->args->elts; - if (ngx_strcmp(value[1].data, "on") == 0) { - flcf->upstream.store = 1; + if (ngx_strcmp(value[1].data, "off") == 0) { + flcf->upstream.store = 0; return NGX_CONF_OK; } - if (ngx_strcmp(value[1].data, "off") == 0) { - flcf->upstream.store = 0; +#if (NGX_HTTP_CACHE) + + if (flcf->upstream.cache != NGX_CONF_UNSET_PTR + && flcf->upstream.cache != NULL) + { + return "is incompatible with \"fastcgi_cache\""; + } + +#endif + + if (ngx_strcmp(value[1].data, "on") == 0) { + flcf->upstream.store = 1; return NGX_CONF_OK; } @@ -2599,6 +2611,10 @@ ngx_http_fastcgi_cache(ngx_conf_t *cf, n return NGX_CONF_OK; } + if (flcf->upstream.store > 0 || flcf->upstream.store_lengths) { + 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) {