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

Correctly handle compressing empty slice #42

Merged
merged 2 commits into from
Oct 1, 2018

Conversation

Viq111
Copy link
Collaborator

@Viq111 Viq111 commented Oct 1, 2018

Fixes #41

The current behavior is on the Compress / Decompress, when we give an empty slice for compression, the library return an EmptySlice error. This makes sense for Decompress (since it's not a correct zstd message) but not for Compress.

Also this has a different behavior than the streaming version as those works correctly with empty slices

As #41 points out, the zstd cli correctly returns a slice for empty slice, we should do the same

@Viq111 Viq111 merged commit 6672cee into 1.x Oct 1, 2018
@Viq111 Viq111 deleted the viq111/empty-compression-slice branch October 1, 2018 17:15
bobrik added a commit to bobrik/sarama that referenced this pull request Oct 1, 2018
bobrik added a commit to bobrik/sarama that referenced this pull request Oct 1, 2018
bobrik added a commit to bobrik/sarama that referenced this pull request Oct 2, 2018
elijahandrews added a commit that referenced this pull request Jan 16, 2019
backport #42 to 0.5.x (Correctly handle compressing empty slice), handle decompressing empty byte slice
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.

2 participants