Repository navigation
Conversation
timegm() returns -1 for any date past 2038-01-19T03:14:07Z when time_t is 32 bits (Debian i386, armhf before t64, Win32 with _USE_32BIT_TIME_T), so a mirrored file kept its download time, a Retry-After date was ignored, and proxytrack listed such files as 1969. Move the 64-bit day count #1982 added for cookie Expires into htsdate.c as hts_utc_seconds(), shared with proxytrack, and convert every timegm() site through it. hts_time_clip() bounds the result where a time_t is needed: a file time stamps the last second a 32-bit time_t holds, never 1901. The FTP resume check refuses a clipped date, because two clipped dates would compare equal. The lock file's START= line is printed in 64 bits. Test 659 checks dates on both sides of 2038, 2106 and 9999 through the date parser, Retry-After and a file mtime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Review round 1 on #2002. set_filetime and proxytrack's ARC timestamp now share hts_tm_filetime(), and the FTP MDTM guard is hts_time_exact(), tested in st_y2038. New rows: 1900 and 2100 leap days, years 0 and -1, a Retry-After date equal to the reference, and an epoch date that must leave a file's time alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
xroche
enabled auto-merge (squash)
October 21, 2026 13:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On a 32-bit
time_t,timegm()fails after 2038-01-19, so mirrored files kept their download time and Retry-After dates were ignored. Every date now goes throughhts_utc_seconds(), the 64-bit day count from #1982, and a file time pasttime_tis clipped to its last second. On 32-bit builds, a date before 1901 now stamps the file at 1901-12-13 and gives a Retry-After of 0, as on 64-bit.