feat(body): update Body trait to use Frames#3020
Merged
seanmonstar merged 1 commit intomasterfrom Oct 24, 2022
Merged
Conversation
41c67c9 to
2c98a58
Compare
2c98a58 to
94534c6
Compare
LucioFranco
approved these changes
Oct 24, 2022
Comment on lines
+65
to
+66
| while let Some(next) = res.frame().await { | ||
| let frame = next?; |
Member
There was a problem hiding this comment.
Suggested change
| while let Some(next) = res.frame().await { | |
| let frame = next?; | |
| while let Some(frame) = res.frame().await.transpose()? { |
I think we can write it like this?
8c09ade to
e49e26d
Compare
The `Body` trait was adjusted to be forwards compatible with adding new frame types. That resulted in changing from `poll_data` and `poll_trailers` to a single `poll_frame` function. More can be learned from the proposal in #2840. BREAKING CHANGE: The polling functions of the `Body` trait have been redesigned. The free functions `hyper::body::to_bytes` and `aggregate` have been removed. Similar functionality is on `http_body_util::BodyExt::collect`.
e49e26d to
db979e5
Compare
cratelyn
added a commit
to linkerd/linkerd2-proxy
that referenced
this pull request
Dec 4, 2024
hyper 0.14.x provided a collection of interfaces related to collecting and aggregating request and response bodies, which were deprecated and removed in the 1.x major release. this commit updates calls to `hyper::body::to_bytes(..)` and `hyper::body::aggregate(..)`. for now, `http_body::Body` is used, but we can use `http_body_util::BodyExt` once we've bumped our hyper dependency to the 1.x major release. for more information, see: * linkerd/linkerd2#8733 * hyperium/hyper#2840 * hyperium/hyper#3020 Signed-off-by: katelyn martin <[email protected]>
cratelyn
added a commit
to linkerd/linkerd2-proxy
that referenced
this pull request
Dec 4, 2024
* chore(app/admin): add `http-body` dependency before we address deprecated hyper interfaces related to `http_bodies`, we'll want to add this dependency so that we can call `Body::collect()`. Signed-off-by: katelyn martin <[email protected]> * refactor(app): update deprecated hyper body calls hyper 0.14.x provided a collection of interfaces related to collecting and aggregating request and response bodies, which were deprecated and removed in the 1.x major release. this commit updates calls to `hyper::body::to_bytes(..)` and `hyper::body::aggregate(..)`. for now, `http_body::Body` is used, but we can use `http_body_util::BodyExt` once we've bumped our hyper dependency to the 1.x major release. for more information, see: * linkerd/linkerd2#8733 * hyperium/hyper#2840 * hyperium/hyper#3020 Signed-off-by: katelyn martin <[email protected]> --------- Signed-off-by: katelyn martin <[email protected]>
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.
The
Bodytrait was adjusted to be forwards compatible with adding new frame types. That resulted in changing frompoll_dataandpoll_trailersto a singlepoll_framefunction. More can be learned from the proposal in #2840.Closes #3010
BREAKING CHANGE: The polling functions of the
Bodytrait have beenredesigned.
The free functions
hyper::body::to_bytesandaggregatehave beenremoved. Similar functionality is on
http_body_util::BodyExt::collect.