From 46df0b44ac97859ab40dd0aa03ceca297a455587 Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 12 Jul 2010 16:48:38 -0400 Subject: Activate retry code on any curl submit failure. Previously, we were only going into the retry block for time out conditions. But a "could not connect" response, or really any sort of curl failure, is also a condition where we should retry the submit if the user has requested a retry. --- Source/CTest/cmCTestSubmitHandler.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/CTest/cmCTestSubmitHandler.cxx b/Source/CTest/cmCTestSubmitHandler.cxx index bfe515d..1e18259 100644 --- a/Source/CTest/cmCTestSubmitHandler.cxx +++ b/Source/CTest/cmCTestSubmitHandler.cxx @@ -536,8 +536,9 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, << std::endl); } - // If we time out or checksum fails, wait and retry - if(res == CURLE_OPERATION_TIMEDOUT || this->HasErrors) + // If curl failed for any reason, or checksum fails, wait and retry + // + if(res != CURLE_OK || this->HasErrors) { std::string retryDelay = this->GetOption("RetryDelay") == NULL ? "" : this->GetOption("RetryDelay"); @@ -552,7 +553,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, for(int i = 0; i < count; i++) { cmCTestLog(this->CTest, HANDLER_OUTPUT, - " Connection timed out, waiting " << delay << " seconds...\n"); + " Submit failed, waiting " << delay << " seconds...\n"); double stop = cmSystemTools::GetTime() + delay; while(cmSystemTools::GetTime() < stop) @@ -582,7 +583,7 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix, this->ParseResponse(chunk); } - if(res != CURLE_OPERATION_TIMEDOUT && !this->HasErrors) + if(res == CURLE_OK && !this->HasErrors) { break; } -- cgit v0.12