diff options
author | Brad King <brad.king@kitware.com> | 2018-08-31 18:44:48 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-08-31 18:45:11 (GMT) |
commit | e16568c2938fdcbf060dc15c1492fa0c98d50d35 (patch) | |
tree | 1cb8a855ec8ab138ed0ce3408f9c1b31625260f8 /Source/cmFileCommand.cxx | |
parent | e48a278cdcafbd40cf01533096859f646a87505b (diff) | |
parent | 31301b46a726e8c95836e885bb8a7f5cc5221c49 (diff) | |
download | CMake-e16568c2938fdcbf060dc15c1492fa0c98d50d35.zip CMake-e16568c2938fdcbf060dc15c1492fa0c98d50d35.tar.gz CMake-e16568c2938fdcbf060dc15c1492fa0c98d50d35.tar.bz2 |
Merge topic 'file-alt-httpauth'
31301b46a7 file: Allow DOWNLOAD/UPLOAD using alternate authentication methods
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2320
Diffstat (limited to 'Source/cmFileCommand.cxx')
-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 795eb37..1c29017 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: "); |