diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 18:39:15 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-04-29 18:39:15 +0400 |
commit | 4de5124191641709499f0b3e8c32ef84b04d2ec8 (patch) | |
tree | 3f7cb5496293a00538dbdb8176d94036ebefac1b /src/core/ngx_open_file_cache.c | |
parent | 1cd3b0c3db35debb0af266ee71d90623f15277e6 (diff) |
fix segfault when file is deleted and open_file_cache_errors is off
Diffstat (limited to 'src/core/ngx_open_file_cache.c')
-rw-r--r-- | src/core/ngx_open_file_cache.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c index a1692f101..c217818f3 100644 --- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -173,8 +173,6 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name, file->uses++; - ngx_queue_remove(&file->queue); - if (file->fd == NGX_INVALID_FILE && file->err == 0 && !file->is_dir) { /* file was not used often enough to keep open */ @@ -185,6 +183,8 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name, goto failed; } + ngx_queue_remove(&file->queue); + goto add_event; } @@ -212,6 +212,8 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name, of->err = file->err; } + ngx_queue_remove(&file->queue); + goto found; } @@ -236,6 +238,8 @@ ngx_open_cached_file(ngx_open_file_cache_t *cache, ngx_str_t *name, goto failed; } + ngx_queue_remove(&file->queue); + if (of->is_dir) { if (file->is_dir || file->err) { |