Return only inflated content from Zlib.inflate#6612
Merged
enebo merged 2 commits intojruby:jruby-9.2from Mar 17, 2021
Merged
Conversation
Member
Author
|
Need to dig deeper on this... several specs failed. |
The finish result will include data that came after the compressed section from the input. This is appropriate when calling finish to terminate a previous compressed segment and proceed to the next segment, but the class-level #inflate should only return the inflated content. Fixes jruby#6606
9b4c615 to
f3559c0
Compare
Member
Author
|
The new patch is simpler and just returns the inflated content. I believe this matches the MRI behavior better than before. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6606
Need to investigate the surrounding logic, since it no longer matches CRuby and this patch is a bit of a best guess at what is intended. The basic issue was that we were appending extra bytes on the input to the decompressed output. CRuby, on the other hand, just ensures the input buffer contains only those extra bytes, allowing you to pass the same input to inflate repeatedly to get multiple compressed chunks out of it.
We do not support this behavior, and the related test does not pass (this PR neither fixes nor breaks any CRuby zlib tests, as far as I could see).