]> granicus.if.org Git - curl/commitdiff
- Mike Crowe made libcurl return CURLE_COULDNT_RESOLVE_PROXY when it is the
authorDaniel Stenberg <daniel@haxx.se>
Tue, 26 Jan 2010 22:59:43 +0000 (22:59 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 26 Jan 2010 22:59:43 +0000 (22:59 +0000)
  proxy that cannot be resolved when using c-ares. This matches the behaviour
  when not using c-ares.

CHANGES
RELEASE-NOTES
lib/hostares.c

diff --git a/CHANGES b/CHANGES
index fee8bc2fd1a1672d47d655f8aa7d901ff8912093..d8f5c0e41556f840c83b87bf68802e3c4bc31827 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,11 @@
 
                                   Changelog
 
+Daniel Stenberg (26 Jan 2010)
+- Mike Crowe made libcurl return CURLE_COULDNT_RESOLVE_PROXY when it is the
+  proxy that cannot be resolved when using c-ares. This matches the behaviour
+  when not using c-ares.
+
 Björn Stenberg (23 Jan 2010)
 - Added a new flag: -J/--remote-header-name. This option tells the
   -O/--remote-name option to use the server-specified Content-Disposition
index bf2c5d4c7fc10e50e5d6849e105eddcb2d07e168..5b2c339b19a2945d6d6da3d1668c15e7f2b69af6 100644 (file)
@@ -63,6 +63,6 @@ advice from friends like these:
  Markus Koetter, Chad Monroe, Martin Storsjo, Siegfried Gyuricsko,
  Jon Nelson, Julien Chaffraix, Renato Botelho, Peter Pentchev, Ingmar Runge,
  Johan van Selst, Charles Kerr, Gil Weber, David McCreedy, Chris Conroy,
- Björn Stenberg
+ Bjorn Stenberg, Mike Crowe
 
         Thanks! (and sorry if I forgot to mention someone)
index a7f1d1bd249580ee71f1f0d21781438a1f812a49..2d77a11ca2d1181cf413ad0e3c5acab9cdbc3f7d 100644 (file)
@@ -285,13 +285,26 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
   if(!conn->async.dns) {
     /* a name was not resolved */
     if((timeout < 0) || (conn->async.status == ARES_ETIMEOUT)) {
-      failf(data, "Resolving host timed out: %s", conn->host.dispname);
-      rc = CURLE_COULDNT_RESOLVE_HOST;
+      if (conn->bits.httpproxy) {
+        failf(data, "Resolving proxy timed out: %s", conn->proxy.dispname);
+        rc = CURLE_COULDNT_RESOLVE_PROXY;
+      }
+      else {
+        failf(data, "Resolving host timed out: %s", conn->host.dispname);
+        rc = CURLE_COULDNT_RESOLVE_HOST;
+      }
     }
     else if(conn->async.done) {
-      failf(data, "Could not resolve host: %s (%s)", conn->host.dispname,
-            ares_strerror(conn->async.status));
-      rc = CURLE_COULDNT_RESOLVE_HOST;
+      if (conn->bits.httpproxy) {
+        failf(data, "Could not resolve proxy: %s (%s)", conn->proxy.dispname,
+              ares_strerror(conn->async.status));
+        rc = CURLE_COULDNT_RESOLVE_PROXY;
+      }
+      else {
+        failf(data, "Could not resolve host: %s (%s)", conn->host.dispname,
+              ares_strerror(conn->async.status));
+        rc = CURLE_COULDNT_RESOLVE_HOST;
+      }
     }
     else
       rc = CURLE_OPERATION_TIMEDOUT;
@@ -318,7 +331,7 @@ static void ares_query_completed_cb(void *arg,  /* (struct connectdata *) */
 {
   struct connectdata *conn = (struct connectdata *)arg;
   struct Curl_addrinfo * ai = NULL;
-    
+
 #ifdef HAVE_CARES_CALLBACK_TIMEOUTS
   (void)timeouts; /* ignored */
 #endif
@@ -326,7 +339,7 @@ static void ares_query_completed_cb(void *arg,  /* (struct connectdata *) */
   if (status == CURL_ASYNC_SUCCESS) {
     ai = Curl_he2ai(hostent, conn->async.port);
   }
+
   (void)Curl_addrinfo_callback(arg, status, ai);
 }