dovecot-2.2: lib-http: Don't assert-crash in case of somewhat un...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 10 02:31:18 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/843208699cbc
changeset: 16578:843208699cbc
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 10 02:31:05 2013 +0300
description:
lib-http: Don't assert-crash in case of somewhat unexpected failing connections.

diffstat:

 src/lib-http/http-client-host.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (21 lines):

diff -r dee7822501b0 -r 843208699cbc src/lib-http/http-client-host.c
--- a/src/lib-http/http-client-host.c	Wed Jul 10 01:44:40 2013 +0300
+++ b/src/lib-http/http-client-host.c	Wed Jul 10 02:31:05 2013 +0300
@@ -256,9 +256,14 @@
 {
 	struct http_client_host *host = hport->host;
 
-	i_assert(hport->pending_connection_count > 0);
-	if (--hport->pending_connection_count > 0)
-		return TRUE;
+	if (hport->pending_connection_count > 0) {
+		/* we're still doing the initial connections to this hport. if
+		   we're also doing parallel connections with soft timeouts
+		   (pending_connection_count>1), wait for them to finish
+		   first. */
+		if (--hport->pending_connection_count > 0)
+			return TRUE;
+	}
 
 	/* one of the connections failed. if we're not using soft timeouts,
 	   we need to try to connect to the next IP. if we are using soft


More information about the dovecot-cvs mailing list