diff options
author | James Cook <james@lindenlab.com> | 2009-12-18 10:50:29 -0800 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-12-18 10:50:29 -0800 |
commit | eb501f3231aacb2fd97d8428bb2d25b818b26263 (patch) | |
tree | 85a58ed7942c2b96b3e03c9e4dbd8237423e7696 /indra/newview/lltexturefetch.cpp | |
parent | b0fd284fbf72ef3a38ea64a61f8d5fe3e2e314b7 (diff) | |
parent | ad6d0e3bb766c737b1e9bbd9d006391cc8bcc085 (diff) |
Merge, pulling in viewer-2-0
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 } } |