diff options
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
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 } } |