Skip to content

Select engines from an ordered list and dispatch selected client and server connections, as Async::HTTP's protocol connections. - #82

Merged
ioquatix merged 4 commits into
mainfrom
version-neutral-connections
Nov 21, 2026
Merged

ioquatix merged 4 commits into
mainfrom
version-neutral-connections

Conversation

@ioquatix

@ioquatix ioquatix commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Prepare the connection contract for HTTP/2, as design/http2.md requires of M6, with HTTP/1 as the only engine. base-http-protocol now only selects engines: HttpProtocols gains enabled, the engines in preference order, which ALPN offers follow and negotiation accepts, and a Plaintext policy for plain TCP; a disabled engine is refused with the new NegotiationError::Disabled, and a missing identifier selects HTTP/1 only when it is enabled. HttpProtocols is no longer Copy, and HttpProtocol names an engine and its ALPN identifier and no longer constructs codec pairs. Each side constructs its selected connection, a closed enum with one variant per engine, as Async::HTTP's Protocol::HTTP1::Server and Client are: base-http-server's ServerConnection owns the connection's input and output and serves its requests, holding the request loop, and base-http-client's ClientConnection, which the endpoint pool's entries hold, opens exchanges and checks an idle connection before reuse, in place of a trait object, and the pool entry type Connection is no longer public; its HTTP/1 variant still erases the transport's types, which depend on the scheduler and on encryption. The new ProtocolError names the engine that failed, and the server's Error::Protocol and Error::Response and the client's Error::Protocol carry it instead of base_http1::Error. serve_connection takes the server's Options, as serve_tls_connection does, so it now uses the configured plaintext engine rather than the default; plain TCP selects its engine before constructing streams or, on the client, before connecting. Tests cover offers, unknown and disabled identifiers, a missing identifier with and without HTTP/1 enabled, a disabled plaintext engine on the server and client, and protocol errors; region coverage is complete and the suite passes on Rust 1.92 and 1.99.

@ioquatix ioquatix changed the title Select version-neutral connections from an ordered engine list, with protocol errors that name their engine. Select engines from an ordered list and dispatch selected client and server connections, as Async::HTTP's protocol connections. Nov 20, 2026
@ioquatix
ioquatix merged commit 38c4f79 into main Nov 21, 2026
8 checks passed
@ioquatix
ioquatix deleted the version-neutral-connections branch November 21, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant