From: Timo Sirainen Date: Sun, 14 Feb 2010 19:49:40 +0000 (+0200) Subject: zlib: If writing without being corked, flush the stream. X-Git-Tag: 2.0.beta3~89 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71c6eb478c57800cc59bbdde822e609faa170d6a;p=thirdparty%2Fdovecot%2Fcore.git zlib: If writing without being corked, flush the stream. --HG-- branch : HEAD --- diff --git a/src/plugins/zlib/ostream-zlib.c b/src/plugins/zlib/ostream-zlib.c index 2e9cb63672..6e5d83b472 100644 --- a/src/plugins/zlib/ostream-zlib.c +++ b/src/plugins/zlib/ostream-zlib.c @@ -96,6 +96,10 @@ o_stream_zlib_send_chunk(struct zlib_ostream *zstream, { 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 @@ o_stream_zlib_send_chunk(struct zlib_ostream *zstream, } } - switch (deflate(zs, Z_NO_FLUSH)) { + switch (deflate(zs, flush)) { case Z_OK: case Z_BUF_ERROR: break;