]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Flush workers' output earlier when saving messages.
authorTimo Sirainen <tss@iki.fi>
Thu, 17 Feb 2011 08:57:05 +0000 (10:57 +0200)
committerTimo Sirainen <tss@iki.fi>
Thu, 17 Feb 2011 08:57:05 +0000 (10:57 +0200)
src/dsync/dsync-brain-msgs-new.c

index a518dcddce7da3e7bcd661aa9da380771574365a..b3edd626fe8fc0a7533d0100860140292701a4fa 100644 (file)
@@ -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;
 }