diff options
author | David Cole <david.cole@kitware.com> | 2011-09-20 18:42:26 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-09-20 18:42:26 (GMT) |
commit | 47dac7ec977979029ff9b076f868753b84132084 (patch) | |
tree | f5e47b9b181748acfed9074157d4aaaa72a846d6 /Source | |
parent | d622088b2b55da24c76361712fad746c911617f1 (diff) | |
parent | 09817e91f9bb03353c49f3c8aa6cb7ad9789fcc7 (diff) | |
download | CMake-47dac7ec977979029ff9b076f868753b84132084.zip CMake-47dac7ec977979029ff9b076f868753b84132084.tar.gz CMake-47dac7ec977979029ff9b076f868753b84132084.tar.bz2 |
Merge topic 'file-download-http-error'
09817e9 Make file(DOWNLOAD) fail on http error
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFileCommand.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 3b63906..f933666 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2753,6 +2753,10 @@ 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 HTTP ERROR parsing + res = ::curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1); + check_curl_result(res, "DOWNLOAD cannot set http failure option: "); + res = ::curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, cmWriteToFileCallback); check_curl_result(res, "DOWNLOAD cannot set write function: "); |