diff options
Diffstat (limited to 'Source/CTest/cmCTestCurl.cxx')
-rw-r--r-- | Source/CTest/cmCTestCurl.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/CTest/cmCTestCurl.cxx b/Source/CTest/cmCTestCurl.cxx index b175d44..022afd2 100644 --- a/Source/CTest/cmCTestCurl.cxx +++ b/Source/CTest/cmCTestCurl.cxx @@ -61,12 +61,11 @@ size_t curlDebugCallback(CURL* /*unused*/, curl_infotype /*unused*/, void cmCTestCurl::SetCurlOptions(std::vector<std::string> const& args) { - for (std::vector<std::string>::const_iterator i = args.begin(); - i != args.end(); ++i) { - if (*i == "CURLOPT_SSL_VERIFYPEER_OFF") { + for (std::string const& arg : args) { + if (arg == "CURLOPT_SSL_VERIFYPEER_OFF") { this->VerifyPeerOff = true; } - if (*i == "CURLOPT_SSL_VERIFYHOST_OFF") { + if (arg == "CURLOPT_SSL_VERIFYHOST_OFF") { this->VerifyHostOff = true; } } @@ -146,12 +145,11 @@ bool cmCTestCurl::UploadFile(std::string const& local_file, struct curl_slist* headers = ::curl_slist_append(nullptr, "Content-Type: text/xml"); // Add any additional headers that the user specified. - for (std::vector<std::string>::const_iterator h = this->HttpHeaders.begin(); - h != this->HttpHeaders.end(); ++h) { + for (std::string const& h : this->HttpHeaders) { cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Add HTTP Header: \"" << *h << "\"" << std::endl, + " Add HTTP Header: \"" << h << "\"" << std::endl, this->Quiet); - headers = ::curl_slist_append(headers, h->c_str()); + headers = ::curl_slist_append(headers, h.c_str()); } ::curl_easy_setopt(this->Curl, CURLOPT_HTTPHEADER, headers); std::vector<char> responseData; @@ -213,13 +211,11 @@ bool cmCTestCurl::HttpRequest(std::string const& url, // Add headers if any were specified. struct curl_slist* headers = nullptr; if (!this->HttpHeaders.empty()) { - for (std::vector<std::string>::const_iterator h = - this->HttpHeaders.begin(); - h != this->HttpHeaders.end(); ++h) { + for (std::string const& h : this->HttpHeaders) { cmCTestOptionalLog(this->CTest, HANDLER_OUTPUT, - " Add HTTP Header: \"" << *h << "\"" << std::endl, + " Add HTTP Header: \"" << h << "\"" << std::endl, this->Quiet); - headers = ::curl_slist_append(headers, h->c_str()); + headers = ::curl_slist_append(headers, h.c_str()); } } |