diff src/director/director-connection.c @ 11572:659bb1a26da4 HEAD

director: Added initial testing framework and some debugging output.
author Timo Sirainen <tss@iki.fi>
date Thu, 17 Jun 2010 19:18:34 +0100
parents 75d5e31ea8cc
children 61708c33154d
line wrap: on
line diff
--- a/src/director/director-connection.c	Thu Jun 17 19:16:09 2010 +0100
+++ b/src/director/director-connection.c	Thu Jun 17 19:18:34 2010 +0100
@@ -527,10 +527,19 @@
 	}
 
 	/* 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");
 		return TRUE;
 	}
 
@@ -783,6 +792,11 @@
 
 	*_conn = NULL;
 
+	if (conn->dir->debug && conn->host != NULL) {
+		i_debug("Director %s:%u disconnected",
+			net_ip2addr(&conn->host->ip), conn->host->port);
+	}
+
 	if (conn->dir->left == conn)
 		conn->dir->left = NULL;
 	if (conn->dir->right == conn)