comparison src/core/ngx_open_file_cache.c @ 374:67fa3851697b NGINX_0_6_31

nginx 0.6.31 *) Bugfix: nginx did not process FastCGI response if header was at the end of FastCGI record; bug appeared in 0.6.2. Thanks to Sergey Serov. *) Bugfix: a segmentation fault might occur in worker process if a file was deleted and the "open_file_cache_errors" directive was off.
author Igor Sysoev <http://sysoev.ru>
date Mon, 12 May 2008 00:00:00 +0400
parents 9a242235a80a
children edf1cb6c328e
comparison
equal deleted inserted replaced
373:56370b6cb317 374:67fa3851697b
404 404
405 return NGX_ERROR; 405 return NGX_ERROR;
406 406
407 failed: 407 failed:
408 408
409 if (file && file->count == 0) { 409 if (file) {
410 ngx_rbtree_delete(&cache->rbtree, &file->node); 410 ngx_rbtree_delete(&cache->rbtree, &file->node);
411 411
412 cache->current--; 412 cache->current--;
413 413
414 if (file->fd != NGX_INVALID_FILE) { 414 if (file->count == 0) {
415 if (ngx_close_file(file->fd) == NGX_FILE_ERROR) { 415
416 ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno, 416 if (file->fd != NGX_INVALID_FILE) {
417 ngx_close_file_n " \"%s\" failed", file->name); 417 if (ngx_close_file(file->fd) == NGX_FILE_ERROR) {
418 } 418 ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,
419 } 419 ngx_close_file_n " \"%s\" failed",
420 420 file->name);
421 ngx_free(file->name); 421 }
422 ngx_free(file); 422 }
423
424 ngx_free(file->name);
425 ngx_free(file);
426
427 } else {
428 file->close = 1;
429 }
423 } 430 }
424 431
425 if (of->fd != NGX_INVALID_FILE) { 432 if (of->fd != NGX_INVALID_FILE) {
426 if (ngx_close_file(of->fd) == NGX_FILE_ERROR) { 433 if (ngx_close_file(of->fd) == NGX_FILE_ERROR) {
427 ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno, 434 ngx_log_error(NGX_LOG_ALERT, pool->log, ngx_errno,