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

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