From: Stephan Bosch Date: Sun, 20 Sep 2020 23:14:20 +0000 (+0200) Subject: lib-http: http-client-host - Prevent erroneously starting host idle timeout during... X-Git-Tag: 2.3.13~128 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ac4173fa382f4493948794feb7335288f221d665;p=thirdparty%2Fdovecot%2Fcore.git lib-http: http-client-host - Prevent erroneously starting host idle timeout during request retry. 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). --- diff --git a/src/lib-http/http-client-host.c b/src/lib-http/http-client-host.c index 3cbe6b086e..95b10b7a00 100644 --- a/src/lib-http/http-client-host.c +++ b/src/lib-http/http-client-host.c @@ -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) */ }