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
Year 2038 issues on win64 #2238
Comments
long is 32-bit on OS400 too... |
Some notes: Neither I think we'll be forced to introduce new type bits.
|
We could also have |
Make curl_getdate() handle dates before 1970 as well (returning negative values). Make test 517 test dates for 64 bit time_t. This fixes bug (3) mentioned in #2238
I think it's possible that some platforms can have multiple size time_t so for example libcurl can be built with time_t one size and the app can be built with it another size I think. The best might be do it as CURLINFO_FILETIME_T and then curl_off_t which we can assume by 2038 will be 64 bits, and if it's not then long long wouldn't exist |
Really? That would be totally weird. If that truly exists, I'm sure that's more of a mistake than a feature we need to take precautions to deal with. My biggest concern with using -1 is that a But as we've already gone with -1 in several places in our API we're stuck with that externally. |
I think I've seen it done somewhere like time64 or time32 typedef to timet. Or maybe I'm thinking of off_t |
Yes, this is true, but:
IMHO, a file can only have this time if it has been set explicitly. This cannot reasonably be a real time. If we prefer to use the max value for all cases, we could have something equivalent to:
|
Right, but setting the date on files isn't totally unreasonable use-case. Perhaps you set the date of old scanned photos, or PDFs of old books or similar to the date of their origins. My linux system has no problem with very old dates, but I see that Apache doesn't like to serve files from before 1970:
|
Negative values only work if |
If we admit to have a single CURL_TIME_UNKNOWN value out of 4G possible time values, I think the max time_t value suggestion above is the most reasonable (possibly biasing matching real file time by one if needed, as you did in #2250 but downwards), because it would represent the time 1 second before system's "end of the world". In addition, I hope systems providing 32-bit only time_t will not be supported anymore in 2038 !?! Else you cannot avoid an external FALSE/TRUE indicator. |
Make curl_getdate() handle dates before 1970 as well (returning negative values). Make test 517 test dates for 64 bit time_t. This fixes bug (3) mentioned in #2238
|
... with the introduction of CURLOPT_TIMEVALUE_LARGE and CURLINFO_FILETIME_T. Fixes #2238
... with the introduction of CURLOPT_TIMEVALUE_LARGE and CURLINFO_FILETIME_T. Fixes #2238
... with the introduction of CURLOPT_TIMEVALUE_LARGE and CURLINFO_FILETIME_T. Fixes #2238
CURLINFO_FILETIME
returns a time_t as a long, which thus can't return a date after 2038 on win64.CURLOPT_FILETIME
takes along
argument, so libcurl on win64 cannot use dates after 2038 in time-based requests.There's code using
long
in the parsedate() function that will cap curl's ability to parse and return the correct value for date strings specifying dates in 2038 and later.Most (all?) other 64 bit architectures have 64 bit longs so they're not similarly affected.
The text was updated successfully, but these errors were encountered: