summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2009-12-17 16:48:53 -0800
committerTofu Linden <tofu.linden@lindenlab.com>2009-12-17 16:48:53 -0800
commit7105ad1def21c3e55c5c650a954b966553fe4174 (patch)
treec9259c9a4a2b23c4cfc575529f1c92d17d5a2141 /indra/newview/lltexturefetch.cpp
parente75242fd56ace32f7d65386f499ff104dde0eca6 (diff)
parentb29b9c961900f98121ba80447e1e737cff0d4331 (diff)
Merge.
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rw-r--r--indra/newview/lltexturefetch.cpp30
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
}
}