dovecot-2.0: director: If we logged that we're delaying connecti...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 19 19:49:28 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/d1012db03a1c
changeset: 11343:d1012db03a1c
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 19 18:49:25 2010 +0200
description:
director: If we logged that we're delaying connections, also log when we continue.

diffstat:

 src/director/director-connection.c |   3 +--
 src/director/director.c            |  15 +++++++++++++--
 src/director/director.h            |   1 +
 3 files changed, 15 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r b43d6d2ef2fb -r d1012db03a1c src/director/director-connection.c
--- a/src/director/director-connection.c	Wed May 19 18:43:47 2010 +0200
+++ b/src/director/director-connection.c	Wed May 19 18:49:25 2010 +0200
@@ -431,8 +431,7 @@
 			return TRUE;
 
 		/* the ring is handshaked */
-		conn->dir->ring_handshaked = TRUE;
-		director_set_state_changed(conn->dir);
+		director_set_ring_handshaked(conn->dir);
 		return TRUE;
 	}
 
diff -r b43d6d2ef2fb -r d1012db03a1c src/director/director.c
--- a/src/director/director.c	Wed May 19 18:43:47 2010 +0200
+++ b/src/director/director.c	Wed May 19 18:49:25 2010 +0200
@@ -115,11 +115,22 @@
 	}
 	if (i == count) {
 		/* we're the only one */
-		dir->ring_handshaked = TRUE;
-		director_set_state_changed(dir);
+		director_set_ring_handshaked(dir);
 	}
 }
 
+void director_set_ring_handshaked(struct director *dir)
+{
+	if (dir->ring_handshake_warning_sent) {
+		i_warning("Directors have been connected, "
+			  "continuing delayed connections");
+		dir->ring_handshake_warning_sent = FALSE;
+	}
+
+	dir->ring_handshaked = TRUE;
+	director_set_state_changed(dir);
+}
+
 void director_update_host(struct director *dir, struct director_host *src,
 			  struct mail_host *host)
 {
diff -r b43d6d2ef2fb -r d1012db03a1c src/director/director.h
--- a/src/director/director.h	Wed May 19 18:43:47 2010 +0200
+++ b/src/director/director.h	Wed May 19 18:49:25 2010 +0200
@@ -69,6 +69,7 @@
 /* Start connecting to other directors */
 void director_connect(struct director *dir);
 
+void director_set_ring_handshaked(struct director *dir);
 void director_set_state_changed(struct director *dir);
 
 void director_update_host(struct director *dir, struct director_host *src,


More information about the dovecot-cvs mailing list