New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Download updates DST error on Windows #2164
Comments
This sounds like the good old Windows being one hour off problems. curl stores the file normally (with what I believe is the correct timestamp from the remote server) and it uses the OS function calls to retrieve the time and date of the file in the subsequent request. If that then gets the wrong time due to DST or whatever, I don't think curl can do a whole lot about it. It uses the time the OS tells it.
Which calculation was correct do you mean? Are you saying it set the correct file stamp on the saved file?
No. curl asks the operating system for the file's timestamp. |
This article proposes to use |
As a "workaround", compile curl with a recent version of Visual C++, because |
Oh, right, thanks for pointing that out. Now it all comes back to me. For me personally I'm fine with recommending people with going >= MSVC 2013 (since they're available as no-cost downloads from Microsoft), but I also won't object if someone wants to go ahead and implement a |
On Windows, stat() may adjust the unix file time by a daylight saving time offset. Avoid this by calling GetFileTime() instead. Fixes curl#2164
On Windows, stat() may adjust the unix file time by a daylight saving time offset. Avoid this by calling GetFileTime() instead. Fixes curl#2164
Fixed, thanks for reporting! |
I did this
Invoked curl.exe with -R and -z
The file on HTTP server was modified when DST was on (May 2017), now DST is off.
Repeated invocations caused download each time (200 OK) instead of 304 response after file was downloaded the first time.
I expected the following
If-Modified-Since in the get request to be the same as Last-Modified in HTTP response.
To calculate "If-Modified-Since" (GMT) curl used current time zone offset instead of the offset active at the time the file was last modified. "Last-Modified" (GMT) returned by MS IIS server was calculated correctly.
Also, Curl should keep and use full history of DST on/off dates for each time zone to handle DST for the files created years ago.
curl/libcurl version
curl 7.55.1 (i386-pc-win32) libcurl/7.55.1 zlib/1.2.8
Release-Date: 2017-08-14
operating system
Windows 2008 64bit
The text was updated successfully, but these errors were encountered: