diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-02-18 22:52:58 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-02-18 22:52:58 +0100 |
commit | a995ea05b3dd378d9f1e4ff3c40f686bcf3a348e (patch) | |
tree | faaa263e3ad85b8bd437e32d6f560983f4dfebe0 /lib/asyn-thread.c | |
parent | 25e577b33d00afb6630cf2cac98d6baa319e9aef (diff) | |
download | curl-a995ea05b3dd378d9f1e4ff3c40f686bcf3a348e.tar.gz |
resolver_error: remove wrong error message output
The attempt to use gai_strerror() or alternative function didn't work as
the 'sock_error' field didn't contain the proper error code. But since
this hasn't been reported and thus isn't really a big deal I decided to
just scrap the whole attempt to output the detailed resolver error and
instead remain with just stating that the resolving of the name failed.
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r-- | lib/asyn-thread.c | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 34fe74a4c..66fb510f4 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -387,44 +387,6 @@ static bool init_resolve_thread (struct connectdata *conn, return FALSE; } -#if defined(HAVE_GETADDRINFO) && !defined(HAVE_GAI_STRERROR) && !defined(WIN32) -/* NetWare has getaddrinfo but lacks gai_strerror. - Windows has a gai_strerror but it is bad (not thread-safe) and the generic - socket error string function can be used for this pupose. */ -static const char *gai_strerror(int ecode) -{ - switch (ecode) { - case EAI_AGAIN: - return "The name could not be resolved at this time"; - case EAI_BADFLAGS: - return "The flags parameter had an invalid value"; - case EAI_FAIL: - return "A non-recoverable error occurred when attempting to " - "resolve the name"; - case EAI_FAMILY: - return "The address family was not recognized"; - case EAI_MEMORY: - return "Out of memory"; - case EAI_NONAME: - return "The name does not resolve for the supplied parameters"; - case EAI_SERVICE: - return "The service passed was not recognized for the " - "specified socket type" - case EAI_SOCKTYPE: - return "The intended socket type was not recognized" - case EAI_SYSTEM: - return "A system error occurred"; - case EAI_OVERFLOW: - return "An argument buffer overflowed"; - default: - return "Unknown error"; - -/* define this now as this is a private implementation of said function */ -#define HAVE_GAI_STRERROR -} -#endif - - /* * resolver_error() calls failf() with the appropriate message after a resolve * error @@ -443,16 +405,8 @@ static CURLcode resolver_error(struct connectdata *conn) rc = CURLE_COULDNT_RESOLVE_HOST; } - failf(conn->data, "Could not resolve %s: %s; %s", host_or_proxy, - conn->async.hostname, -#ifdef HAVE_GAI_STRERROR - /* NetWare doesn't have gai_strerror and on Windows it isn't deemed - thread-safe */ - gai_strerror(conn->async.status) -#else - Curl_strerror(conn, conn->async.status) -#endif - ); + failf(conn->data, "Could not resolve %s: %s", host_or_proxy, + conn->async.hostname); return rc; } |