Refactor legacy client to be independent of tokio#269
Draft
erickt wants to merge 6 commits intohyperium:masterfrom
Draft
Refactor legacy client to be independent of tokio#269erickt wants to merge 6 commits intohyperium:masterfrom
erickt wants to merge 6 commits intohyperium:masterfrom
Conversation
3e14630 to
9f5b854
Compare
Now that hyper-util uses `socket2::Socket::set_tcp_nodelay`, which was added in [0.6.0]. It used to be called `socket2::Socket::set_nodelay` in [0.5.10]. It also updates the MSRV to Rust 1.70 since that's the minimum supported version in socket2 0.6.0. [0.5.10]: https://docs.rs/socket2/0.5.10/socket2/struct.Socket.html#method.set_nodelay [0.6.0]: https://docs.rs/socket2/0.6.0/socket2/struct.Socket.html#method.set_tcp_nodelay
9f5b854 to
22c3809
Compare
|
The hyper-rustls part of this looks okay to me, though it definitely feels like there should be a shorthand for |
56d195d to
07e407c
Compare
07e407c to
06eb653
Compare
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.
This patch decouples the functionality of
client::legacyfrom tokio, by lifting up aClient,HttpConnection, andResolverinto theclientmodule. For backwards compatibility, it reimplementsclient::legacyto be based off of the new code.As best as I can tell it should be backwards compatible, and passes all the tests.
There's a couple of areas where I'm not sure if we got quite the right API:
newmethod.This is an experiment, so I wouldn't be surprised if it needs changes. To test out the design, I also have a WIP branch to update
hyper-rustlsto use the new interface, found in https://github.com/erickt/hyper-rustls/tree/new-client. I'll not push that up as a PR for now to avoid splitting the conversation, but I did want to cc @djc since you might also have opinions about how this should look.Note that I did use AI to help with the refactoring, but I did review the code, and did a lot of the restructuring by hand.
Fixes #3842.