Skip to main content

read_header

Function read_header 

Source
pub async fn read_header<S: AsyncRead + Unpin>(
    io: &mut S,
    peer: SocketAddr,
) -> Result<SocketAddr, HeaderError>
Expand description

Reads one header and returns the client it names.

peer is returned when the header carries no address: a v2 LOCAL command (proxy health checks) or an UNKNOWN/unspecified family. Reads exactly the header’s bytes, so the stream resumes at the first byte the client sent. The caller bounds the time this may take.