Function rustls::msgs::deframer::payload_size

source ยท
fn payload_size(buf: &[u8]) -> Result<Option<usize>, Error>
Expand description

Determine the expected length of the payload as advertised in the header.

Returns Err if the advertised length is larger than what we want to accept (MAX_HANDSHAKE_SIZE), Ok(None) if the buffer is too small to contain a complete header, and Ok(Some(len)) otherwise.