Expand description
One request stream, from its HEADERS frame to its last byte.
§Reading
A request stream carries HEADERS and then a body of DATA frames. Only the first is buffered: the body is handed on in the chunks it arrived in, because for this server the body is the tunnel and every copy of it would be paid for per packet. Nothing follows the body – RFC 9114 §4.4 permits only DATA on a stream whose CONNECT has completed, so the trailer section §4.1 allows an ordinary request is a frame this server never sees a use for.
§Validating
Resolver::resolve is where a request becomes a Request, and where
RFC 9114 §4.1.2’s “malformed” verdict is reached. The rules are worth
stating together because they are what a proxy is judged on: a request that
this server accepts is one it will open a socket for.
A malformed request is a stream error: the stream is reset and stopped with H3_MESSAGE_ERROR and nothing else on the connection is disturbed. A frame sequence that makes no sense is a connection error, because after one the stream can no longer be parsed at all.
§Writing
A response is one HEADERS frame; body bytes are DATA frames whose header is written alongside the payload rather than copied in front of it, so a 16 KiB relay chunk reaches the wire as the same allocation it was read into.
Structs§
- Reader
- The receiving half of a split request stream.
- Resolver
- An accepted request stream whose headers have not been read yet.
- Stream
- A bidirectional request stream.
- Writer
- The sending half of a split request stream.
Enums§
- Respond
Error - Why a bounded response never reached the peer.
Functions§
- build_
request - Turns a decoded field section into a request, or says why it cannot.