From: Stephan Bosch Date: Wed, 20 Feb 2013 17:34:51 +0000 (+0200) Subject: lib-http: Fixed hang with failed DNS lookups X-Git-Tag: 2.2.beta2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57e1401ef9cef3c4a7d8a3c19a022ac1842bd009;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Fixed hang with failed DNS lookups --- diff --git a/src/lib-http/http-client-host.c b/src/lib-http/http-client-host.c index 01c31c34d8..f9cba13690 100644 --- a/src/lib-http/http-client-host.c +++ b/src/lib-http/http-client-host.c @@ -289,17 +289,20 @@ void http_client_host_submit_request(struct http_client_host *host, req->host = host; - if (host->ips_count == 0 && host->dns_lookup == NULL) - http_client_host_lookup(host); + /* add request to host (grouped by tcp port) */ hport = http_client_host_port_init(host, req->port, req->ssl); if (req->urgent) array_append(&hport->urgent_request_queue, &req, 1); else array_append(&hport->request_queue, &req, 1); + /* start DNS lookup if necessary */ + if (host->ips_count == 0 && host->dns_lookup == NULL) + http_client_host_lookup(host); + + /* make a connection if we have an IP already */ if (host->ips_count == 0) return; - http_client_host_connection_setup(host, hport); }