dovecot-2.2: dsync: Avoid wasting data stack on larger renames.

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 14 00:24:01 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/1c657812991b
changeset: 16514:1c657812991b
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 14 00:16:14 2013 +0300
description:
dsync: Avoid wasting data stack on larger renames.

diffstat:

 src/doveadm/dsync/dsync-mailbox-tree-sync.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r e6aa668477d8 -r 1c657812991b src/doveadm/dsync/dsync-mailbox-tree-sync.c
--- a/src/doveadm/dsync/dsync-mailbox-tree-sync.c	Thu Jun 13 23:31:00 2013 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-tree-sync.c	Fri Jun 14 00:16:14 2013 +0300
@@ -717,6 +717,7 @@
 	struct dsync_mailbox_node **local_nodep = &local_parent->first_child;
 	struct dsync_mailbox_node **remote_nodep = &remote_parent->first_child;
 	struct dsync_mailbox_node *local_node, *remote_node;
+	bool changed;
 
 	/* the nodes are sorted by their names. */
 	while (*local_nodep != NULL || *remote_nodep != NULL) {
@@ -750,11 +751,19 @@
 			/* mailboxes are equal, no need to rename */
 		} else {
 			/* mailbox naming conflict */
-			if (sync_rename_conflict(ctx, local_node, remote_node))
+			T_BEGIN {
+				changed = sync_rename_conflict(ctx, local_node,
+							       remote_node);
+			} T_END;
+			if (changed)
 				return TRUE;
 		}
 		/* handle children, if there are any */
-		if (sync_rename_mailboxes(ctx, local_node, remote_node))
+		T_BEGIN {
+			changed = sync_rename_mailboxes(ctx, local_node,
+							remote_node);
+		} T_END;
+		if (changed)
 			return TRUE;
 
 		local_nodep = &local_node->next;


More information about the dovecot-cvs mailing list