]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-connection - Explicitly handle an infinite connection limit...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 12 Aug 2020 20:24:22 +0000 (22:24 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 27 Aug 2020 09:36:36 +0000 (11:36 +0200)
This can just use the maximum idle timeout directly.

src/lib-http/http-client-connection.c

index 44e7fb4a99ddfa637da5fd7d92ee342f969ef5fe..1a510495460f06f98183ba18b5e0bd4aa23355ec 100644 (file)
@@ -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 */