dovecot-2.0: director: Debug message improvements.

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 18 18:28:55 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/61708c33154d
changeset: 11579:61708c33154d
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 18 16:28:36 2010 +0100
description:
director: Debug message improvements.

diffstat:

 src/director/director-connection.c |  28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diffs (52 lines):

diff -r 2e686a6403e3 -r 61708c33154d src/director/director-connection.c
--- a/src/director/director-connection.c	Fri Jun 18 16:28:14 2010 +0100
+++ b/src/director/director-connection.c	Fri Jun 18 16:28:36 2010 +0100
@@ -341,6 +341,9 @@
 {
 	struct director *dir = conn->dir;
 
+	if (dir->debug)
+		i_debug("Handshaked to %s", conn->host->name);
+
 	conn->handshake_received = TRUE;
 	if (conn->in) {
 		/* handshaked to left side. tell it we've received the
@@ -527,22 +530,29 @@
 	}
 
 	/* remote suggests us to connect elsewhere */
-	if (dir->debug) {
-		i_debug("Received CONNECT request to %s, "
-			"current right is %s", host->name,
-			dir->right == NULL ? "<none>" :
-			dir->right->name);
-	}
-
 	if (dir->right != NULL &&
 	    director_host_cmp_to_self(host, dir->right->host,
 				      dir->self_host) <= 0) {
 		/* the old connection is the correct one */
-		if (dir->debug)
-			i_debug("Ignoring CONNECT");
+		if (dir->debug) {
+			i_debug("Ignoring CONNECT request to %s "
+				"(current right is %s)",
+				host->name, dir->right->name);
+		}
 		return TRUE;
 	}
 
+	if (dir->debug) {
+		if (dir->right == NULL) {
+			i_debug("Received CONNECT request to %s, "
+				"initializing right", host->name);
+		} else {
+			i_debug("Received CONNECT request to %s, "
+				"replacing current right %s",
+				host->name, dir->right->name);
+		}
+	}
+
 	/* connect here, disconnect old one */
 	if (dir->right != NULL)
 		director_connection_deinit(&dir->right);


More information about the dovecot-cvs mailing list