Skip to main content

decode_startup

Function decode_startup 

Source
pub async fn decode_startup<A>(
    conn: A,
    max_frame_len: usize,
) -> Result<Option<FrontendStartupMessage>, Error>
where A: AsyncRead + Unpin,
Expand description

Reads and decodes one startup message from the client.

max_frame_len bounds the frame the client may declare, including its own four-byte length field. It is checked before the body buffer is sized, so the buffer follows the caller’s ceiling rather than the protocol maximum. Pass MAX_STARTUP_FRAME_SIZE, or MAX_FORWARDED_STARTUP_FRAME_SIZE if a balancer may have appended parameters in transit.