diff options
author | Brad King <brad.king@kitware.com> | 2012-09-18 18:53:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-18 18:53:07 (GMT) |
commit | 14aff4daf45a3cf0af59de60a464af9abe6a013c (patch) | |
tree | e0d09670ba285ed58da73ef7235e2f27461598ea /Source | |
parent | 70169ec1bfa5adc4bc99c1777f44c6f8446bba04 (diff) | |
download | CMake-14aff4daf45a3cf0af59de60a464af9abe6a013c.zip CMake-14aff4daf45a3cf0af59de60a464af9abe6a013c.tar.gz CMake-14aff4daf45a3cf0af59de60a464af9abe6a013c.tar.bz2 |
file(DOWNLOAD): Add HTTP User-Agent string
Some servers require a User-Agent string. The curl command-line tool
just sends "curl/$curlver", so do the same.
Suggested-by: Fredrik Ehnbom <fehnbom@nvidia.com>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index bb12980..4ac58a4 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2857,6 +2857,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args) res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); 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, cmWriteToFileCallback); check_curl_result(res, "DOWNLOAD cannot set write function: "); |