-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
decompressionobj: refactor decompress()
The loop termination logic and handling of `unused_data` was a bit convoluted. The logic was subtle enough that it warrants documenting, which I did in the CFFI backend. We now only set `unused_data` after a frame is decoded. I'm not sure if this actually changed meaningful behavior. But that is the semantic intent of the attribute and we should have the logic mirror that. We also change a loop termination condition to avoid a `Zstd_decompressStream()` on input input in the case of a partially filled output buffer. I believe this is safe per the zstd API docs. One change here is we now append chunks before testing `zresult == 0`. If chunk append raises, this could change behavior so we no longer mark the decompressor as finalized. I believe the behavior was sufficiently undefined to not explicitly document in the changelog. Hopefully Hyrum's Law doesn't manifest.
- Loading branch information
Showing
4 changed files
with
40 additions
and
26 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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