dovecot-2.2: lib-http: Fixed hang with failed DNS lookups

dovecot at dovecot.org dovecot at dovecot.org
Wed Feb 20 19:35:09 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/fe24e69ea0c5
changeset: 15865:fe24e69ea0c5
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Wed Feb 20 19:34:51 2013 +0200
description:
lib-http: Fixed hang with failed DNS lookups

diffstat:

 src/lib-http/http-client-host.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f703e1fd7c21 -r fe24e69ea0c5 src/lib-http/http-client-host.c
--- a/src/lib-http/http-client-host.c	Wed Feb 20 16:49:14 2013 +0200
+++ b/src/lib-http/http-client-host.c	Wed Feb 20 19:34:51 2013 +0200
@@ -289,17 +289,20 @@
 
 	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);
 }
 


More information about the dovecot-cvs mailing list