# HG changeset patch # User Igor Sysoev # Date 1250775446 0 # Node ID 524ba56ba9f7c51c0b251a5ebd9df8c6504c82eb # Parent 98a8336c5b7c2a643405609115ccb5bc46323de2 fix copy destination name length, introduced in r3025 diff -r 98a8336c5b7c -r 524ba56ba9f7 src/core/ngx_file.c --- a/src/core/ngx_file.c Wed Aug 19 17:44:33 2009 +0000 +++ b/src/core/ngx_file.c Thu Aug 20 13:37:26 2009 +0000 @@ -605,12 +605,12 @@ cf.time = ext->time; cf.log = ext->log; - name = ngx_alloc(to->len + 1 + 10, ext->log); + name = ngx_alloc(to->len + 1 + 10 + 1, ext->log); if (name == NULL) { return NGX_ERROR; } - (void) ngx_sprintf(name, "%*s.%010uD%Z", to->len - 1, to->data, + (void) ngx_sprintf(name, "%*s.%010uD%Z", to->len, to->data, (uint32_t) ngx_next_temp_number(0)); if (ngx_copy_file(src->data, name, &cf) == NGX_OK) { diff -r 98a8336c5b7c -r 524ba56ba9f7 src/http/modules/ngx_http_dav_module.c --- a/src/http/modules/ngx_http_dav_module.c Wed Aug 19 17:44:33 2009 +0000 +++ b/src/http/modules/ngx_http_dav_module.c Thu Aug 20 13:37:26 2009 +0000 @@ -214,6 +214,8 @@ ngx_http_map_uri_to_path(r, &path, &root, 0); + path.len--; + ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "http put filename: \"%s\"", path.data); diff -r 98a8336c5b7c -r 524ba56ba9f7 src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c Wed Aug 19 17:44:33 2009 +0000 +++ b/src/http/ngx_http_upstream.c Thu Aug 20 13:37:26 2009 +0000 @@ -2661,6 +2661,8 @@ } } + path.len--; + ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "upstream stores \"%s\" to \"%s\"", tf->file.name.data, path.data);