diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-02-18 13:14:55 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-02-18 15:02:17 +0100 |
commit | 692faeab9f07c23feddc4814e16a138a30cbab06 (patch) | |
tree | 0faaf769335ed1ed3c9aca7803c784401d96aefd /lib/asyn-thread.c | |
parent | 7db6bc5ecaef321f32639149ba3737b1c8393b9c (diff) | |
download | curl-692faeab9f07c23feddc4814e16a138a30cbab06.tar.gz |
asyn-ares: use consistent resolve error message
... with the help of Curl_resolver_error() which now is moved from
asyn-thead.c and is provided globally for this purpose.
Follow-up to 35ca04ce1b77636
Makes test 1188 work for c-ares builds
Closes #6626
Diffstat (limited to 'lib/asyn-thread.c')
-rw-r--r-- | lib/asyn-thread.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c index 3fb771ab8..c453203f7 100644 --- a/lib/asyn-thread.c +++ b/lib/asyn-thread.c @@ -484,35 +484,6 @@ static bool init_resolve_thread(struct Curl_easy *data, } /* - * resolver_error() calls failf() with the appropriate message after a resolve - * error - */ - -static CURLcode resolver_error(struct Curl_easy *data) -{ - const char *host_or_proxy; - CURLcode result; - -#ifndef CURL_DISABLE_PROXY - struct connectdata *conn = data->conn; - if(conn->bits.httpproxy) { - host_or_proxy = "proxy"; - result = CURLE_COULDNT_RESOLVE_PROXY; - } - else -#endif - { - host_or_proxy = "host"; - result = CURLE_COULDNT_RESOLVE_HOST; - } - - failf(data, "Could not resolve %s: %s", host_or_proxy, - data->state.async.hostname); - - return result; -} - -/* * 'entry' may be NULL and then no data is returned */ static CURLcode thread_wait_resolv(struct Curl_easy *data, @@ -542,7 +513,7 @@ static CURLcode thread_wait_resolv(struct Curl_easy *data, if(!data->state.async.dns && report) /* a name was not resolved, report error */ - result = resolver_error(data); + result = Curl_resolver_error(data); destroy_async_data(&data->state.async); @@ -616,7 +587,7 @@ CURLcode Curl_resolver_is_resolved(struct Curl_easy *data, getaddrinfo_complete(data); if(!data->state.async.dns) { - CURLcode result = resolver_error(data); + CURLcode result = Curl_resolver_error(data); destroy_async_data(&data->state.async); return result; } |