comparison src/http/modules/ngx_http_fastcgi_module.c @ 3439:3354dfba9da4 stable-0.7

merge r3137, r3198, r3199, r3353, r3370, r3371, r3398, r3399: cache related fixes: *) do not pass buf with empty cached response, this fixes "zero size buf in output" alert *) hide cacheable Set-Cookie and P3P FastCGI response headers *) test comma separator in "Cache-Control" *) a cache manager thread handle was overwritten by a cache loader thread handle, this caused an exit delay, the bug had been introduced in r3248 *) fix handling cached HTTP/0.9 response *) log proxied HTTP/0.9 responses status as "009" *) fix the "If-None-Match" header name *) fix a cached zero-length body case
author Igor Sysoev <igor@sysoev.ru>
date Mon, 01 Feb 2010 15:46:14 +0000
parents 0189a8f4c7c3
children 0d8b8c84bab7
comparison
equal deleted inserted replaced
3438:a0a131127626 3439:3354dfba9da4
519 ngx_string("X-Accel-Limit-Rate"), 519 ngx_string("X-Accel-Limit-Rate"),
520 ngx_string("X-Accel-Buffering"), 520 ngx_string("X-Accel-Buffering"),
521 ngx_string("X-Accel-Charset"), 521 ngx_string("X-Accel-Charset"),
522 ngx_null_string 522 ngx_null_string
523 }; 523 };
524
525
526 #if (NGX_HTTP_CACHE)
527
528 static ngx_str_t ngx_http_fastcgi_hide_cache_headers[] = {
529 ngx_string("Status"),
530 ngx_string("X-Accel-Expires"),
531 ngx_string("X-Accel-Redirect"),
532 ngx_string("X-Accel-Limit-Rate"),
533 ngx_string("X-Accel-Buffering"),
534 ngx_string("X-Accel-Charset"),
535 ngx_string("Set-Cookie"),
536 ngx_string("P3P"),
537 ngx_null_string
538 };
539
540 #endif
524 541
525 542
526 static ngx_path_init_t ngx_http_fastcgi_temp_path = { 543 static ngx_path_init_t ngx_http_fastcgi_temp_path = {
527 ngx_string(NGX_HTTP_FASTCGI_TEMP_PATH), { 1, 2, 0 } 544 ngx_string(NGX_HTTP_FASTCGI_TEMP_PATH), { 1, 2, 0 }
528 }; 545 };
1897 ngx_http_fastcgi_loc_conf_t *conf = child; 1914 ngx_http_fastcgi_loc_conf_t *conf = child;
1898 1915
1899 u_char *p; 1916 u_char *p;
1900 size_t size; 1917 size_t size;
1901 uintptr_t *code; 1918 uintptr_t *code;
1919 ngx_str_t *h;
1902 ngx_uint_t i; 1920 ngx_uint_t i;
1903 ngx_keyval_t *src; 1921 ngx_keyval_t *src;
1904 ngx_hash_init_t hash; 1922 ngx_hash_init_t hash;
1905 ngx_http_script_compile_t sc; 1923 ngx_http_script_compile_t sc;
1906 ngx_http_script_copy_code_t *copy; 1924 ngx_http_script_copy_code_t *copy;
2117 2135
2118 hash.max_size = 512; 2136 hash.max_size = 512;
2119 hash.bucket_size = ngx_align(64, ngx_cacheline_size); 2137 hash.bucket_size = ngx_align(64, ngx_cacheline_size);
2120 hash.name = "fastcgi_hide_headers_hash"; 2138 hash.name = "fastcgi_hide_headers_hash";
2121 2139
2140 #if (NGX_HTTP_CACHE)
2141
2142 h = conf->upstream.cache ? ngx_http_fastcgi_hide_cache_headers:
2143 ngx_http_fastcgi_hide_headers;
2144 #else
2145
2146 h = ngx_http_fastcgi_hide_headers;
2147
2148 #endif
2149
2122 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream, 2150 if (ngx_http_upstream_hide_headers_hash(cf, &conf->upstream,
2123 &prev->upstream, 2151 &prev->upstream, h, &hash)
2124 ngx_http_fastcgi_hide_headers,
2125 &hash)
2126 != NGX_OK) 2152 != NGX_OK)
2127 { 2153 {
2128 return NGX_CONF_ERROR; 2154 return NGX_CONF_ERROR;
2129 } 2155 }
2130 2156