aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2011-06-28 13:26:08 +0000
committerIgor Sysoev <igor@sysoev.ru>2011-06-28 13:26:08 +0000
commit87ee00702262ad021799a98211fc72e2258be07d (patch)
tree56d453d3fb302f9955b4ddf82cf9cc8a2ec93c71 /src
parentf58154db2fcd43f071493aba2cf6358f99c1eb41 (diff)
downloadnginx-87ee00702262ad021799a98211fc72e2258be07d.tar.gz
nginx-87ee00702262ad021799a98211fc72e2258be07d.zip
revert r3935 and fix "stalled cache updating" alert
by freeing cache at upstream finalize phase patch by Maxim Dounin
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_upstream.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 22187a5e6..f9f09cb34 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2031,15 +2031,6 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
c->error = 1;
} else {
-
-#if (NGX_HTTP_CACHE)
-
- if (r->cache) {
- ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
- }
-
-#endif
-
ngx_http_upstream_finalize_request(r, u, rc);
return;
}
@@ -2991,16 +2982,19 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
#if (NGX_HTTP_CACHE)
- if (u->cacheable && r->cache) {
- time_t valid;
+ if (r->cache) {
- if (rc == NGX_HTTP_BAD_GATEWAY || rc == NGX_HTTP_GATEWAY_TIME_OUT) {
+ if (u->cacheable) {
- valid = ngx_http_file_cache_valid(u->conf->cache_valid, rc);
+ if (rc == NGX_HTTP_BAD_GATEWAY || rc == NGX_HTTP_GATEWAY_TIME_OUT) {
+ time_t valid;
- if (valid) {
- r->cache->valid_sec = ngx_time() + valid;
- r->cache->error = rc;
+ valid = ngx_http_file_cache_valid(u->conf->cache_valid, rc);
+
+ if (valid) {
+ r->cache->valid_sec = ngx_time() + valid;
+ r->cache->error = rc;
+ }
}
}