A path-ceiling truncation drops the .delayed marker and loses the file#633
Merged
Conversation
…the name url_savename appends the mandatory ".delayed" placeholder extension before it enforces the 236-char path ceiling, and the ceiling cuts the tail of the last segment, where the marker lives. A cut marker fails IS_DELAYED_EXT, so back_delayed_rename never renames the file to its final name and the download is lost. Reachable via #133-style deep paths ending in a long hashed segment. Reserve the trailing ".<id>.delayed" in the last-segment copy so it survives the cut, trimming the head of the segment instead. The hex-id absorb stops at its dot separator, so an all-hex hashed base is never mistaken for the tag. Closes #623 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Resolve tests/Makefile.am: keep both 66_engine-port80-strip (from #632) and 67_engine-delayed-truncate. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
HTTrack gives a file a temporary
.delayedplaceholder name while it can't resolve the file type yet, then renames the placeholder once the type is known. The problem is that url_savename appends that marker before it enforces the 236-char path ceiling, and the ceiling cuts the tail of the last path segment, which is exactly where the marker lives. Once the trailing.delayedis gone the name no longer matchesIS_DELAYED_EXT, so back_delayed_rename bails out ("nothing bound to the placeholder name") and the downloaded file is never moved to its final name. It is reachable through #133-style deep paths whose final segment is a long hashed filename.The fix reserves the trailing
.<id>.delayedin the last-segment copy loop and trims the head of the segment instead, so the result still fits under the ceiling. The hex-id scan stops at its dot separator, so a wholly-hex hashed base is never mistaken for the collision tag and pulled into the marker.Test 67 drives the naming path over a deep, over-long delayed URL and checks that the marker survives the cut. It fails on master and passes with the fix.
Closes #623