Expand description
Wire format.
Two channels. A bidirectional control stream carries the manifest, resume state, and completion signalling. N unidirectional data streams carry chunk frames. Every frame is self-describing — file id, chunk index, and lengths — so frames may arrive on any stream in any order, which is what lets the receiver write with positional I/O and never buffer a whole file.
All integers are little-endian. Every length read off the wire is checked against a caller-supplied limit before it is used to size an allocation.
Modules§
Structs§
- File
Entry - One file in a transfer.
- Frame
Header - Local
File Index - Chunks the receiver already holds, so the sender can skip them. Per-chunk hashes of a file the receiver already has on disk.
- Resume
Entry
Enums§
Constants§
- FRAME_
HEADER_ LEN - Fixed-size data frame header. Authenticated as AEAD associated data, so a peer cannot re-point a sealed chunk at a different file or offset.
- WIRE_
VERSION
Functions§
- read_
control - Read one control message, refusing bodies larger than
max_body. - write_
control - Write one control message:
kind,u32length, body.