do not free unused cache node if cache min_uses > 1,

the bug has been introduced in r3695, r3708, r3711
This commit is contained in:
Igor Sysoev 2010-07-30 10:20:08 +00:00
parent 10f8d5d74e
commit 09ce1e2d89

View 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);