dovecot-2.0: zlib: If writing without being corked, flush the st...

dovecot at dovecot.org dovecot at dovecot.org
Sun Feb 14 21:49:44 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/52e1f46fe0ba
changeset: 10709:52e1f46fe0ba
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Feb 14 21:49:40 2010 +0200
description:
zlib: If writing without being corked, flush the stream.

diffstat:

 src/plugins/zlib/ostream-zlib.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 3b544841d5d7 -r 52e1f46fe0ba src/plugins/zlib/ostream-zlib.c
--- 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;


More information about the dovecot-cvs mailing list