From 8f8d24280f34e5709b76b91462cc13b799dc51d1 Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Mon, 7 Oct 2024 16:28:25 -0700 Subject: [PATCH] Fixed warning for an unused function in curl.cpp when building the SDK using a version of libcurl older than 7.77.0 (#6073) --- sdk/core/azure-core/CHANGELOG.md | 2 ++ sdk/core/azure-core/src/http/curl/curl.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sdk/core/azure-core/CHANGELOG.md b/sdk/core/azure-core/CHANGELOG.md index bec4be91e..577fa9d78 100644 --- a/sdk/core/azure-core/CHANGELOG.md +++ b/sdk/core/azure-core/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed warning for an unused function in curl.cpp when building the SDK using a version of libcurl older than 7.77.0. + ### Other Changes ## 1.14.0 (2024-10-03) diff --git a/sdk/core/azure-core/src/http/curl/curl.cpp b/sdk/core/azure-core/src/http/curl/curl.cpp index 176e61247..c11123174 100644 --- a/sdk/core/azure-core/src/http/curl/curl.cpp +++ b/sdk/core/azure-core/src/http/curl/curl.cpp @@ -275,6 +275,9 @@ static void CleanupThread() } } +// This function is only used when ExpectedTlsRootCertificate transport options is set to non empty. +// And that capability only impacts the curl transport behavior in versions of libcurl >= 7.77.0. +#if LIBCURL_VERSION_NUM >= 0x074D00 // 7.77.0 std::string PemEncodeFromBase64(std::string const& base64, std::string const& pemType) { std::stringstream rv; @@ -293,6 +296,7 @@ std::string PemEncodeFromBase64(std::string const& base64, std::string const& pe rv << encodedValue << std::endl << "-----END " << pemType << "-----" << std::endl; return rv.str(); } +#endif Azure::Core::Http::CurlTransportOptions CurlTransportOptionsFromTransportOptions( Azure::Core::Http::Policies::TransportOptions const& transportOptions)