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

dovecot at dovecot.org dovecot at dovecot.org
Tue Aug 25 16:30:42 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/01804b4971dd
changeset: 8346:01804b4971dd
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Aug 25 09:30:11 2009 -0400
description:
ldap: Don't log an error when server disconnects us because of idling.

diffstat:

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

diffs (29 lines):

diff -r f7fce2f2175f -r 01804b4971dd src/auth/db-ldap.c
--- a/src/auth/db-ldap.c	Tue Aug 25 09:08:11 2009 -0400
+++ b/src/auth/db-ldap.c	Tue Aug 25 09:30:11 2009 -0400
@@ -571,6 +571,7 @@ static void ldap_input(struct ldap_conne
 {
 	struct timeval timeout;
 	LDAPMessage *res;
+	time_t prev_reply_diff;
 	int ret;
 
 	for (;;) {
@@ -592,6 +593,7 @@ static void ldap_input(struct ldap_conne
 		db_ldap_handle_result(conn, res);
 		ldap_msgfree(res);
 	}
+	prev_reply_diff = ioloop_time - conn->last_reply_stamp;
 	conn->last_reply_stamp = ioloop_time;
 
 	if (ret == 0) {
@@ -602,8 +604,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