From: Jay Satiro Date: Thu, 1 Apr 2021 19:15:01 +0000 (-0400) Subject: hostip: Fix for builds that disable all asynchronous DNS X-Git-Tag: curl-7_76_1~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3085ccfae996bb0fa606d2c7bc6783dc15d76a30;p=thirdparty%2Fcurl.git hostip: Fix for builds that disable all asynchronous DNS - Define Curl_resolver_error function only when USE_CURL_ASYNC. Prior to this change building curl without an asynchronous resolver backend (c-ares or threaded) and without DoH (DNS-over-HTTPS, which is also asynchronous but independent of resolver backend) would cause a build error since Curl_resolver_error is called by and evaluates variables only available in asynchronous builds. Reported-by: Benbuck Nason Fixes https://github.com/curl/curl/issues/6831 Closes https://github.com/curl/curl/pull/6832 --- diff --git a/lib/hostip.c b/lib/hostip.c index 750afe8a97..34fb7db65e 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -1130,6 +1130,7 @@ CURLcode Curl_once_resolved(struct Curl_easy *data, bool *protocol_done) * resolve error */ +#ifdef USE_CURL_ASYNC CURLcode Curl_resolver_error(struct Curl_easy *data) { const char *host_or_proxy; @@ -1153,3 +1154,4 @@ CURLcode Curl_resolver_error(struct Curl_easy *data) return result; } +#endif /* USE_CURL_ASYNC */