CTest should resubmit in the checksum failed case

This commit is contained in:
Zach Mullen 2010-06-05 10:36:23 -04:00
parent d6b71078da
commit 86e81b53c1

View File

@ -501,8 +501,22 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
// Now run off and do what you've been told! // Now run off and do what you've been told!
res = ::curl_easy_perform(curl); res = ::curl_easy_perform(curl);
// If we time out or operation is too slow, wait and retry if ( chunk.size() > 0 )
if(res == CURLE_OPERATION_TIMEOUTED) {
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 ? std::string retryTime = this->GetOption("RetryTime") == NULL ?
"" : this->GetOption("RetryTime"); "" : this->GetOption("RetryTime");
@ -532,16 +546,10 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
chunk.clear(); chunk.clear();
chunkDebug.clear(); chunkDebug.clear();
this->HasErrors = false;
res = ::curl_easy_perform(curl); res = ::curl_easy_perform(curl);
if(res != CURLE_OPERATION_TIMEDOUT)
{
break;
}
}
}
if ( chunk.size() > 0 ) if ( chunk.size() > 0 )
{ {
cmCTestLog(this->CTest, DEBUG, "CURL output: [" cmCTestLog(this->CTest, DEBUG, "CURL output: ["
@ -549,11 +557,12 @@ bool cmCTestSubmitHandler::SubmitUsingHTTP(const cmStdString& localprefix,
<< std::endl); << std::endl);
this->ParseResponse(chunk); this->ParseResponse(chunk);
} }
if ( chunkDebug.size() > 0 )
if(res != CURLE_OPERATION_TIMEDOUT && !this->HasErrors)
{ {
cmCTestLog(this->CTest, DEBUG, "CURL debug output: [" break;
<< cmCTestLogWrite(&*chunkDebug.begin(), chunkDebug.size()) << "]" }
<< std::endl); }
} }
fclose(ftpfile); fclose(ftpfile);