mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
decompressed chunks are incomplete #95
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mshneer on GitHub (Mar 7, 2016).
I have written a simple test (https://gist.github.com/mshneer/a9b442539917842bc0ef) that breaks HTML into chunks, then compresses, then decompressed. Somehow, there is a difference between chunks that come in and chunks that come out. My understanding that calling WriteBrotliData(... , */* force_flush / true, ...) should not have this effect.
I was also testing against 0.3.0 release.
Any ideas how to cause the compressor to not buffer things like this?
@KenjiBaheux commented on GitHub (Mar 7, 2016):
Thanks for filing this issue.
cc/ @jyrkialakuijala @eustas
@eustas commented on GitHub (Mar 8, 2016):
Hello.
After you call "BrotliDecompressBufferStreaming" compressedBytes, most likely, isn't zero. This is because "flush" flag of WriteBrotliData doesn't mean "hard flush". To make a "hard flush" you need to Write empty metablock after flushed data block.
Sorry for the unclear API documentation. Will fix it soon.
@eustas commented on GitHub (Mar 8, 2016):
s/empty metablock/empty metadata block/
@eustas commented on GitHub (Jun 17, 2016):
Please consider using our new streaming API:
BrotliEncoderCompressStreamwith op=BROTLI_OPERATION_FLUSHdoes exactly what is expected.Sorry for the inconvenience and thank you for your interest to brotli.