Skip to main content

MAX_COMMAND_LEN

Constant MAX_COMMAND_LEN 

Source
pub const MAX_COMMAND_LEN: usize = _ /* 65_536usize */;
Expand description

Largest inbound Command Message body this session will parse: 64 KiB. Reassembly already bounds a message at MAX_MESSAGE_LEN (8 MiB), but a command body is decoded into a full AMF0 value tree before any state-machine check (including the connect stream-key gate), so an 8 MiB body of one-byte nulls or three-byte empty-key pairs would expand into millions of allocations from one message on one connection. Real connect / createStream / publish commands are a few hundred bytes, so this ceiling does not threaten interoperability. A longer body is rejected with RtmpError::CommandTooLong before any AMF0 parsing.