Expand description
UploadPack stream framing (SPEC-TRANSPORT-CONNECT §6.1,
SPEC-TRANSPORT §4.2).
UploadValidator checks framing only: a 32-byte pack_id, a declared
size within the binding’s cap, chunks that repeat the header’s pack_id
at contiguous offsets without overrunning it, a bounded chunk count, and a
last chunk at exactly the declared size. It never hashes: the pack sink
verifies BLAKE3 before the pack becomes visible, and hashing here too
would double the CPU cost of a 4 GiB upload.
The canonical copy of mkit serve’s UploadDrain,
mkit-transport-connect 0.4’s drain_upload and the chunk loop of
vcs-worker’s upload_pack. Each UploadError keeps today’s text for
both wire families: UploadError::ssh_message is mkit serve’s and
UploadError::connect_message is mkit-transport-connect’s (the server
it had until WP-M0-15, behind mkit serve --http). The old copies are
gone: mkit serve’s in WP-M0-13, vcs-worker’s in WP-M0-17.
Modules§
- token
- Stateless authenticated upload tickets. Stateless upload ticket authentication (STC §7.6). Only the key id is inspected before authenticating the bytes; claims are decoded afterwards.
Structs§
- Progress
- Where an upload stands after a chunk.
- Upload
Done - A completely framed upload.
- Upload
Limits - Caps a binding applies to one upload. Each binding supplies its own:
the native Connect server uses
PACK_BODY_LIMITand no chunk cap,mkit serveits per-connection byte and frame caps, and the Workers server its 64 MiB buffer cap. - Upload
Validator - Validates one
UploadPackstream’s framing, chunk by chunk, without buffering or hashing. After any error the stream is dead: every later call returns that same error.
Enums§
- Upload
Error - Why an upload stream was rejected.