Skip to main content

DEFAULT_MAX_TOTAL_ATTACHMENT_BYTES

Constant DEFAULT_MAX_TOTAL_ATTACHMENT_BYTES 

Source
pub const DEFAULT_MAX_TOTAL_ATTACHMENT_BYTES: usize = _; // 268_435_456usize
Expand description

Default ceiling on all attachments in one file, together — 256 MiB.

Why this number, and why it is separate. The per-attachment ceiling bounds one payload; nothing in it bounds a container that attaches four hundred of them. A subtitled release with a full ASS font set attaches perhaps ten to thirty fonts of a few MB each — call it 100 MB at the high end. 256 MiB clears that and refuses the file whose attachment table is the attack.

This budget is spent at open, because that is when this crate captures every attachment (the demux tier’s “exactly one packet, before any timed packet” contract is kept by construction, and the construction is eager). A file that exhausts it fails to open, with the arm naming which track ran the total past the line.