trillium-http-v1.1.0
·
150 commits
to main
since this release
This release adds http/2 support.
Added
pub mod h2— HTTP/2 protocol primitives: HPACK encode/decode, h2 framing,H2Connection,H2Driver,H2Transport. HTTP/2 is automatically negotiated when ALPN selectsh2or via prior-knowledge cleartext ("h2c"). 146/146 h2spec cases pass.- HTTP/2 extended CONNECT (RFC 8441) — opt in via
HttpConfig::with_extended_connect_enabled(); required for WebSockets-over-h2. KnownHeaderName::RefreshConn::h2_connection(),Conn::h2_stream_id(),Conn::h3_stream_id()— for handlers that want to interact with the underlying h2/h3 streamUpgrade::h2_connection,Upgrade::h2_stream_id,Upgrade::h3_stream_id(and_mut/set_/with_/take_variants where applicable) — used bytrillium-websocketsfor WS-over-h2 (RFC 8441)- Various
HttpConfig::h2_*tuning knobs:h2_initial_connection_window_size,h2_initial_stream_window_size,h2_max_stream_recv_window_size,h2_max_concurrent_streams,h2_max_frame_size HttpConfig::dynamic_table_capacity(and setter /with_/_mutvariants) — HPACK/QPACK encoder dynamic table capacity, shared between h2 and h3HttpConfig::recent_pairs_size(and setter /with_/_mutvariants) — per-connection ring size for the HPACK/QPACK encoder's recent-pairs predictorHttpConfig::h3_blocked_streams(and setter /with_/_mutvariants) — maximum number of HTTP/3 streams that may be blocked waiting for QPACK dynamic-table updatesUpgrade::response_headers: Headers— the response headers that had been set on the underlyingConnbefore the upgrade was negotiated. These have already been sent to the peer; preserved here so post-upgrade code can inspect what was sent.response_headers_mut,set_response_headers,with_response_headers, andinto_response_headersround out the accessor surface.Upgrade::status(with_mut/set_/take_/with_variants) —Option<Status>carrying the response status sent before the upgradeUpgrade::start_time(with_mut/set_/with_variants) —Instantrecording when the Conn that became this Upgrade was constructedH3Connection::peer_settings_ready() -> PeerSettingsReady<'_>(gated on theunstablefeature) — async future that resolves toSome(H3Settings)once the inbound control stream has applied the peer's SETTINGS frame, orNoneif the connection shut down before SETTINGS arrived. Required for senders of extended-CONNECT requests (RFC 9220 §3 — the spec forbids sending a:protocolHEADERS until the peer has advertisedSETTINGS_ENABLE_CONNECT_PROTOCOL). On a pooled connection that has already exchanged SETTINGS, the future resolves on the first poll. Multiple awaiters on the same connection are supported.
The existing sync H3Connection::peer_settings(&self) -> Option<&H3Settings> accessor is unchanged.