Mercurial > hg > nginx-vendor-0-6
diff src/core/ngx_file.c @ 362:54fad6c4b555 NGINX_0_6_25
nginx 0.6.25
*) Change: now the "server_name_in_redirect" directive is used instead
of the "server_name" directive's special "*" parameter.
*) Change: now wildcard and regex names can be used as main name in a
"server_name" directive.
*) Change: the "satisfy_any" directive was replaced by the "satisfy"
directive.
*) Workaround: old worker processes might hog CPU after reconfiguration
if they was run under Linux OpenVZ.
*) Feature: the "min_delete_depth" directive.
*) Bugfix: the COPY and MOVE methods did not work with single files.
*) Bugfix: the ngx_http_gzip_static_module did not allow the
ngx_http_dav_module to work; bug appeared in 0.6.23.
*) Bugfix: socket leak in HTTPS mode if deferred accept was used.
Thanks to Ben Maurer.
*) Bugfix: nginx could not be built without PCRE library; bug appeared
in 0.6.23.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 08 Jan 2008 00:00:00 +0300 |
parents | b743d290eb3b |
children | babd3d9efb62 |
line wrap: on
line diff
--- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -481,15 +481,14 @@ ngx_create_pathes(ngx_cycle_t *cycle, ng ngx_int_t -ngx_create_path_and_rename_file(ngx_str_t *src, ngx_str_t *to, - ngx_uint_t access, ngx_uint_t full_path, ngx_uint_t delete, ngx_log_t *log) +ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, ngx_ext_rename_file_t *ext) { ngx_err_t err; #if !(NGX_WIN32) - if (ngx_change_file_access(src->data, access) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, + if (ngx_change_file_access(src->data, ext->access) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno, ngx_change_file_access_n " \"%s\" failed", src->data); err = 0; goto failed; @@ -497,6 +496,15 @@ ngx_create_path_and_rename_file(ngx_str_ #endif + if (ext->time != -1) { + if (ngx_set_file_time(src->data, ext->fd, ext->time) != NGX_OK) { + ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno, + ngx_set_file_time_n " \"%s\" failed", src->data); + err = 0; + goto failed; + } + } + if (ngx_rename_file(src->data, to->data) != NGX_FILE_ERROR) { return NGX_OK; } @@ -505,14 +513,14 @@ ngx_create_path_and_rename_file(ngx_str_ if (err == NGX_ENOENT) { - if (!full_path) { + if (!ext->create_path) { goto failed; } - err = ngx_create_full_path(to->data, ngx_dir_access(access)); + err = ngx_create_full_path(to->data, ngx_dir_access(ext->access)); if (err) { - ngx_log_error(NGX_LOG_CRIT, log, err, + ngx_log_error(NGX_LOG_CRIT, ext->log, err, ngx_create_dir_n " \"%s\" failed", to->data); err = 0; goto failed; @@ -529,7 +537,7 @@ ngx_create_path_and_rename_file(ngx_str_ #if (NGX_WIN32) if (err == NGX_EEXIST) { - if (ngx_win32_rename_file(src, to, log) == NGX_OK) { + if (ngx_win32_rename_file(src, to, ext->log) == NGX_OK) { if (ngx_rename_file(src->data, to->data) != NGX_FILE_ERROR) { return NGX_OK; @@ -546,15 +554,15 @@ ngx_create_path_and_rename_file(ngx_str_ failed: - if (delete) { + if (ext->delete) { if (ngx_delete_file(src->data) == NGX_FILE_ERROR) { - ngx_log_error(NGX_LOG_CRIT, log, ngx_errno, + ngx_log_error(NGX_LOG_CRIT, ext->log, ngx_errno, ngx_delete_file_n " \"%s\" failed", src->data); } } if (err) { - ngx_log_error(NGX_LOG_CRIT, log, err, + ngx_log_error(NGX_LOG_CRIT, ext->log, err, ngx_rename_file_n " \"%s\" to \"%s\" failed", src->data, to->data); }