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.
This commit is contained in:
David Cole 2010-07-12 16:48:38 -04:00
parent 87054972a7
commit 46df0b44ac
1 changed files with 5 additions and 4 deletions

View File

@ -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;
}