[erlang-questions] zlib design flaw?

Richard A. O'Keefe ok@REDACTED
Wed Sep 24 10:09:19 CEST 2014


I'm a little bit puzzled here.
According to zlib.h, the underlying C code works with
input and output buffers.  Decompression is done in
chunks, and one reason for a chunk stopping is that the
output buffer has filled up.  I would expect a zlib
interface to say "give me the decompressed information
in chunks no bigger than this, as and when I ask for them".

Looking at RFC 1950 and RFC 1951, since reflecting on the fact
that you are supposed to be able to create zlib compressed
stuff by streaming blocks through the library without
announcing the total size in advance, it really doesn't look
as though there can be a way to get the size without
actually decompressing.

Is there any possibility of adjusting the overall protocol to
transmit the size in advance?




More information about the erlang-questions mailing list