diff src/http/ngx_http_upstream.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 896db5a09bd2
children 31526449835f
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -577,8 +577,17 @@ ngx_http_upstream_cache(ngx_http_request
 
     rc = ngx_http_file_cache_open(r);
 
-    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
-                   "http upstream cache: %i u:%ui", rc, c->uses);
+    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                   "http upstream cache: %i", rc);
+
+    if (rc == NGX_HTTP_CACHE_UPDATING) {
+        if (u->conf->cache_use_stale & NGX_HTTP_UPSTREAM_FT_UPDATING) {
+            rc = NGX_OK;
+
+        } else {
+            rc = NGX_HTTP_CACHE_STALE;
+        }
+    }
 
     if (rc == NGX_OK) {
 
@@ -4076,7 +4085,9 @@ ngx_http_upstream_hide_headers_hash(ngx_
     {
         conf->hide_headers_hash = prev->hide_headers_hash;
 
-        if (conf->hide_headers_hash.buckets) {
+        if (conf->hide_headers_hash.buckets
+            && ((conf->cache == NULL) == (prev->cache == NULL)))
+        {
             return NGX_OK;
         }