-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(body): update Body
trait to use Frame
s
#3020
Merged
Merged
Conversation
This file contains 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
seanmonstar
force-pushed
the
http-body-up
branch
2 times, most recently
from
October 24, 2022 18:17
41c67c9
to
2c98a58
Compare
seanmonstar
force-pushed
the
http-body-up
branch
from
October 24, 2022 18:24
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?; |
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.
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?
seanmonstar
force-pushed
the
http-body-up
branch
7 times, most recently
from
October 24, 2022 19:40
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`.
seanmonstar
force-pushed
the
http-body-up
branch
from
October 24, 2022 21:32
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 <kate@buoyant.io>
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 <kate@buoyant.io> * 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 <kate@buoyant.io> --------- Signed-off-by: katelyn martin <kate@buoyant.io>
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
Body
trait was adjusted to be forwards compatible with adding new frame types. That resulted in changing frompoll_data
andpoll_trailers
to a singlepoll_frame
function. More can be learned from the proposal in #2840.Closes #3010
BREAKING CHANGE: The polling functions of the
Body
trait have beenredesigned.
The free functions
hyper::body::to_bytes
andaggregate
have beenremoved. Similar functionality is on
http_body_util::BodyExt::collect
.