Skip to content

fix: add ChecksumVerifier::None variant and enforce --whole-file flag - #2342

Merged
oferchen merged 1 commit into
masterfrom
fix/whole-file-checksum-bugs
Feb 18, 2026
Merged

oferchen merged 1 commit into
masterfrom
fix/whole-file-checksum-bugs

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • ChecksumVerifier::None variant: ChecksumVerifier::for_algorithm(ChecksumAlgorithm::None) incorrectly created an Md4 hasher instead of a no-op. Added a proper None variant that produces a 1-byte zero placeholder matching upstream receiver.c behaviour.
  • --whole-file enforcement: Added whole_file: bool to BasisFileConfig and early return in find_basis_file_with_config() when set, matching upstream generator.c:1949. Previously the flag was parsed but never checked during basis file lookup.
  • Generator simplification: Removed special-case Option<ChecksumVerifier> wrapping and ChecksumAlgorithm::None guards in stream_whole_file_transfer() and compute_file_checksum(), since the None variant now handles this cleanly.

Test plan

  • Updated test verifier_for_algorithm_none_is_noop verifies None variant: algorithm(), digest_len() == 1, finalize produces zero byte
  • All 896 transfer tests pass
  • Full workspace: 21,724 tests pass
  • cargo clippy --workspace --all-targets --all-features clean
  • cargo fmt --all -- --check clean

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
oferchen merged commit d277749 into master Feb 18, 2026
30 checks passed
@oferchen
oferchen deleted the fix/whole-file-checksum-bugs branch February 18, 2026 17:14
@oferchen oferchen added the bug Something isn't working label Feb 19, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant