changeset 20765:7ce2585c47e2

login-proxy: Fixed "Host is down" never reseting itself. Broken by c8eb8314a, which moved adding num_waiting_connections earlier. After that it was never 0 at the check time.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Wed, 21 Sep 2016 20:50:24 +0300
parents 5dff2ce2a895
children 271015c91be5
files src/login-common/login-proxy.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/login-common/login-proxy.c	Wed Sep 21 16:17:26 2016 +0300
+++ b/src/login-common/login-proxy.c	Wed Sep 21 20:50:24 2016 +0300
@@ -392,7 +392,7 @@
 	}
 	if (timeval_cmp(&rec->last_failure, &rec->last_success) > 0 &&
 	    rec->last_failure.tv_sec - rec->last_success.tv_sec > PROXY_IMMEDIATE_FAILURE_SECS &&
-	    rec->num_waiting_connections != 0) {
+	    rec->num_waiting_connections > 1) {
 		/* the server is down. fail immediately */
 		client_log_err(proxy->client, t_strdup_printf(
 			"proxy(%s): Host %s:%u is down",