From abe0eb2ba72d644c3e4b717b391ca9cbcead162c Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Thu, 17 Dec 2009 16:19:00 -0800 Subject: HTTP Texture changes: * Fixed bug in llqueuedthread.cpp causing unnecesssary sleeeping * Fixed an issue that was preventing retries on 503 errors * Added number of pending creates to Texture View * Increased time allocated for texture creates --- indra/newview/lltexturefetch.cpp | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'indra/newview/lltexturefetch.cpp') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9f69ed3964..83e0b53960 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -448,6 +448,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker() mFormattedImage = NULL; clearPackets(); unlockWorkMutex(); + mFetcher->removeFromHTTPQueue(mID); } void LLTextureFetchWorker::clearPackets() @@ -821,6 +822,13 @@ bool LLTextureFetchWorker::doWork(S32 param) if (mFormattedImage.notNull()) { cur_size = mFormattedImage->getDataSize(); // amount of data we already have + if (mFormattedImage->getDiscardLevel() == 0) + { + // We already have all the data, just decode it + mLoadedDiscard = mFormattedImage->getDiscardLevel(); + mState = DECODE_IMAGE; + return false; + } } mRequestedSize = mDesiredSize; mRequestedDiscard = mDesiredDiscard; @@ -871,26 +879,16 @@ bool LLTextureFetchWorker::doWork(S32 param) llinfos << "HTTP GET failed for: " << mUrl << " Status: " << mGetStatus << " Reason: '" << mGetReason << "'" << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl; - if (cur_size == 0) + ++mHTTPFailCount; + if (mHTTPFailCount >= max_attempts) { - ++mHTTPFailCount; - if (mHTTPFailCount >= max_attempts) - { - resetFormattedData(); - return true; // failed - } - else - { - mState = SEND_HTTP_REQ; - return false; // retry - } + resetFormattedData(); + return true; // failed } else { - // mFormattedImage gauranteed to not be NULL since cur_size != 0 - mLoadedDiscard = mFormattedImage->getDiscardLevel(); - mState = DECODE_IMAGE; - return false; // use what we have + mState = SEND_HTTP_REQ; + return false; // retry } } -- cgit v1.2.3