Skip to main content

Module h2_server

Module h2_server 

Source
Expand description

HTTP/2 server implementation using h2 crate directly for full server push support

Structs§

BodyBudget
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 h2 buffers across every stream of one connection together. 1 MiB, so that MAX_CONCURRENT_STREAMS streams uploading at once do not serialise on the protocol’s 64 KiB default while the total stays small next to CONNECTION_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 what h2 holds for a stream this server has stopped reading (a refused body, see BodyBudget), 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 h2 server builder every HTTP/2 connection is handshaken with — prior-knowledge h2c, TLS, and the HTTP/1.1 Upgrade: h2c path in src/server/http/mod.rs alike — so the SETTINGS above hold on every way in.
handle_h2_request
Handle a single HTTP/2 request with server push support