Revision ebf7bba090e617fd841177e6ea3de3a129c31a97 authored by Vladimir Sementsov-Ogievskiy on 14 July 2016, 16:59:25 UTC, committed by Max Reitz on 26 July 2016, 15:46:37 UTC
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 not enough space in output buffer for compressed data (it may
be 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 <vsementsov@virtuozzo.com>
Message-id: 1468515565-81313-1-git-send-email-vsementsov@virtuozzo.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
1 parent f49ee63
History
File Mode Size
Makefile.objs -rw-r--r-- 266 bytes
channel-buffer.c -rw-r--r-- 6.9 KB
channel-command.c -rw-r--r-- 9.7 KB
channel-file.c -rw-r--r-- 6.0 KB
channel-socket.c -rw-r--r-- 21.7 KB
channel-tls.c -rw-r--r-- 10.9 KB
channel-util.c -rw-r--r-- 1.4 KB
channel-watch.c -rw-r--r-- 8.6 KB
channel-websock.c -rw-r--r-- 29.2 KB
channel.c -rw-r--r-- 7.9 KB
task.c -rw-r--r-- 3.8 KB
trace-events -rw-r--r-- 4.3 KB

back to top