mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 06:46:16 +08:00
fix segfault when file is deleted and open_file_cache_errors is off
This commit is contained in:
parent
1cd3b0c3db
commit
4de5124191
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user