Expand description
rsync daemon (rsync://, TCP 873) at protocol 29. Rust owns the handshake, the file-list encoding and order, the transfer tokens, the checksums and the end-of-run dance; the model says which modules exist, what each requested path holds, and which uploaded files to take (their contents are handed to it, never written to disk).
Modules§
- actions
- What the model decides for an rsync daemon: which modules exist, what a module holds at the path a client asked for, and which uploaded files to take. The model supplies every byte it serves and is handed every byte it takes; nothing is read from or written to disk.
- wire
- rsync’s daemon protocol, pinned at protocol 29: the
@RSYNCD:text handshake, the argument list, multiplexed framing, the file list, and the MD4 checksums. Shared by the daemon (src/server/rsync/) and the client (src/client/rsync/).
Constants§
- IDLE_
TIMEOUT - Deadline for each line or request from the client.
- MAX_
IDLE_ TIMEOUT_ SECS - MAX_
INBOUND_ BYTES - The largest message one connection buffers from a client: an uploaded file, or the names and symlink targets of an upload’s file list, whichever bound is higher.
- MAX_
MESSAGE_ BYTES - Longest text one multiplexed message carries, in bytes (cut on a character boundary).
- MAX_
PATHS - Paths one request may name.
- MAX_
UPLOAD_ BYTES - All the files of one upload together: the declared sizes of the files taken, and the file data actually received (counted as it arrives, including data past a file’s declared size).
- MAX_
UPLOAD_ FILES - Files one upload may deliver.
- MAX_
UPLOAD_ FILE_ BYTES - Largest single file an upload may deliver; a bigger one is refused before it is requested.
Functions§
- complete_
dirs - Add the directories the model implied but did not list (a/b/c.txt implies a and a/b), and keep one entry per path (the first). Drop duplicate paths and add the directories the remaining paths imply.
- message_
text - The text of a message to the client: control characters removed, cut to at most
MAX_MESSAGE_BYTESon a character boundary (a client-chosen path can put a multi-byte character across the cut), and ending in a newline. - spawn