Handle Zlib inputs left hanging at the middle of a block#2514
Handle Zlib inputs left hanging at the middle of a block#2514etcimon wants to merge 1 commit intovibe-d:masterfrom
Conversation
Handle inputs left hanging at the middle of a block
|
Wow, so this is really a case that needs to be handled? So many small fixes were necessary already here, because the zlib API is so brittle. Based on the documentation, it seems like the input should always be fully drained, as long as enough output space is provided:
...or at least not having enough output space is the only reason given. So if this indeed needs to be done anyway, I would suggest to only do it if there is still something in the input buffer and |
|
So I looked at this some more and tested with different kinds of inputs (different levels of compressibility), as well as input streams that only yielded one byte at a time. I couldn't make the existing code fail that way, unfortunately. Do you remember where it failed for you? Did it fail an assertion (e.g. |
Handle inputs left hanging at the middle of a block