]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Debug message improvements.
authorTimo Sirainen <tss@iki.fi>
Fri, 18 Jun 2010 15:28:36 +0000 (16:28 +0100)
committerTimo Sirainen <tss@iki.fi>
Fri, 18 Jun 2010 15:28:36 +0000 (16:28 +0100)
--HG--
branch : HEAD

src/director/director-connection.c

index bdc25fed4ef5686db22406a6f0de7bee58bb5d7e..b398497c2f5726b598f15479a26f06fd22bffbac 100644 (file)
@@ -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 ? "<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);