]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
MiniCurl: Stop using the deprecated CURLOPT_PROTOCOLS on curl 7.85+ 12478/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Jan 2023 10:49:35 +0000 (11:49 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 26 Jan 2023 10:49:35 +0000 (11:49 +0100)
pdns/minicurl.cc

index 2a39e6aca857db6892ce11546618b5bbac91c029..8ef955ff89d16e646989f9a82e96f4701d685ec6 100644 (file)
@@ -161,7 +161,11 @@ void MiniCurl::setupURL(const std::string& str, const ComboAddress* rem, const C
   }
   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)
+  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);