]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: Fix for builds that disable all asynchronous DNS
authorJay Satiro <raysatiro@yahoo.com>
Thu, 1 Apr 2021 19:15:01 +0000 (15:15 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 2 Apr 2021 06:38:43 +0000 (02:38 -0400)
- 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

lib/hostip.c

index 750afe8a9763cd675cdb48bb6f1e200690cdbbb4..34fb7db65e42bf314361efc23a4b5a65a20bd54a 100644 (file)
@@ -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 */