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.
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.
the file was last modified. "Last-Modified" (GMT) returned by MS IIS server was calculated correctly
Which calculation was correct do you mean? Are you saying it set the correct file stamp on the saved file?
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.
No. curl asks the operating system for the file's timestamp.
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 getfiletime() function that works on other/earlier windows compilers.