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

AsyncReadDecompressor reads Ok(0) before EOF is reached #4

Closed
jean-airoldie opened this issue Jul 28, 2020 · 7 comments
Closed

AsyncReadDecompressor reads Ok(0) before EOF is reached #4

jean-airoldie opened this issue Jul 28, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@jean-airoldie
Copy link
Contributor

jean-airoldie commented Jul 28, 2020

Basically if the read / write buffer is small enough (less than 54 bytes), AsyncReadCompressor::poll_read returns Poll::Ready(Ok(0)), which is the sentinel for EOF, even though we haven't actually reached end of file.

Here is the example. It uses my async_std branch because it makes the code simpler, but its also an issue on master.

@picoHz picoHz added the bug Something isn't working label Jul 28, 2020
@picoHz
Copy link
Owner

picoHz commented Jul 29, 2020

Close by a318259

@picoHz picoHz closed this as completed Jul 29, 2020
@jean-airoldie
Copy link
Contributor Author

This is not fixed. I'll open a PR later today.

@jean-airoldie
Copy link
Contributor Author

I found this crate that handles the encoding & decoding. I'm wondering whether submitting a patch would be simpler.

@picoHz
Copy link
Owner

picoHz commented Aug 4, 2020

@jean-airoldie Is it related to this issue?

@jean-airoldie
Copy link
Contributor Author

I mean indirectly. We could base the code on their generic state machine to correctly implement the async encoding & decoding. But I'm wondering of the benefits this might have over submitting a patch to add lz4 support.

@picoHz
Copy link
Owner

picoHz commented Aug 4, 2020

You mean move async feature from this crate to async-compression?
That sounds nice because we can remove all the dependencies.

One concern is the complexity of API. Though this crate has a lot of LZ4F options, the encoder interface of async-compression seems quite simple.

@picoHz
Copy link
Owner

picoHz commented Aug 7, 2020

Merged into #12

@picoHz picoHz closed this as completed Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants