Repository navigation
Select engines from an ordered list and dispatch selected client and server connections, as Async::HTTP's protocol connections. - #82
Merged
Conversation
…ame the engine in protocol errors.
…sync::HTTP's protocol client and server connections.
…ion's admission is published.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepare the connection contract for HTTP/2, as
design/http2.mdrequires of M6, with HTTP/1 as the only engine.base-http-protocolnow only selects engines:HttpProtocolsgainsenabled, the engines in preference order, which ALPN offers follow and negotiation accepts, and aPlaintextpolicy for plain TCP; a disabled engine is refused with the newNegotiationError::Disabled, and a missing identifier selects HTTP/1 only when it is enabled.HttpProtocolsis no longerCopy, andHttpProtocolnames 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'sProtocol::HTTP1::ServerandClientare:base-http-server'sServerConnectionowns the connection's input and output and serves its requests, holding the request loop, andbase-http-client'sClientConnection, 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 typeConnectionis no longer public; its HTTP/1 variant still erases the transport's types, which depend on the scheduler and on encryption. The newProtocolErrornames the engine that failed, and the server'sError::ProtocolandError::Responseand the client'sError::Protocolcarry it instead ofbase_http1::Error.serve_connectiontakes the server'sOptions, asserve_tls_connectiondoes, 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.