]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
MiniCurl: Fix building on versions older than 7.43.0 12482/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jan 2023 13:47:31 +0000 (14:47 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jan 2023 13:47:31 +0000 (14:47 +0100)
pdns/minicurl.cc

index 8ef955ff89d16e646989f9a82e96f4701d685ec6..d37cd9e555bbf74007dbe9356ebd626264865c0b 100644 (file)
@@ -160,12 +160,14 @@ void MiniCurl::setupURL(const std::string& str, const ComboAddress* rem, const C
     curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_INTERFACE, src->toString().c_str());
   }
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_FOLLOWLOCATION, true);
+
   /* only allow HTTP and HTTPS */
-#if defined(CURL_AT_LEAST_VERSION) && CURL_AT_LEAST_VERSION(7, 85, 0)
+#if defined(LIBCURL_VERSION_NUM) && LIBCURL_VERSION_NUM >= 0x075500 // 7.85.0
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_PROTOCOLS_STR, "http,https");
 #else
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
 #endif
+
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_SSL_VERIFYPEER, verify);
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_SSL_VERIFYHOST, verify ? 2 : 0);
   curl_easy_setopt(getCURLPtr(d_curl), CURLOPT_FAILONERROR, true);