diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2012-07-03 13:06:46 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2012-07-03 13:06:46 -0400 |
commit | 2d7b7de20327a40be12a620debaae9917af16cd6 (patch) | |
tree | 501d8a8f5213466c061d31bafc0d43ca9f0657b6 /indra/newview/lltexturefetch.cpp | |
parent | 7997a9c4e58f67a8cf4d13cdc3e2a1b536bc1e4d (diff) |
More integration work for texture fetch timeouts.
The fetch state machine received a new timeout during the WAIT_HTTP_REQ
state. For the integration, rather than jump the state to done, we issue
a request cancel and let the notification plumbing do the rest without
any race conditions or special-case logic.
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rwxr-xr-x | indra/newview/lltexturefetch.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 36b878d6f2..b30b25e543 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1560,8 +1560,24 @@ bool LLTextureFetchWorker::doWork(S32 param) if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) { //timeout, abort. - mState = DONE; - return true; + LL_WARNS("Texture") << "Fetch of texture " << mID << " timed out after " + << mRequestedTimer.getElapsedTimeF32() + << " seconds. Canceling request." << LL_ENDL; + + if (LLCORE_HTTP_HANDLE_INVALID != mHttpHandle) + { + // Issue cancel on any outstanding request. Asynchronous + // so cancel may not actually take effect if operation is + // complete & queued. Either way, notification will + // complete and the request can be transitioned. + mFetcher->mHttpRequest->requestCancel(mHttpHandle, NULL); + } + else + { + // Shouldn't happen but if it does, cancel quickly. + mState = DONE; + return true; + } } setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); |