Skip to main content

MAX_CONTROL_PAYLOAD

Constant MAX_CONTROL_PAYLOAD 

Source
const MAX_CONTROL_PAYLOAD: usize = _ /* 1_048_576usize */;
Expand description

A declared control-message payload length above which ControlFrameWalker stops believing what it is reading.

Not a protocol limit and not enforced on anything — the bytes are forwarded either way. It is a sanity bound on the walker’s own arithmetic, and it applies only to drafts 07-10: drafts 11-22 cap a control payload at 65535 by framing it in sixteen bits, and drafts 07-10 frame it as a varint that can say 2^62 but never does. A length that large there is not a large message, it is a length field read at the wrong offset — most likely because the session’s draft guess is wrong for the moq-00 cohort, where the framing style changed at draft 11.

Draft-23 frames the length as a varint too, but its ALPN names it, so the offset is not a guess, and the receiver’s MAX_CONTROL_MESSAGE_SIZE has no upper bound (draft-23 Section 9.1.8: “The value is encoded as a variable-length integer and MUST be at least 65535”). A long length there is a long message, and the walker counts it down.

Without the bound the walker would count down through that number for the rest of the session, hold every injection, and claim at teardown that a message was half-written. With it, the walker says it does not know where the boundaries are, which is the truth and which suppresses both.