From 3085ccfae996bb0fa606d2c7bc6783dc15d76a30 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Thu, 1 Apr 2021 15:15:01 -0400 Subject: [PATCH] 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 --- lib/hostip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/hostip.c b/lib/hostip.c index 750afe8a9..34fb7db65 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 */