From: Timo Sirainen Date: Fri, 18 Jun 2010 15:28:36 +0000 (+0100) Subject: director: Debug message improvements. X-Git-Tag: 2.0.rc1~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d935f94a88940e4639f685c662eadeba1e9a4914;p=thirdparty%2Fdovecot%2Fcore.git director: Debug message improvements. --HG-- branch : HEAD --- diff --git a/src/director/director-connection.c b/src/director/director-connection.c index bdc25fed4e..b398497c2f 100644 --- a/src/director/director-connection.c +++ b/src/director/director-connection.c @@ -341,6 +341,9 @@ static void director_handshake_cmd_done(struct director_connection *conn) { 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 @@ static bool director_cmd_connect(struct director_connection *conn, } /* 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 ? "" : - 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);