From: Stephan Bosch Date: Wed, 12 Aug 2020 20:20:26 +0000 (+0200) Subject: lib-http: http-client-connection - Deal with first idle connection separately for... X-Git-Tag: 2.3.13~270 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=32f0fc2b41fe6dc403338139b1a6d4df9e141bc1;p=thirdparty%2Fdovecot%2Fcore.git lib-http: http-client-connection - Deal with first idle connection separately for setting idle timeout. This can just use the maximum idle timeout directly. --- diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index fd59b7eec5..44e7fb4a99 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -444,7 +444,10 @@ http_client_connection_start_idle_timeout(struct http_client_connection *conn) i_assert(max > 0); /* Set timeout for this connection */ - if (count > max || idle_count >= max) { + if (idle_count == 0) { + /* No idle connections yet; use the maximum idle time. */ + timeout = set->max_idle_time_msecs; + } else if (count > max || idle_count >= max) { /* Instant death for (urgent) connections above limit */ timeout = 0; } else {