瀏覽代碼

Merge topic 'file-DOWNLOAD-user-agent'

14aff4d file(DOWNLOAD): Add HTTP User-Agent string
Brad King 13 年之前
父節點
當前提交
03077c9cbc
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Source/cmFileCommand.cxx

+ 3 - 0
Source/cmFileCommand.cxx

@@ -2855,6 +2855,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
   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: ");
 
 
+  res = ::curl_easy_setopt(curl, CURLOPT_USERAGENT, "curl/" LIBCURL_VERSION);
+  check_curl_result(res, "DOWNLOAD cannot set user agent option: ");
+
   res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
   res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,
                            cmWriteToFileCallback);
                            cmWriteToFileCallback);
   check_curl_result(res, "DOWNLOAD cannot set write function: ");
   check_curl_result(res, "DOWNLOAD cannot set write function: ");