From: Timo Sirainen Date: Tue, 9 Jul 2013 23:31:05 +0000 (+0300) Subject: lib-http: Don't assert-crash in case of somewhat unexpected failing connections. X-Git-Tag: 2.2.5~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d2a126f5c19f5e09ba680c4b141bffebc196b31;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Don't assert-crash in case of somewhat unexpected failing connections. --- diff --git a/src/lib-http/http-client-host.c b/src/lib-http/http-client-host.c index 74a220a2bf..36095a8fd8 100644 --- a/src/lib-http/http-client-host.c +++ b/src/lib-http/http-client-host.c @@ -256,9 +256,14 @@ http_client_host_port_connection_failure(struct http_client_host_port *hport, { 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