weida

GitHub crates.io

HTTP (hyper 1.12.0, h3 0.0.8) — feature parity

Rendered from docs/libraries/http.md at 92c768a

Contents
  1. 1. What a row means
  2. 2. Versions, roles and message features
  3. 3. Transports
  4. 4. Mechanisms and authentication
  5. 5. Options
  6. 6. Observability
  7. 7. Devices and helpers
  8. 8. Interop evidence
  9. 9. Deliberate deviations and bounds
  10. 10. The definition of done
  11. 11. Sources

weida-http-codec (codec) and weida-http (client and server), the sixth protocol family (0044). Every row below is a verdict on what this library does with an item of HTTP's inventory as RFC 9110, 9112, 9113 and 9114 define it and as hyper (HTTP/1.1, HTTP/2) and h3 (HTTP/3) implement it.

1. What a row means

  • present: implemented; the row names the module and the test that proves it.
  • refused with a reason: the library says no at the call or on the wire, by name.
  • absent with a reason: not implemented; the row says what a caller who wants it does not get. 0044 §6 lists the absences that are decisions.

There is no "partial". Measured claims were measured against hyper 1.12.0 with hyper-util 0.1.21 and http-body-util 0.1.5, h3 0.0.8 with h3-quinn 0.0.10 on quinn 0.11.12 (all from Cargo.lock), and curl 8.23.0 with nghttp2 1.70.0, ngtcp2 1.25.0 and nghttp3 1.18.0.

2. Versions, roles and message features

ItemVerdictEvidence
HTTP/1.1 clientpresenth1/client.rs; io::interop_hyper::our_client_against_hyper_h1{,_over_tls}
HTTP/1.1 serverpresenth1/server.rs; io::interop_hyper::hyper_h1_client_against_our_server
HTTP/1.0 peerspresent: read, answered with keep-alive only on connection: keep-alive, bodies close-delimitedh1::server framing, h1::client::read_response
HTTP/2 clientpresent, over TLS by ALPN h2h2/conn.rs; io::interop_hyper::our_client_against_hyper_h2
HTTP/2 serverpresent, offered by Server::bind_tlsio::interop_hyper::hyper_h2_client_against_our_server
HTTP/3 clientpresent with feature h3, Protocol::Http3h3.rs; io::interop_h3::our_client_against_h3_server
HTTP/3 serverpresent with feature h3, Server::bind_quicio::interop_h3::h3_client_against_our_server
Every method tokenpresent; Method::from_bytes validates a tokentypes::tests::methods_are_tokens
CONNECTrefused: Error::Unsupported("CONNECT") on the client, 501 (h1) or a stream error (h2, h3) on the serverh1::server refusal tests
Upgrade, 101 Switching Protocols, WebSocketrefused: a 101 is Error::Protocol; upgrade is a connection-specific field the client refusesh1::client::tests::interim_responses_are_skipped_and_101_refused
Interim (1xx) responsespresent: skipped by the client; a server cannot send one (Error::Protocol) except 100 Continuesame test
Expect: 100-continuepresent on the server (sent at the first body read); the client never sends expecth1::server::tests::continue_is_sent_only_when_the_body_is_first_read
Content-Length bodiespresent, enforced both waysh1::client::tests::a_declared_length_is_enforced_on_upload, BodyWriter
Chunked bodies and trailerspresent on HTTP/1.1; trailers on every versionio::loopback trailer rows, h2::conn::tests::trailers_both_ways
Transfer codings other than chunkedrefused: 501 on the server, "transfer coding" on the clientgolden_framing_refusals
Persistent connectionspresent: idle HTTP/1.1 connections per origin, one shared HTTP/2 or HTTP/3 connection per originh1::client::tests::keep_alive_returns_the_connection_and_close_does_not, io::interop_hyper connection counts
Pipeliningpresent on the server, answered in order; absent on the client, which sends one request per connection at a timeh1::server::tests::pipelined_requests_are_answered_in_order
Server pushrefused: SETTINGS_ENABLE_PUSH = 0, no MAX_PUSH_ID, PUSH_PROMISE is a connection errorh2/conn.rs, h3.rs
h2c (cleartext HTTP/2)refused: Error::Unsupported("h2 without TLS (h2c)")client.rs
Redirectsabsent by decision: a 3xx is returned (0044 §4)weida-openbao redirect test
Cookies, content coding, proxies, Alt-Svcabsent by decision (0044 §6)—

3. Transports

TransportVerdictEvidence
TCPpresentdial.rs, Server::bind_tcp
TLS over TCP, ALPN http/1.1 and h2present, the caller's rustls config with only ALPN setdial::upgrade_tls, Server::bind_tls
QUIC (HTTP/3)present with h3h3::connect, Server::bind_quic
Several addresses for one namepresent: TCP tried in turn with half the budget each; QUIC raced 250 ms apart (RFC 8305)dial.rs, h3::connect
UNIX-domain socketsabsent: no URL form names one and no peer here uses one—

4. Mechanisms and authentication

ItemVerdictEvidence
Server certificate validationpresent, by the caller's rustls::ClientConfigClientOptions::tls
Client certificatespresent, whatever the caller's rustls configs setServerOptions takes the caller's ServerConfig
Authorization, cookies as credentialspresent as fields; never HPACK/QPACK-indexed, printed <redacted>types::tests::credentials_never_print, hpack::tests::a_sensitive_field_is_never_indexed_and_never_enters_the_table
HTTP authentication schemes (Basic, Digest, Bearer)absent: the field is the application's—

5. Options

hyper / h2 / h3 optionHereVerdict
http2::Builder::initial_stream_window_sizestream_windowpresent
http2::Builder::initial_connection_window_sizeconnection_windowpresent
http2::Builder::max_concurrent_streamsServerOptions::max_concurrent_streamspresent
http2::Builder::max_frame_sizeLimits::max_frame_sizepresent
http2::Builder::max_header_list_size, http1::Builder::max_buf_sizeLimits::max_head_bytespresent
http1::Builder::header_read_timeoutServerOptions::header_timeoutpresent
http1::Builder::keep_alive, h2 keep-alive pingsidle_timeout closes idle connections; no pings are sentpresent / absent (no ping keep-alive)
pool max_idle_per_host, pool_idle_timeoutClientOptions::max_idle_per_origin, idle_timeoutpresent
connect timeoutClientOptions::connect_timeout (lookup, TCP, TLS or QUIC together)present
request timeoutabsent: the caller's deadline (Exec::within); filed as B-372absent
http2::Builder::adaptive_windowabsent: windows are fixed by the optionsabsent
http2::Builder::max_pending_accept_reset_streamsServerOptions::max_concurrent_streams also bounds the exchanges a connection holds for accept, reset streams included; past it a new stream gets REFUSED_STREAMpresent (h2::conn::tests::streams_reset_while_nobody_accepts_are_refused_past_the_limit)
h3 max_field_section_sizeLimits::max_head_bytes, advertised in SETTINGSpresent
QPACK table capacity, blocked streamsfixed at 0refused (0044 §4)

6. Observability

tracing events at debug level for TLS handshake failures, HTTP/2 connection errors and a peer's GOAWAY with a code. No counters and no metrics hook: absent, because no consumer asked for them and weida's statistics model (0036) is per connection of a weida endpoint.

7. Devices and helpers

None. hyper's service and tower layers have no counterpart: the server is pull-style (Server::accept yields an Exchange, 0044 §4). No proxy, no router, no static file server.

8. Interop evidence

PairingRolesRowsTest
hyper 1.12.0 server::conn::http1our client3 B GET, 1 MiB echo, 4 MiB chunked, keep-alive reuse on one connection, plain and TLSio::interop_hyper::our_client_against_hyper_h1{,_over_tls}, two_requests_share_one_keep_alive_connection
hyper 1.12.0 client::conn::http1our serverGET (with date), 1 MiB echo, chunked responseio::interop_hyper::hyper_h1_client_against_our_server
hyper 1.12.0 server::conn::http2our clientGET, 1 MiB echo, 50 concurrent on one connection, trailers, Version::Http2io::interop_hyper::our_client_against_hyper_h2
hyper 1.12.0 client::conn::http2our serverGET, 1 MiB echo, 50 concurrent on one connection, trailersio::interop_hyper::hyper_h2_client_against_our_server
h3 0.0.8 server on h3-quinn 0.0.10our clientGET, 1 MiB echo, 50 concurrent, trailersio::interop_h3::our_client_against_h3_server
h3 0.0.8 client on h3-quinn 0.0.10our serverGET, 1 MiB echo, 50 concurrent on one connection, trailersio::interop_h3::h3_client_against_our_server
curl 8.23.0our server (examples/hello.rs)HTTP/1.1, HTTP/2 (--http2), HTTP/3 (--http3-only)smoke, recorded in the NIGHTLOG for B-368

Disagreements found and settled: the h3 client sends unknown (grease) frames after a request's trailers, which this library first refused; RFC 9114 §9 allows them and they are now skipped. The suites run in the integration tier on four platforms (runner pipelines #41, #43).

9. Deliberate deviations and bounds

Deviations:

  • Obsolete line folding is refused in responses too (RFC 9112 §5.2 lets a client replace it), so one parser serves both directions; pinned by golden_head_refusals.
  • A transfer coding other than chunked is refused rather than passed through undecoded.
  • The HPACK encoder writes credentials never-indexed and takes Huffman only when strictly shorter, so RFC 7541 C.5.3, C.6.2 and C.6.3 are asserted decode-only (codec hpack docs).
  • An uppercase field name in HTTP/2 is a stream error with the HPACK table kept in step.

Bounds, each the caller's:

BoundDefaultHolds back
Limits::max_head_bytes64 KiBan h1 head or trailer section; a decoded h2/h3 field section (name + value + 32); an h2 header block; an h3 HEADERS payload
Limits::max_fields128fields in one section
Limits::max_chunk_line1 KiBa chunk-size line with extensions
Limits::max_frame_size16 384an h2 frame; an h3 frame other than DATA and HEADERS
stream_window1 MiBwhat one h2/h3 stream may send before it is read
connection_window4 MiBwhat one h2/h3 connection may send before it is read
ServerOptions::max_concurrent_streams100streams a client may open at once, and the exchanges one connection holds back for accept, streams the client reset included
ServerOptions::max_connections1024connections served at once
ServerOptions::accept_queue64exchanges waiting for accept
ClientOptions::max_idle_per_origin4idle HTTP/1.1 connections per origin
ClientOptions::max_resolved_addresses8addresses tried for one name

Fixed bounds: four queued body chunks per HTTP/1.1 exchange, 64 KiB of unread request body drained before a connection is kept, 16 KiB per read, 256 KiB of queued HTTP/2 output before the peer is read again.

10. The definition of done

0013 §4.7 clauseVerdictSection
1. typed coverage of the primitive inventorymet: three versions, both roles§2
2. transports implemented or refusedmet§3
3. security mechanisms implemented or refusedmet§4
4. options and bounds row by rowmet§5, §9
5. monitoring and native devicesmet: tracing only, no devices by decision§6, §7
6. parity document backed by interop against named versionsmet§8

11. Sources

  • docs/research/http.md §1-§3, §5, §8, §10, §11, §13.
  • 0044, 0013 §4.7.
  • crates/http/weida-http-codec/src/{h1,hpack,huffman,h2,qpack,h3,varint,uri}.rs; crates/http/weida-http/src/{client,server,body,h1,h2,h3,pool,dial,options,types}.rs; crates/http/weida-http/tests/io/{interop_hyper,interop_h3,loopback}.rs.