From: Timo Sirainen Date: Thu, 17 Feb 2011 08:57:05 +0000 (+0200) Subject: dsync: Flush workers' output earlier when saving messages. X-Git-Tag: 2.0.10~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2c9c32cbac021b4db8fdbc25e6babca95e36537;p=thirdparty%2Fdovecot%2Fcore.git dsync: Flush workers' output earlier when saving messages. --- diff --git a/src/dsync/dsync-brain-msgs-new.c b/src/dsync/dsync-brain-msgs-new.c index a518dcddce..b3edd626fe 100644 --- a/src/dsync/dsync-brain-msgs-new.c +++ b/src/dsync/dsync-brain-msgs-new.c @@ -182,6 +182,11 @@ dsync_brain_msg_sync_add_new_msg(struct dsync_brain_msg_iter *dest_iter, dest_iter->adding_msgs = FALSE; if (dsync_worker_output_flush(src_iter->worker) < 0) return -1; + if (dsync_worker_is_output_full(dest_iter->worker)) { + /* see if the output becomes less full by flushing */ + if (dsync_worker_output_flush(dest_iter->worker) < 0) + return -1; + } } return dsync_worker_is_output_full(dest_iter->worker) ? 0 : 1; }