Skip to content

Conversation

Geal
Copy link
Contributor

@Geal Geal commented Aug 25, 2022

Fix #1572

async-compression is used in tower-http's CompressionLayer. Inside the
AsyncRead based compression code, if the underlying stream returns
Poll::Pending, it will be returned directly, while in the case of
deferred responses, the next one might come way later, so we want to
send whatever data we have available right now.
We will have to switch to an AsyncWrite interface instead, which will be
more flexible, but considering the timing of the release, this patch
will hold for now.

This uses the code from Nullus157/async-compression#155

async-compression is used in tower-http's CompressionLayer. Inside the
AsyncRead based compression code, if the underlying stream returns
Poll::Pending, it will be returned directly, while in the case of
deferred responses, the next one might come way later, so we want to
send whatever data we have available right now.
We will have to switch to an AsyncWrite interface instead, which will be
more flexible, but considering the timing of the release, this patch
will hold for now
@github-actions

This comment has been minimized.

@Geal Geal requested review from garypen and o0Ignition0o August 25, 2022 08:32
@Geal Geal mentioned this pull request Aug 25, 2022
@Geal Geal added this to the v1.0.0-alpha.0 milestone Aug 25, 2022
@Geal Geal merged commit 0e0b64d into main Aug 26, 2022
@Geal Geal deleted the geal/chunk-compression branch August 26, 2022 10:54
@abernix abernix mentioned this pull request Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

deferred responses should be compressed
3 participants