A failed re-fetch overwrote the mirrored file with the aborted read's debris - #763
Merged
Conversation
… debris A transfer that dies before a complete response has no body, yet the save path still consulted r.adr, which at that point holds whatever the aborted header read left behind: raw status-line bytes, or an empty buffer that truncated the file to zero on macOS. Require a successful transfer, as the empty-body half of the condition already did. Closes #748 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
Test 93 filtered reset.bin out of its bucket lists because a connection killed before the status line surfaced differently per platform. It no longer does, so assert the resource like any other: unchanged, with the bytes pass 1 mirrored. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
The new test passed with no second pass at all, so a regression that stopped re-fetching would have looked green. Assert the failure the fixture provokes, give stay.bin a fresh pass-2 body so a fix that stopped overwriting anything fails, and compare reset.bin by checksum rather than by length. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
The message a cut connection produces depends on whether any bytes arrived, so matching it would fail on a runner that sees none. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Xavier Roche <roche@httrack.com>
xroche
added a commit
that referenced
this pull request
Jul 27, 2026
Signed-off-by: Xavier Roche <roche@httrack.com> # Conflicts: # src/htsback.c # tests/96_local-refetch-keep.test
xroche
added a commit
that referenced
this pull request
Jul 27, 2026
96 was taken by #763 on master. Co-Authored-By: Claude Opus 5 (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.
A re-fetch whose connection dies before a complete response destroyed the file it was supposed to refresh. Nothing arrives, but the save path still consults
r.adr, which by then holds whatever the aborted read left in the header buffer: raw status-line bytes on Linux, an empty buffer on macOS, where the mirrored file came out zero-length. Saving now requires a successful transfer, which is what the empty-body half of the condition already required.The new test uses the HTTP 500 path as its control, since an error response on the same resource already keeps the previous copy. Purging is off there: an update purge deletes the same files for a separate reason (#746) and would mask this one.
Closes #748