dovecot-2.2: login-proxy: Don't crash if connect() succeeds but ...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 14 14:00:31 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/cda830ebf6ee
changeset: 16344:cda830ebf6ee
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 14 14:00:21 2013 +0300
description:
login-proxy: Don't crash if connect() succeeds but login fails with timeout.

diffstat:

 src/login-common/login-proxy-state.h |  3 ++-
 src/login-common/login-proxy.c       |  3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 8d7d2564dbc9 -r cda830ebf6ee src/login-common/login-proxy-state.h
--- a/src/login-common/login-proxy-state.h	Mon May 13 23:06:31 2013 +0200
+++ b/src/login-common/login-proxy-state.h	Tue May 14 14:00:21 2013 +0300
@@ -6,8 +6,9 @@
 struct login_proxy_record {
 	struct ip_addr ip;
 	unsigned int port;
+
+	/* these are tracking connect()s, not necessarily logins: */
 	unsigned int num_waiting_connections;
-
 	struct timeval last_failure;
 	struct timeval last_success;
 };
diff -r 8d7d2564dbc9 -r cda830ebf6ee src/login-common/login-proxy.c
--- a/src/login-common/login-proxy.c	Mon May 13 23:06:31 2013 +0200
+++ b/src/login-common/login-proxy.c	Tue May 14 14:00:21 2013 +0300
@@ -254,7 +254,8 @@
 {
 	errno = ETIMEDOUT;
 	proxy_log_connect_error(proxy);
-	proxy_fail_connect(proxy);
+	if (!proxy->connected)
+		proxy_fail_connect(proxy);
 	login_proxy_free(&proxy);
 }
 


More information about the dovecot-cvs mailing list