Mercurial > dovecot > core-2.2
changeset 10709:52e1f46fe0ba HEAD
zlib: If writing without being corked, flush the stream.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 14 Feb 2010 21:49:40 +0200 |
parents | 3b544841d5d7 |
children | 3d7fb69184b3 |
files | src/plugins/zlib/ostream-zlib.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/plugins/zlib/ostream-zlib.c Sun Feb 14 21:49:13 2010 +0200 +++ b/src/plugins/zlib/ostream-zlib.c Sun Feb 14 21:49:40 2010 +0200 @@ -96,6 +96,10 @@ { z_stream *zs = &zstream->zs; ssize_t ret; + int flush; + + flush = zstream->ostream.corked || zstream->gz ? + Z_NO_FLUSH : Z_SYNC_FLUSH; if (!zstream->header_sent) o_stream_zlib_send_gz_header(zstream); @@ -115,7 +119,7 @@ } } - switch (deflate(zs, Z_NO_FLUSH)) { + switch (deflate(zs, flush)) { case Z_OK: case Z_BUF_ERROR: break;