Преглед на файлове

file: Allow DOWNLOAD/UPLOAD using alternate authentication methods

Clinton Stimpson преди 7 години
родител
ревизия
31301b46a7
променени са 1 файла, в които са добавени 8 реда и са изтрити 0 реда
  1. 8 0
      Source/cmFileCommand.cxx

+ 8 - 0
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());
   ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
   check_curl_result(res, "DOWNLOAD cannot set url: ");
   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
   // enable HTTP ERROR parsing
   res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
   res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
   check_curl_result(res, "DOWNLOAD cannot set http failure option: ");
   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());
   res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
   check_curl_result(res, "UPLOAD cannot set url: ");
   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 =
   res =
     ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToMemoryCallback);
     ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToMemoryCallback);
   check_curl_result(res, "UPLOAD cannot set write function: ");
   check_curl_result(res, "UPLOAD cannot set write function: ");