Repository navigation
fix: add ChecksumVerifier::None variant and enforce --whole-file flag - #2342
Merged
Merged
Conversation
ChecksumVerifier::for_algorithm(None) incorrectly created an Md4 hasher instead of a no-op, wasting cycles on CSUM_NONE transfers. Add a proper None variant that produces a 1-byte zero placeholder matching upstream receiver.c behaviour. Also enforce --whole-file by adding whole_file to BasisFileConfig and skipping basis file search when set (upstream generator.c:1949). This removes the need for special-case None handling in the generator.
oferchen
added a commit
that referenced
this pull request
May 1, 2026
fix: add ChecksumVerifier::None variant and enforce --whole-file flag
oferchen
added a commit
that referenced
this pull request
May 5, 2026
fix: add ChecksumVerifier::None variant and enforce --whole-file flag
3 tasks done
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
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.
Summary
ChecksumVerifier::for_algorithm(ChecksumAlgorithm::None)incorrectly created an Md4 hasher instead of a no-op. Added a properNonevariant that produces a 1-byte zero placeholder matching upstreamreceiver.cbehaviour.whole_file: booltoBasisFileConfigand early return infind_basis_file_with_config()when set, matching upstreamgenerator.c:1949. Previously the flag was parsed but never checked during basis file lookup.Option<ChecksumVerifier>wrapping andChecksumAlgorithm::Noneguards instream_whole_file_transfer()andcompute_file_checksum(), since theNonevariant now handles this cleanly.Test plan
verifier_for_algorithm_none_is_noopverifiesNonevariant: algorithm(), digest_len() == 1, finalize produces zero bytecargo clippy --workspace --all-targets --all-featurescleancargo fmt --all -- --checkclean