Skip to main content

Module rsync

Module rsync 

Source
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_BYTES on a character boundary (a client-chosen path can put a multi-byte character across the cut), and ending in a newline.
spawn