aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_file_cache.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-07-30 12:41:55 +0000
committerIgor Sysoev <igor@sysoev.ru>2010-07-30 12:41:55 +0000
commit1cd46b88a45989f7275366f9edb67b31f248c13e (patch)
treefc5cbba8e8105ea830ff9fadff2eb28adea2fabb /src/http/ngx_http_file_cache.c
parent09ce1e2d89b9925a101dbe0b11a64a66a74497c4 (diff)
downloadnginx-1cd46b88a45989f7275366f9edb67b31f248c13e.tar.gz
nginx-1cd46b88a45989f7275366f9edb67b31f248c13e.zip
count cache key node usage for cached error statuses
Diffstat (limited to 'src/http/ngx_http_file_cache.c')
-rw-r--r--src/http/ngx_http_file_cache.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/http/ngx_http_file_cache.c b/src/http/ngx_http_file_cache.c
index 4d8473425..6d39269e3 100644
--- a/src/http/ngx_http_file_cache.c
+++ b/src/http/ngx_http_file_cache.c
@@ -519,6 +519,9 @@ ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
if (fcn) {
ngx_queue_remove(&fcn->queue);
+ fcn->uses++;
+ fcn->count++;
+
if (fcn->error) {
if (fcn->valid_sec < ngx_time()) {
@@ -530,9 +533,6 @@ ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
goto done;
}
- fcn->uses++;
- fcn->count++;
-
if (fcn->exists) {
c->exists = fcn->exists;
@@ -581,12 +581,13 @@ ngx_http_file_cache_exists(ngx_http_file_cache_t *cache, ngx_http_cache_t *c)
ngx_rbtree_insert(&cache->sh->rbtree, &fcn->node);
+ fcn->uses = 1;
+ fcn->count = 1;
+
renew:
rc = NGX_DECLINED;
- fcn->uses = 1;
- fcn->count = 1;
fcn->valid_msec = 0;
fcn->error = 0;
fcn->exists = 0;