Do not use a timer for HTTP get in LLTextureFetchWorker::doWork

All HTTP timing is done by AIHTTPTimeoutPolicy.

Inside LLTextureFetchWorker::doWork when mState == SEND_HTTP_REQ,
mCanUseHTTP is true, throttling is not in effect and mURL is not empty,
mLoaded is set to FALSE, mState is set to WAIT_HTTP_REQ and
LLHTTPClient::request is called that starts the download by curl.
A call back to LLTextureFetchWorker::callbackHttpGet is guaranteed,
which causes mLoaded to be set to TRUE (HTTPGetResponder::completedRaw
calls LLTextureFetchWorker::callbackHttpGet which sets mRequestedSize to -1
(if there was an error) and mLoaded to TRUE).

Being in state WAIT_HTTP_REQ, once mLoaded == TRUE (and mRequestedSize
is -1), the different timeout errors are handled.
This commit is contained in:
Aleric Inglewood
2013-03-27 21:49:25 +01:00
parent bbf24b4994
commit ac84e02018
2 changed files with 8 additions and 12 deletions

View File

@@ -707,6 +707,13 @@ AIHTTPTimeoutPolicyBase connect_40s(AIHTTPTimeoutPolicyBase::getDebugSettingsCur
connectOp40s
);
// This used to be FETCHING_TIMEOUT (for HTTP textures), being a 15 second timeout from start of request till finishing receiving all data.
// That seems way to demanding however; lets use a 15 second reply delay demand instead.
Reply replyOp15s(15);
AIHTTPTimeoutPolicyBase reply_15s(AIHTTPTimeoutPolicyBase::getDebugSettingsCurlTimeout(),
replyOp15s
);
// End of policy definitions.
//=======================================================================================================
@@ -899,7 +906,7 @@ P2(gamingDataReceived, transfer_18s);
P2(groupMemberDataResponder, transfer_300s);
P2(groupProposalBallotResponder, transfer_300s);
P(homeLocationResponder);
P(HTTPGetResponder);
P2(HTTPGetResponder, reply_15s);
P(iamHereLogin);
P(iamHere);
P(iamHereVoice);

View File

@@ -972,8 +972,6 @@ void LLTextureFetchWorker::startWork(S32 param)
// Called from LLWorkerThread::processRequest()
bool LLTextureFetchWorker::doWork(S32 param)
{
static const F32 FETCHING_TIMEOUT = 15.f;//seconds
LLMutexLock lock(&mWorkMutex);
if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
@@ -1304,8 +1302,6 @@ bool LLTextureFetchWorker::doWork(S32 param)
bool res = false;
if (!mUrl.empty())
{
mRequestedTimer.reset();
mLoaded = FALSE;
mGetStatus = 0;
mGetReason.clear();
@@ -1533,13 +1529,6 @@ bool LLTextureFetchWorker::doWork(S32 param)
}
else
{
if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32())
{
//timeout, abort.
mState = DONE;
return true;
}
setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
return false;
}