On 07/14/2016 10:59 AM, Vladimir Sementsov-Ogievskiy wrote: > There are no needs to allocate more than one cluster, as we set > avail_out for deflate to one cluster. > > Zlib docs (http://www.zlib.net/manual.html) says: > "deflate compresses as much data as possible, and stops when the input > buffer becomes empty or the output buffer becomes full." > > So, deflate will not write more than avail_out to output buffer. If > there is no enough space in output buffer for compressed data (it may be
s/no/not/ > larger than input data) deflate just returns Z_OK. (if all data is > compressed and written to output buffer deflate returns Z_STREAM_END). > > Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > --- Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature