changeset 12743:b48c31797b93

dsync: Flush workers' output earlier when saving messages.
author Timo Sirainen <tss@iki.fi>
date Thu, 17 Feb 2011 10:57:05 +0200
parents b1992c77e9d2
children 206cc9b37215
files src/dsync/dsync-brain-msgs-new.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dsync/dsync-brain-msgs-new.c	Thu Feb 17 10:55:38 2011 +0200
+++ b/src/dsync/dsync-brain-msgs-new.c	Thu Feb 17 10:57:05 2011 +0200
@@ -182,6 +182,11 @@
 		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;
 }