dovecot-2.0: zlib: Make sure output stream flushes the stream au...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Jan 21 19:17:06 EET 2011
details: http://hg.dovecot.org/dovecot-2.0/rev/b71834419ea3
changeset: 12572:b71834419ea3
user: Timo Sirainen <tss at iki.fi>
date: Fri Jan 21 19:15:37 2011 +0200
description:
zlib: Make sure output stream flushes the stream automatically when not corked.
Fixes hangs with IMAP COMPRESS extension.
diffstat:
src/plugins/zlib/ostream-zlib.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (27 lines):
diff -r 5a3c87124066 -r b71834419ea3 src/plugins/zlib/ostream-zlib.c
--- a/src/plugins/zlib/ostream-zlib.c Thu Jan 20 23:16:23 2011 +0200
+++ b/src/plugins/zlib/ostream-zlib.c Fri Jan 21 19:15:37 2011 +0200
@@ -129,7 +129,8 @@
}
zstream->crc = crc32_data_more(zstream->crc, data, size);
zstream->bytes32 += size;
- zstream->flushed = FALSE;
+ zstream->flushed = flush == Z_SYNC_FLUSH &&
+ zs->avail_out == sizeof(zstream->outbuf);
return 0;
}
@@ -222,8 +223,12 @@
return -1;
bytes += iov[i].iov_len;
}
+ stream->ostream.offset += bytes;
- stream->ostream.offset += bytes;
+ if (!zstream->ostream.corked) {
+ if (o_stream_zlib_send_flush(zstream) < 0)
+ return -1;
+ }
return bytes;
}
More information about the dovecot-cvs
mailing list