]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Dirk Manske fixed the ares usage even more. We could get a timeout from ares
authorDaniel Stenberg <daniel@haxx.se>
Mon, 2 Feb 2004 15:53:50 +0000 (15:53 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 2 Feb 2004 15:53:50 +0000 (15:53 +0000)
as well, and when failing and not getting a timeout we now include the
error message ares can provide us with.

lib/hostip.c

index 2a709560ced171c3946916ccd9958b8e7693bb54..015825c9289226f5ca97e9bfba6323bb8e64ebb2 100644 (file)
@@ -534,12 +534,14 @@ CURLcode Curl_wait_for_resolv(struct connectdata *conn,
 
   if(!conn->async.dns) {
     /* a name was not resolved */
-    if(timedout) {
+    if(timedout || (conn->async.status == ARES_ETIMEOUT)) {
       failf(data, "Resolving host timed out: %s", conn->name);
       rc = CURLE_OPERATION_TIMEDOUT;
     }
     else if(conn->async.done) {
-      failf(data, "Could not resolve host: %s", conn->name);
+      char **dummy=NULL; /* stupid never-used ares-thing */
+      failf(data, "Could not resolve host: %s (%s)", conn->name,
+            ares_strerror(conn->async.status, dummy));
       rc = CURLE_COULDNT_RESOLVE_HOST;
     }
     else