Skip to main content

MAX_MESSAGE_LEN

Constant MAX_MESSAGE_LEN 

Source
pub const MAX_MESSAGE_LEN: u32 = _; // 8_388_608u32
Expand description

Largest total message_length (§5.3.1.2) ChunkAssembler will begin buffering for a single reassembled message: 8 MiB. message_length is a fully attacker-controlled 24-bit wire field (max ~16 MiB); real RTMP audio/video/command messages are always far smaller than this (a single compressed video frame, even a keyframe, is normally well under 1 MiB), so this is a generous ceiling that still bounds worst-case allocation per in-progress message. A Type 0/1 header declaring a larger message_length is rejected by ChunkAssembler before any buffer for it is allocated.