Skip to content

Add APIs to allow switching an HTTP1 connection to HTTP2 if H2 preface is seen#3996

Merged
seanmonstar merged 2 commits intohyperium:masterfrom
pborzenkov:upgradeable-into-parts
Mar 31, 2026
Merged

Add APIs to allow switching an HTTP1 connection to HTTP2 if H2 preface is seen#3996
seanmonstar merged 2 commits intohyperium:masterfrom
pborzenkov:upgradeable-into-parts

Conversation

@pborzenkov
Copy link
Copy Markdown
Contributor

This PR adds APIs to allows switching an HTTP1 connection to an HTTP2 connection
by a server that supports both, like hyper_util::server::conn::auto. Notably,
this is required to implement #3962.

The method returns true if the underlying error is a parse error caused
by HTTP2 preface sent over an HTTP1 connection.
This allows the connection to be deconstructed into I/O object and
some additional information, provided it hasn't yet been upgraded.
Copy link
Copy Markdown
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@seanmonstar seanmonstar merged commit e21205c into hyperium:master Mar 31, 2026
22 checks passed
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.

2 participants