You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the `ReplayBody<B>` middleware makes use of a `BufList` type to hold a
reference to bytes yielded by the inner body `B`. a `Data` enum is
composed on top to this, to allow bodies to either return (a) a replay
of a previous body, or (b) the iniial bytes yielded by the original
body.
this branch also takes the step of moving some code out of the
`ReplayBody::poll_data(..)` trait method along with inlining
`BufList::push_chunk(..)` , a small helper function that is only used
once.
this is intended to consolidate code related to buffering data yielded
by the underlying `B`-typed body, and extricate logic concerning the
bounding of this buffer from the now defunct `Body::poll_data()` trait
method.
see linkerd/linkerd2#8733 for more information
about upgrading the proxy to hyper 1.0.
this will help make subsequent changes to the model of `ReplayBody<B>`
its corresponding `Body` implementation more reviewable, by proactively
reorganizing things in advance.
---
* refactor(http/retry): outline replay buffer
the replay body uses this `BufList` type to hold a reference to bytes
yielded by the inner body `B`.
the `Data` enum is composed on top to this, to allow bodies to either
return a replay of a previous body, or the iniial bytes yielded by the
original body.
this is all relatively self-contained, so we can move this into a small
submodule.
Signed-off-by: katelyn martin <[email protected]>
* refactor(http/retry): outline replay body buffering
this commit moves some code out of the `ReplayBody::poll_data(..)` trait
method.
this bit of code is where we take a chunk of a data yielded by the inner
body, and push it into our replay buffer. if the capacity is exceeded,
we flush the buffer. in either case, the code copies the chunk into a
cheaply cloneable, contiguous `Bytes`.
this is all related to the buffer, so we move it there.
Signed-off-by: katelyn martin <[email protected]>
* refactor(http/retry): inline `BufList::push_chunk`
`push_chunk` is a small helper function that is only used once. now that
we have moved our buffering code alongside this type, it's more
straightforward to inline this function.
Signed-off-by: katelyn martin <[email protected]>
* refactor(http/retry): rename `BufList` to `Replay`
this structure is responsible for acting as the `bytes::Buf` buffer for
the replay of the initial body.
this commit renames this to articulate that relationship more directly.
Signed-off-by: katelyn martin <[email protected]>
* docs(http/retry): polish `Replay` documentation
Signed-off-by: katelyn martin <[email protected]>
---------
Signed-off-by: katelyn martin <[email protected]>
0 commit comments