Mercurial > hg > nginx-quic
comparison 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 |
comparison
equal
deleted
inserted
replaced
2943:5da043342fe4 | 2944:f892042956e3 |
---|---|
176 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, | 176 { ngx_string("timeout"), NGX_HTTP_UPSTREAM_FT_TIMEOUT }, |
177 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, | 177 { ngx_string("invalid_header"), NGX_HTTP_UPSTREAM_FT_INVALID_HEADER }, |
178 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, | 178 { ngx_string("http_500"), NGX_HTTP_UPSTREAM_FT_HTTP_500 }, |
179 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, | 179 { ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 }, |
180 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, | 180 { ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 }, |
181 { ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING }, | |
181 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, | 182 { ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF }, |
182 { ngx_null_string, 0 } | 183 { ngx_null_string, 0 } |
183 }; | 184 }; |
184 | 185 |
185 | 186 |
1909 ngx_http_script_compile_t sc; | 1910 ngx_http_script_compile_t sc; |
1910 ngx_http_script_copy_code_t *copy; | 1911 ngx_http_script_copy_code_t *copy; |
1911 | 1912 |
1912 if (conf->upstream.store != 0) { | 1913 if (conf->upstream.store != 0) { |
1913 ngx_conf_merge_value(conf->upstream.store, | 1914 ngx_conf_merge_value(conf->upstream.store, |
1914 prev->upstream.store, 0); | 1915 prev->upstream.store, 0); |
1915 | 1916 |
1916 if (conf->upstream.store_lengths == NULL) { | 1917 if (conf->upstream.store_lengths == NULL) { |
1917 conf->upstream.store_lengths = prev->upstream.store_lengths; | 1918 conf->upstream.store_lengths = prev->upstream.store_lengths; |
1918 conf->upstream.store_values = prev->upstream.store_values; | 1919 conf->upstream.store_values = prev->upstream.store_values; |
1919 } | 1920 } |
2539 ngx_http_fastcgi_loc_conf_t *flcf = conf; | 2540 ngx_http_fastcgi_loc_conf_t *flcf = conf; |
2540 | 2541 |
2541 ngx_str_t *value; | 2542 ngx_str_t *value; |
2542 ngx_http_script_compile_t sc; | 2543 ngx_http_script_compile_t sc; |
2543 | 2544 |
2544 if (flcf->upstream.store != NGX_CONF_UNSET || flcf->upstream.store_lengths) | 2545 if (flcf->upstream.store != NGX_CONF_UNSET |
2546 || flcf->upstream.store_lengths) | |
2545 { | 2547 { |
2546 return "is duplicate"; | 2548 return "is duplicate"; |
2547 } | 2549 } |
2548 | 2550 |
2549 value = cf->args->elts; | 2551 value = cf->args->elts; |
2550 | 2552 |
2553 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2554 flcf->upstream.store = 0; | |
2555 return NGX_CONF_OK; | |
2556 } | |
2557 | |
2558 #if (NGX_HTTP_CACHE) | |
2559 | |
2560 if (flcf->upstream.cache != NGX_CONF_UNSET_PTR | |
2561 && flcf->upstream.cache != NULL) | |
2562 { | |
2563 return "is incompatible with \"fastcgi_cache\""; | |
2564 } | |
2565 | |
2566 #endif | |
2567 | |
2551 if (ngx_strcmp(value[1].data, "on") == 0) { | 2568 if (ngx_strcmp(value[1].data, "on") == 0) { |
2552 flcf->upstream.store = 1; | 2569 flcf->upstream.store = 1; |
2553 return NGX_CONF_OK; | |
2554 } | |
2555 | |
2556 if (ngx_strcmp(value[1].data, "off") == 0) { | |
2557 flcf->upstream.store = 0; | |
2558 return NGX_CONF_OK; | 2570 return NGX_CONF_OK; |
2559 } | 2571 } |
2560 | 2572 |
2561 /* include the terminating '\0' into script */ | 2573 /* include the terminating '\0' into script */ |
2562 value[1].len++; | 2574 value[1].len++; |
2595 } | 2607 } |
2596 | 2608 |
2597 if (ngx_strcmp(value[1].data, "off") == 0) { | 2609 if (ngx_strcmp(value[1].data, "off") == 0) { |
2598 flcf->upstream.cache = NULL; | 2610 flcf->upstream.cache = NULL; |
2599 return NGX_CONF_OK; | 2611 return NGX_CONF_OK; |
2612 } | |
2613 | |
2614 if (flcf->upstream.store > 0 || flcf->upstream.store_lengths) { | |
2615 return "is incompatible with \"fastcgi_store\""; | |
2600 } | 2616 } |
2601 | 2617 |
2602 flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, | 2618 flcf->upstream.cache = ngx_shared_memory_add(cf, &value[1], 0, |
2603 &ngx_http_fastcgi_module); | 2619 &ngx_http_fastcgi_module); |
2604 if (flcf->upstream.cache == NULL) { | 2620 if (flcf->upstream.cache == NULL) { |