Skip to main content

Module response_reader

Module response_reader 

Source
Expand description

Bounded framing for text responses from remote servers.

Structs§

FrameReader
An absolute deadline for an explicitly started binary frame. No clock runs between frames or while the caller handles the completed event.

Constants§

MAX_MULTILINE_BYTES
Total retained text of a dot-terminated POP3/NNTP response.
MAX_RESPONSE_LINE_BYTES
Generous control/response-line limit, including CRLF.
RESPONSE_DEADLINE
Absolute deadline after the first byte of a line or multiline body.

Functions§

read_dot_response
Read through the exact . terminator. Preserve content whitespace, undo dot stuffing, and reject EOF or a size violation instead of reporting a partial reply.
read_expected_response_line
A solicited greeting/response must begin and finish within the handshake deadline.
read_response_line
Replace the line buffer with a complete bounded line. Partial EOF is an error; callers must close on an error because the stream is no longer synchronized. Like read_line, this must not be cancelled midway through a response.
read_response_line_with_timeout
Variant with an explicit partial-line deadline (also useful to test slow peers).