From: Stephan Bosch Date: Fri, 6 Jul 2018 13:07:32 +0000 (+0200) Subject: lib-http: client: Notify host object about submission of request before submitting... X-Git-Tag: 2.3.5~341 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6465c3d90ffdbd66f5eef0964dac77073585c561;p=thirdparty%2Fdovecot%2Fcore.git lib-http: client: Notify host object about submission of request before submitting the request to the queue. This makes sure the host idle timeout is stopped before the request is submitted and the host object's refresh function is called. If the idle timeout is still running at that point, the refresh function will return success without performing a lookup, which can lead to a panic. Panic was: Panic: file ./http-client-private.h: line 672 (http_client_host_get_ip): assertion failed: (idx < host->shared->ips_count) --- diff --git a/src/lib-http/http-client-host.c b/src/lib-http/http-client-host.c index 1d2d5ac81a..3fc7cd51cb 100644 --- a/src/lib-http/http-client-host.c +++ b/src/lib-http/http-client-host.c @@ -426,12 +426,12 @@ 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); - http_client_host_shared_request_submitted(host->shared); - /* queue will trigger host lookup once the request is activated (may be delayed) */ }