Skip to content

A path-ceiling truncation drops the .delayed marker and loses the file#633

Merged
xroche merged 2 commits into
masterfrom
fix-623-delayed-marker
Jul 18, 2026
Merged

A path-ceiling truncation drops the .delayed marker and loses the file#633
xroche merged 2 commits into
masterfrom
fix-623-delayed-marker

Conversation

@xroche

@xroche xroche commented Jul 18, 2026

Copy link
Copy Markdown
Owner

HTTrack gives a file a temporary .delayed placeholder 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 .delayed is gone the name no longer matches IS_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>.delayed in 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

xroche and others added 2 commits July 18, 2026 07:26
…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>
@xroche
xroche merged commit db19089 into master Jul 18, 2026
21 checks passed
xroche added a commit that referenced this pull request Jul 18, 2026
Resolve tests/Makefile.am: keep 66 (#632), 67 (#633) and this branch's 69.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Xavier Roche <roche@httrack.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A truncated long filename can lose its .delayed marker, so the placeholder is never renamed

1 participant