comparison src/core/ngx_file.c @ 430:dac47e9ef0d5 NGINX_0_7_27

nginx 0.7.27 *) Feature: the "try_files" directive. *) Feature: variables support in the "fastcgi_pass" directive. *) Feature: now the $geo variable may get an address from a variable. Thanks to Andrei Nigmatulin. *) Feature: now a location's modifier may be used without space before name. *) Feature: the $upstream_response_length variable. *) Bugfix: now a "add_header" directive does not add an empty value. *) Bugfix: if zero length static file was requested, then nginx just closed connection; the bug had appeared in 0.7.25. *) Bugfix: a MOVE method could not move file in non-existent directory. *) Bugfix: a segmentation fault occurred in worker process, if no one named location was defined in server, but some one was used in an error_page directive. Thanks to Sergey Bochenkov.
author Igor Sysoev <http://sysoev.ru>
date Mon, 15 Dec 2008 00:00:00 +0300
parents 984bb0b1399b
children a8424ffa495c
comparison
equal deleted inserted replaced
429:3b8e9d1bc9bb 430:dac47e9ef0d5
485 { 485 {
486 ngx_err_t err; 486 ngx_err_t err;
487 487
488 #if !(NGX_WIN32) 488 #if !(NGX_WIN32)
489 489
490 if (ngx_change_file_access(src->data, ext->access) == NGX_FILE_ERROR) { 490 if (ext->access) {
491 ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno, 491 if (ngx_change_file_access(src->data, ext->access) == NGX_FILE_ERROR) {
492 ngx_change_file_access_n " \"%s\" failed", src->data); 492 ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno,
493 err = 0; 493 ngx_change_file_access_n " \"%s\" failed", src->data);
494 goto failed; 494 err = 0;
495 goto failed;
496 }
495 } 497 }
496 498
497 #endif 499 #endif
498 500
499 if (ext->time != -1) { 501 if (ext->time != -1) {
515 517
516 if (!ext->create_path) { 518 if (!ext->create_path) {
517 goto failed; 519 goto failed;
518 } 520 }
519 521
520 err = ngx_create_full_path(to->data, ngx_dir_access(ext->access)); 522 err = ngx_create_full_path(to->data, ngx_dir_access(ext->path_access));
521 523
522 if (err) { 524 if (err) {
523 ngx_log_error(NGX_LOG_CRIT, ext->log, err, 525 ngx_log_error(NGX_LOG_CRIT, ext->log, err,
524 ngx_create_dir_n " \"%s\" failed", to->data); 526 ngx_create_dir_n " \"%s\" failed", to->data);
525 err = 0; 527 err = 0;
559 ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno, 561 ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno,
560 ngx_delete_file_n " \"%s\" failed", src->data); 562 ngx_delete_file_n " \"%s\" failed", src->data);
561 } 563 }
562 } 564 }
563 565
564 if (err) { 566 if (err && ext->log_rename_error) {
565 ngx_log_error(NGX_LOG_CRIT, ext->log, err, 567 ngx_log_error(NGX_LOG_CRIT, ext->log, err,
566 ngx_rename_file_n " \"%s\" to \"%s\" failed", 568 ngx_rename_file_n " \"%s\" to \"%s\" failed",
567 src->data, to->data); 569 src->data, to->data);
568 } 570 }
571
572 ext->rename_error = err;
569 573
570 return NGX_ERROR; 574 return NGX_ERROR;
571 } 575 }
572 576
573 577