From 7e849b84ac70e86caa5cb0edb8589444fbeab5b8 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Wed, 12 Aug 2020 22:24:22 +0200 Subject: [PATCH] lib-http: http-client-connection - Explicitly handle an infinite connection limit for setting idle timeout. This can just use the maximum idle timeout directly. --- src/lib-http/http-client-connection.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib-http/http-client-connection.c b/src/lib-http/http-client-connection.c index 44e7fb4a99..1a51049546 100644 --- a/src/lib-http/http-client-connection.c +++ b/src/lib-http/http-client-connection.c @@ -444,8 +444,9 @@ http_client_connection_start_idle_timeout(struct http_client_connection *conn) i_assert(max > 0); /* Set timeout for this connection */ - if (idle_count == 0) { - /* No idle connections yet; use the maximum idle time. */ + if (idle_count == 0 || max == UINT_MAX) { + /* No idle connections yet or infinite connections allowed; + 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 */ -- 2.47.3