Skip to content

feat: enforce --min-size/--max-size in network transfer receiver (#365) - #2473

Merged
oferchen merged 1 commit into
masterfrom
worktree-agent-ac15dc3a
Feb 22, 2026
Merged

oferchen merged 1 commit into
masterfrom
worktree-agent-ac15dc3a

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds min_file_size / max_file_size fields to ServerConfig in the transfer crate
  • Wires both limits from ClientConfig into ServerConfig for SSH and daemon transfer paths
  • Applies size filtering in receiver.rs before files are queued for transfer, in all three execution paths (run, run_pipelined, run_pipelined_incremental)
  • Fixes all ServerConfig struct literal constructors in tests to include the new fields

Architecture

The local copy engine already had min/max filtering. The missing piece was the network path: ServerConfig didn't carry the limits, and receiver.rs didn't check them before requesting files from the sender — mirroring upstream rsync's generator.c:recv_generator() size check (lines 1692–1707).

Test plan

  • size_limits_default_to_none: new limits default to None
  • size_limits_can_be_configured: limits can be set on ServerConfig
  • All 940 transfer crate tests pass

@github-actions github-actions Bot added the enhancement New feature or request label Feb 22, 2026
@oferchen
oferchen merged commit 8c3024e into master Feb 22, 2026
10 checks passed
@oferchen
oferchen deleted the worktree-agent-ac15dc3a branch February 22, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant