dovecot-2.0: ldap: Don't log an error when server disconnects us...

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 25 16:32:05 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/fb555af36c0f
changeset: 9815:fb555af36c0f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 25 09:31:43 2009 -0400
description:
ldap: Don't log an error when server disconnects us because of idling.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/auth/db-ldap.c |    6 ++++--

diffs (30 lines):

diff -r 830958d044ec -r fb555af36c0f src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Tue Aug 25 09:16:58 2009 -0400
+++ b/src/auth/db-ldap.c	Tue Aug 25 09:31:43 2009 -0400
@@ -610,6 +610,7 @@ static void ldap_input(struct ldap_conne
 {
 	struct timeval timeout;
 	LDAPMessage *res;
+	time_t prev_reply_diff;
 	int ret;
 
 	do {
@@ -631,6 +632,8 @@ static void ldap_input(struct ldap_conne
 		db_ldap_handle_result(conn, res);
 		ldap_msgfree(res);
 	} while (conn->io != NULL);
+
+	prev_reply_diff = ioloop_time - conn->last_reply_stamp;
 	conn->last_reply_stamp = ioloop_time;
 
 	if (ret > 0) {
@@ -644,8 +647,7 @@ static void ldap_input(struct ldap_conne
 		i_error("LDAP: ldap_result() failed: %s", ldap_get_error(conn));
 		ldap_conn_reconnect(conn);
 	} else if (aqueue_count(conn->request_queue) > 0 ||
-		   ioloop_time - conn->last_reply_stamp <
-		   				DB_LDAP_IDLE_RECONNECT_SECS) {
+		   prev_reply_diff < DB_LDAP_IDLE_RECONNECT_SECS) {
 		i_error("LDAP: Connection lost to LDAP server, reconnecting");
 		ldap_conn_reconnect(conn);
 	} else {


More information about the dovecot-cvs mailing list