dovecot-2.0: dsync: Removed the new message counter. It wasn't w...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jul 2 15:51:30 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/8384ba48ecf6
changeset: 11706:8384ba48ecf6
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jul 02 13:51:26 2010 +0100
description:
dsync: Removed the new message counter. It wasn't working very well.
Especiall with remote connections it went quickly through, even though it
could still take minutes to actually transfer all the data.

diffstat:

 src/dsync/dsync-brain-msgs-new.c |  17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diffs (55 lines):

diff -r a34f5f7b17a2 -r 8384ba48ecf6 src/dsync/dsync-brain-msgs-new.c
--- a/src/dsync/dsync-brain-msgs-new.c	Fri Jul 02 12:03:49 2010 +0000
+++ b/src/dsync/dsync-brain-msgs-new.c	Fri Jul 02 13:51:26 2010 +0100
@@ -34,8 +34,6 @@
 #include "dsync-worker.h"
 #include "dsync-brain-private.h"
 
-#include <stdio.h>
-
 struct dsync_brain_msg_copy_context {
 	struct dsync_brain_msg_iter *iter;
 	unsigned int msg_idx;
@@ -182,20 +180,13 @@
 				 const mailbox_guid_t *mailbox_guid)
 {
 	struct dsync_brain_new_msg *msgs;
-	unsigned int msg_count, n = 0;
-	bool output_stats = iter->sync->brain->verbose &&
-		iter->sync->brain->stdout_tty;
+	unsigned int msg_count;
 	bool ret = TRUE;
 
 	msgs = array_get_modifiable(&iter->new_msgs, &msg_count);
 	while (iter->next_new_msg < msg_count) {
 		struct dsync_brain_new_msg *msg = &msgs[iter->next_new_msg];
 
-		if (output_stats && (n++ % 10) == 0) {
-			printf("\r%u/%u", iter->next_new_msg, msg_count);
-			fflush(stdout);
-		}
-
 		if (msg->mailbox_idx != iter->mailbox_idx) {
 			i_assert(msg->mailbox_idx > iter->mailbox_idx);
 			ret = FALSE;
@@ -212,11 +203,8 @@
 			break;
 		}
 	}
-	if (iter->next_new_msg == msg_count) {
-		if (output_stats)
-			printf("\r%u msgs saved\n", msg_count);
+	if (iter->next_new_msg == msg_count)
 		ret = FALSE;
-	}
 
 	/* flush copy commands */
 	if (dsync_worker_output_flush(iter->worker) > 0 && ret) {
@@ -376,7 +364,6 @@
 
 void dsync_brain_msg_sync_new_msgs(struct dsync_brain_mailbox_sync *sync)
 {
-	printf("Syncing new messages:\n");
 	dsync_brain_msg_iter_sync_new_msgs(sync->src_msg_iter);
 	dsync_brain_msg_iter_sync_new_msgs(sync->dest_msg_iter);
 }


More information about the dovecot-cvs mailing list