From 86e81b53c196bfd29aa7d877d2fb9e71a6392cc1 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Sat, 5 Jun 2010 10:36:23 -0400 Subject: CTest should resubmit in the checksum failed case --- Source/CTest/cmCTestSubmitHandler.cxx | 43 +++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index 9bbb2e6..21c005d 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -501,8 +501,22 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, // Now run off and do what you've been told! res = ::curl_easy_perform(curl); - // If we time out or operation is too slow, wait and retry - if(res == CURLE_OPERATION_TIMEOUTED) + if ( chunk.size() > 0 ) + { + cmCTestLog(this->CTest, DEBUG, "CURL output: [" + << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" + << std::endl); + this->ParseResponse(chunk); + } + if ( chunkDebug.size() > 0 ) + { + cmCTestLog(this->CTest, DEBUG, "CURL debug output: [" + << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" + << std::endl); + } + + // If we time out or checksum fails, wait and retry + if(res == CURLE_OPERATION_TIMEDOUT || this->HasErrors) { std::string retryTime = this->GetOption("RetryTime") == NULL ? "" : this->GetOption("RetryTime"); @@ -532,30 +546,25 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, chunk.clear(); chunkDebug.clear(); + this->HasErrors = false; res = ::curl_easy_perform(curl); - if(res != CURLE_OPERATION_TIMEDOUT) + if ( chunk.size() > 0 ) + { + cmCTestLog(this->CTest, DEBUG, "CURL output: [" + << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" + << std::endl); + this->ParseResponse(chunk); + } + + if(res != CURLE_OPERATION_TIMEDOUT && !this->HasErrors) { break; } } } - if ( chunk.size() > 0 ) - { - cmCTestLog(this->CTest, DEBUG, "CURL output: [" - << cmCTestLogWrite(&*chunk.begin(), chunk.size()) << "]" - << std::endl); - this->ParseResponse(chunk); - } - if ( chunkDebug.size() > 0 ) - { - cmCTestLog(this->CTest, DEBUG, "CURL debug output: [" - << cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" - << std::endl); - } - fclose(ftpfile); if ( res ) { -- cgit v0.12