Welcome! Log In Create A New Profile

Advanced

Re: Webdav upload and wrong modify time stamp (0.7.65, 0.8.34)

Maxim Dounin
March 30, 2010 07:38AM
Hello!

On Tue, Mar 30, 2010 at 01:16:00PM +0200, Marcin Engelmann wrote:

> I noticed that uploading file (webdav) when client_body_temp_path and
> document root are on different partitions sets access and modify time
> stamps to 1970-01-01 instead of valid time. It works fine if
> client_body_temp_path and document root are on the same partition.

Try the attached patch.

Maxim Dounin
# HG changeset patch
# User Maxim Dounin <mdounin@mdounin.ru>
# Date 1269948739 -14400
# Node ID a2efd44b2c85c90e88a8470f33a9da4fe21c7b85
# Parent 175b534ae706140c4b8581aac8a9c04493c6cb8d
Core: fix file time on ngx_copy_file().

Don't try to set file time if we don't have it.

diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -762,10 +762,12 @@ ngx_copy_file(u_char *from, u_char *to,
size -= n;
}

- if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
- ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
- ngx_set_file_time_n " \"%s\" failed", to);
- goto failed;
+ if (cf->time != -1) {
+ if (ngx_set_file_time(to, nfd, cf->time) != NGX_OK) {
+ ngx_log_error(NGX_LOG_ALERT, cf->log, ngx_errno,
+ ngx_set_file_time_n " \"%s\" failed", to);
+ goto failed;
+ }
}

rc = NGX_OK;
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

Webdav upload and wrong modify time stamp (0.7.65, 0.8.34)

Marcin Engelmann March 30, 2010 07:20AM

Re: Webdav upload and wrong modify time stamp (0.7.65, 0.8.34)

Maxim Dounin March 30, 2010 07:38AM

Re: Webdav upload and wrong modify time stamp (0.7.65, 0.8.34)

Marcin Engelmann March 30, 2010 08:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready