]> git.kaiwu.me - nginx.git/commitdiff
do not free unused cache node if cache min_uses > 1,
authorIgor Sysoev <igor@sysoev.ru>
Fri, 30 Jul 2010 10:20:08 +0000 (10:20 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Fri, 30 Jul 2010 10:20:08 +0000 (10:20 +0000)
the bug has been introduced in r3695, r3708, r3711

src/http/ngx_http_file_cache.c

index 133a52e680207986eae18b5bbd9cf257dae200b1..4d847342531fd8c49207b2237ea3eddd26c93c0f 100644 (file)
@@ -932,7 +932,7 @@ ngx_http_file_cache_free(ngx_http_cache_t *c, ngx_temp_file_t *tf)
         fcn->valid_msec = c->valid_msec;
         fcn->error = c->error;
 
-    } else if (!fcn->exists && fcn->count == 0) {
+    } else if (!fcn->exists && fcn->count == 0 && c->min_uses == 1) {
         ngx_queue_remove(&fcn->queue);
         ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
         ngx_slab_free_locked(cache->shpool, fcn);