Expand description
HTTP/2 server implementation using h2 crate directly for full server push support
Structs§
- Body
Budget - One connection’s share of
CONNECTION_BODY_BUDGET_BYTES, cloned into each stream’s task. - H2Bounds
- The two read bounds a connection is served under, resolved from the startup parameters.
- H2Server
- HTTP/2 server with full server push support
Constants§
- CONNECTION_
BODY_ BUDGET_ BYTES - The request-body bytes all streams of one connection may hold at once.
- CONNECTION_
CAP_ REFUSAL - What a cleartext (h2c) peer over [
MAX_CONNECTIONS] is told before the socket closes. - FIRST_
BYTE_ READ_ TIMEOUT - How long a peer that has connected and produced nothing may hold a slot.
- IDLE_
BETWEEN_ REQUESTS_ TIMEOUT - How long an established connection may carry no request at all before it is closed.
- INITIAL_
CONNECTION_ WINDOW_ BYTES - The connection-level receive window: the most unread request-body bytes
h2buffers across every stream of one connection together. 1 MiB, so thatMAX_CONCURRENT_STREAMSstreams uploading at once do not serialise on the protocol’s 64 KiB default while the total stays small next toCONNECTION_BODY_BUDGET_BYTES. - INITIAL_
STREAM_ WINDOW_ BYTES SETTINGS_INITIAL_WINDOW_SIZE: how much request body a stream may send before this server reads it. 65,535 bytes, the protocol’s own default, stated rather than inherited: it bounds whath2holds for a stream this server has stopped reading (a refused body, seeBodyBudget), and the handler releases capacity as it reads, so it costs an upload nothing but round trips.- MAX_
CONCURRENT_ STREAMS SETTINGS_MAX_CONCURRENT_STREAMS: how many streams one peer may have open at once.- MAX_
FRAME_ BYTES SETTINGS_MAX_FRAME_SIZE: the largest frame payload this server accepts. 16,384 bytes, the protocol minimum and default. Nothing a request carries needs a larger frame, and a larger frame is a larger single allocation a peer can ask for.- MAX_
HEADER_ LIST_ BYTES SETTINGS_MAX_HEADER_LIST_SIZE: the largest decoded header list one request may carry.
Functions§
- bounded_
h2_ builder - The
h2server builder every HTTP/2 connection is handshaken with — prior-knowledge h2c, TLS, and the HTTP/1.1Upgrade: h2cpath insrc/server/http/mod.rsalike — so the SETTINGS above hold on every way in. - handle_
h2_ request - Handle a single HTTP/2 request with server push support