Add an AITimer to AICurlEasyRequestStateMachine.

Fixes AIStateMachine to work thread-safe with the timer.
This commit is contained in:
Aleric Inglewood
2012-07-10 05:09:08 +02:00
parent f012f664d2
commit 0419f8bee9
7 changed files with 115 additions and 41 deletions

View File

@@ -325,7 +325,16 @@ void LLXMLRPCTransaction::Impl::curlEasyRequestCallback(bool success)
if (!success)
{
setStatus(LLXMLRPCTransaction::StatusOtherError, "Statemachine failed");
// AICurlEasyRequestStateMachine did abort.
// This currently only happens when libcurl didn't finish before the timer expired.
std::ostringstream msg;
F32 timeout_value = gSavedSettings.getF32("CurlRequestTimeOut");
msg << "Connection to " << mURI << " timed out (" << timeout_value << " s)!";
if (timeout_value < 40)
{
msg << "\nTry increasing CurlRequestTimeOut in Debug Settings.";
}
setStatus(LLXMLRPCTransaction::StatusOtherError, msg.str());
return;
}