From e597feff7ded172cfeeefce5aca05fafd711090b Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 4 Aug 2010 12:55:27 +0000 Subject: [PATCH] error status codes could be cached for next request only, the bug has been introduced in r3712 --- src/http/ngx_http_file_cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c index 94ddbf697..c9ecdedb5 100644 --- a/src/http/ngx_http_file_cache.c +++ b/src/http/ngx_http_file_cache.c @@ -927,10 +927,13 @@ ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf) } if (c->error) { - fcn->valid_sec = c->valid_sec; - fcn->valid_msec = c->valid_msec; fcn->error = c->error; + if (c->valid_sec) { + fcn->valid_sec = c->valid_sec; + fcn->valid_msec = c->valid_msec; + } + } else if (!fcn->exists && fcn->count == 0 && c->min_uses == 1) { ngx_queue_remove(&fcn->queue); ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);