From: Stephan Bosch Date: Sun, 12 Oct 2014 15:58:40 +0000 (-0700) Subject: lib-http: client: With the recent addition of a connection attempt limit, connection... X-Git-Tag: 2.2.14~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=501d0f9aa4e892c47dfe369774ef3c8961f753d2;p=thirdparty%2Fdovecot%2Fcore.git lib-http: client: With the recent addition of a connection attempt limit, connection failures weren't always handled correctly. --- diff --git a/src/lib-http/http-client-queue.c b/src/lib-http/http-client-queue.c index b9a7b64dff..1137f28448 100644 --- a/src/lib-http/http-client-queue.c +++ b/src/lib-http/http-client-queue.c @@ -172,9 +172,9 @@ http_client_queue_is_last_connect_ip(struct http_client_queue *queue) i_assert(queue->ips_connect_start_idx < host->ips_count); /* if a maximum connect attempts > 1 is set, enforce it directly */ - if (set->max_connect_attempts > 1) { - return queue->connect_attempts >= set->max_connect_attempts; - } + if (set->max_connect_attempts > 1 && + queue->connect_attempts >= set->max_connect_attempts) + return TRUE; /* otherwise, we'll always go through all the IPs. we don't necessarily start connecting from the first IP, so we'll need to treat the IPs as