dovecot-2.2: replication plugin: A small optimization to check t...

dovecot at dovecot.org dovecot at dovecot.org
Fri May 15 10:57:53 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/6a40cb15e48f
changeset: 18699:6a40cb15e48f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri May 15 13:48:45 2015 +0300
description:
replication plugin: A small optimization to check the user's "dsyncing" status only once.

diffstat:

 src/plugins/replication/replication-plugin.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r b19ca4214e63 -r 6a40cb15e48f src/plugins/replication/replication-plugin.c
--- a/src/plugins/replication/replication-plugin.c	Fri May 15 13:27:29 2015 +0300
+++ b/src/plugins/replication/replication-plugin.c	Fri May 15 13:48:45 2015 +0300
@@ -184,12 +184,6 @@
 {
 	struct replication_user *ruser;
 
-	if (ns->user->dsyncing) {
-		/* we're running dsync, which means that the remote is telling
-		   us about a change. don't trigger a replication back to it */
-		return;
-	}
-
 	ruser = REPLICATION_USER_CONTEXT(ns->user);
 	if (ruser == NULL)
 		return;
@@ -320,6 +314,12 @@
 	if (value == NULL || value[0] == '\0')
 		return;
 
+	if (user->dsyncing) {
+		/* we're running dsync, which means that the remote is telling
+		   us about a change. don't trigger a replication back to it */
+		return;
+	}
+
 	ruser = p_new(user->pool, struct replication_user, 1);
 	ruser->module_ctx.super = *v;
 	user->vlast = &ruser->module_ctx.super;


More information about the dovecot-cvs mailing list