]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-connection - Deal with first idle connection separately for...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 12 Aug 2020 20:20:26 +0000 (22:20 +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 fd59b7eec558ef74c3e8bbb2f9ba5aeda622bdce..44e7fb4a99ddfa637da5fd7d92ee342f969ef5fe 100644 (file)
@@ -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 {