Skip to content
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

Decoder might block if there is data remaining to be flushed from the codec and the stream blocks #123

Closed
Nemo157 opened this issue Jun 3, 2021 · 3 comments · Fixed by #247 or #294

Comments

@Nemo157
Copy link
Member

Nemo157 commented Jun 3, 2021

See gyscos/zstd-rs#119, I'm pretty sure the local bufread::Decoder implementations suffer from this same issue. My first attempt at writing a test case failed to fail though.

@nl5887
Copy link
Contributor

nl5887 commented Sep 23, 2021

I encountered this issue when keeping an open connection, while not sending data. This caused the remaining data to be kept in the decoder. I have fixed the issue, but will try to write a test case.

@fr3akX
Copy link

fr3akX commented Sep 19, 2023

could you, please, review and merge this PR?

@link2xt
Copy link
Contributor

link2xt commented Oct 8, 2024

Seems tokio implementation was not fixed, started to fix it in #294 in a different way and then discovered this change.

link2xt added a commit to link2xt/async-compression that referenced this issue Oct 9, 2024
… read

Unlike zlib, miniz_oxide consumes data into internal state
even if there is not enough space in the output buffer.
Next time poll_fill_buf() is called we should try
to decode from internal state even if no new compressed data
was read.

This change is a port of fix
<Nullus157#123>
(commit Nullus157@22ed0ac)
from `futures` to `tokio`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment