Skip to main content

Module framing

Module framing 

Source
Expand description

Extract complete FIX messages from a byte stream.

Constants§

MAX_BODY_LEN
BUG-13/FR-024 (feature 006): a sane maximum declared BodyLength (tag 9). No legitimate FIX message (including large repeating-group or RawData-bearing ones) approaches this; a connection declaring more is closed instead of growing an unbounded read buffer while waiting for that many bytes to arrive — a straightforward memory-exhaustion DoS vector otherwise reachable pre- or post-Logon on any open acceptor port.

Functions§

frame_length
If buf begins with at least one complete FIX message, return Ok(Some(total_len)) (the byte length of that message). Return Ok(None) if more bytes are needed, or Err if the start of the buffer cannot be framed (including a declared BodyLength beyond MAX_BODY_LEN).