diff options
author | Clinton Stimpson <clinton@elemtech.com> | 2018-08-28 16:37:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-08-30 14:38:28 (GMT) |
commit | 31301b46a726e8c95836e885bb8a7f5cc5221c49 (patch) | |
tree | e03449cf403abe0063a3962c04a3e248029a3f8b /Source | |
parent | c549deed7fc6dec2c3f5f3ab5f9ded1acb916239 (diff) | |
download | CMake-31301b46a726e8c95836e885bb8a7f5cc5221c49.zip CMake-31301b46a726e8c95836e885bb8a7f5cc5221c49.tar.gz CMake-31301b46a726e8c95836e885bb8a7f5cc5221c49.tar.bz2 |
file: Allow DOWNLOAD/UPLOAD using alternate authentication methods
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 0c80319..d49e490 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2886,6 +2886,10 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args) ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); check_curl_result(res, "DOWNLOAD cannot set url: "); + // enable auth + res = ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + check_curl_result(res, "DOWNLOAD cannot set httpauth: "); + // enable HTTP ERROR parsing res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); check_curl_result(res, "DOWNLOAD cannot set http failure option: "); @@ -3185,6 +3189,10 @@ bool cmFileCommand::HandleUploadCommand(std::vector<std::string> const& args) res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); check_curl_result(res, "UPLOAD cannot set url: "); + // enable auth + res = ::curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); + check_curl_result(res, "UPLOAD cannot set httpauth: "); + res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToMemoryCallback); check_curl_result(res, "UPLOAD cannot set write function: "); |