]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-client-host - Prevent erroneously starting host idle timeout during...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sun, 20 Sep 2020 23:14:20 +0000 (01:14 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 7 Oct 2020 11:58:33 +0000 (14:58 +0300)
During request retry the request is first dropped from and subsequently added to
the queue. Dropping a request from the queue can start the host idle timeout
when it is the very last one. The timeout was not removed later on anymore when
the request was submitted again, because it was added prematurely (before
dropping the request).

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

index 3cbe6b086e555caa9ec784f04153b4bd23de4162..95b10b7a007869c101c357442e2f37c75826ec31 100644 (file)
@@ -443,12 +443,13 @@ void http_client_host_submit_request(struct http_client_host *host,
                }
        }
 
-       http_client_host_shared_request_submitted(host->shared);
-
        /* Add request to queue */
        queue = http_client_queue_get(host, &addr);
        http_client_queue_submit_request(queue, req);
 
+       /* Update shared host object (idle timeout) */
+       http_client_host_shared_request_submitted(host->shared);
+
        /* Queue will trigger host lookup once the request is activated
           (may be delayed) */
 }