-
Notifications
You must be signed in to change notification settings - Fork 985
Upgrade Tokio to v1.x and Hyper to v0.14 #3804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade Tokio to v1.x and Hyper to v0.14 #3804
Conversation
let listener = TcpListener::bind(&addr).await.expect("failed to bind"); | ||
|
||
let tls_stream = async_stream::stream! { | ||
loop { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need a loop that was not needed before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the loop it would handle a single connection before stopping, this is the common pattern in this particular version of hyper (and beyond, I think, though we'll get to updating hyper to the latest in a future PR). An example here https://github.com/hs-CN/async-rustls-stream/blob/ec4298493353d3fae6f86e106d07543b9f1bea56/examples/server_client.rs#L38
} | ||
} | ||
} | ||
.for_each(move |socket| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't believe how bad git is at diffing this change. It looks like it matches perfectly from the old line 611 vs this line 619 down, but git manages to mismatch it all...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks perfectly acceptable. Just wondering about the introduction of the two loops...
This PR updates several long-overdue dependencies:
Tokio: upgraded to version 1.x
Hyper: upgraded to version 0.14
Hyper-rustls: upgrade to 0.23
Tokio-util: upgrade version 0.7
Rustls: Added as an explicit dependency at version 0.20
HTTP Connector Fix: Modified the HTTP connector to allow both HTTP and HTTPS connections for testing purposes.
This will likely require extensive testing once reviewed and merged into master. I'll likely move onto upgrading hyper once these changes are sufficiently verified.