mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 16:32:14 -06:00
cmCurlSetCAInfo: use std::string as argument
This commit is contained in:
@@ -31,11 +31,11 @@
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile)
|
||||
std::string cmCurlSetCAInfo(::CURL* curl, const std::string& cafile)
|
||||
{
|
||||
std::string e;
|
||||
if (cafile && *cafile) {
|
||||
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile);
|
||||
if (!cafile.empty()) {
|
||||
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
|
||||
check_curl_result(res, "Unable to set TLS/SSL Verify CAINFO: ");
|
||||
}
|
||||
#ifdef CMAKE_FIND_CAFILE
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <cm3p/curl/curl.h>
|
||||
|
||||
std::string cmCurlSetCAInfo(::CURL* curl, const char* cafile = nullptr);
|
||||
std::string cmCurlSetCAInfo(::CURL* curl, const std::string& cafile = {});
|
||||
std::string cmCurlSetNETRCOption(::CURL* curl, const std::string& netrc_level,
|
||||
const std::string& netrc_file);
|
||||
std::string cmCurlFixFileURL(std::string url);
|
||||
|
||||
@@ -1986,7 +1986,7 @@ bool HandleDownloadCommand(std::vector<std::string> const& args,
|
||||
|
||||
// check to see if a CAINFO file has been specified
|
||||
// command arg comes first
|
||||
std::string const& cainfo_err = cmCurlSetCAInfo(curl, cmToCStr(cainfo));
|
||||
std::string const& cainfo_err = cmCurlSetCAInfo(curl, cainfo);
|
||||
if (!cainfo_err.empty()) {
|
||||
status.SetError(cainfo_err);
|
||||
return false;
|
||||
@@ -2304,7 +2304,7 @@ bool HandleUploadCommand(std::vector<std::string> const& args,
|
||||
|
||||
// check to see if a CAINFO file has been specified
|
||||
// command arg comes first
|
||||
std::string const& cainfo_err = cmCurlSetCAInfo(curl, cmToCStr(cainfo));
|
||||
std::string const& cainfo_err = cmCurlSetCAInfo(curl, cainfo);
|
||||
if (!cainfo_err.empty()) {
|
||||
status.SetError(cainfo_err);
|
||||
return false;
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
file Copyright.txt or https://cmake.org/licensing for details. */
|
||||
#include "cmGetPropertyCommand.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "cmExecutionStatus.h"
|
||||
#include "cmGlobalGenerator.h"
|
||||
#include "cmInstalledFile.h"
|
||||
|
||||
Reference in New Issue
Block a user