From 1153d3d05c2129f50b5e4a81d1f021986a2a19d0 Mon Sep 17 00:00:00 2001
From: Micah Cowan <micah@cowan.name>
Date: Tue, 2 Oct 2007 22:12:04 -0700
Subject: [PATCH] Warn about host resolution failure.

---
 src/ChangeLog | 6 ++++++
 src/connect.c | 7 ++++++-
 src/http.c    | 3 +++
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index b53f4260..c6fc6564 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,6 +5,12 @@
 	potentially long-running sessions. Based on suggestions by Saso
 	Tomat <miskox@hotmail.com> and Steven M. Schweda
 	<sms@antinode.org>.
+	* http.c (gethttp): Warn about host lookup failures. Adjusted
+	from Stephen Gildea's patch.
+
+2007-10-02  Stephen Gildea  <stepheng+wget@gildea.com>
+
+	* connect.c (connect_to_host): Warn about host lookup failures.
 
 2007-09-25  Micah Cowan  <micah@cowan.name>
 
diff --git a/src/connect.c b/src/connect.c
index 5e7ccee6..6664c0af 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -362,7 +362,12 @@ connect_to_host (const char *host, int port)
 
  retry:
   if (!al)
-    return E_HOST;
+    {
+      logprintf (LOG_NOTQUIET,
+                 _("%s: unable to resolve host address `%s'\n"),
+                 exec_name, host);
+      return E_HOST;
+    }
 
   address_list_get_bounds (al, &start, &end);
   for (i = start; i < end; i++)
diff --git a/src/http.c b/src/http.c
index e2cee589..853132dc 100644
--- a/src/http.c
+++ b/src/http.c
@@ -1632,6 +1632,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy)
       if (host_lookup_failed)
         {
           request_free (req);
+          logprintf(LOG_NOTQUIET,
+                    _("%s: unable to resolve host address `%s'\n"),
+                    exec_name, relevant->host);
           return HOSTERR;
         }