Skip to content
Snippets Groups Projects
Commit abe0eb2b authored by Steve Bennetts's avatar Steve Bennetts
Browse files

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
parent 74b36a4c
No related branches found
No related tags found
No related merge requests found
...@@ -437,6 +437,7 @@ S32 LLQueuedThread::processNextRequest() ...@@ -437,6 +437,7 @@ S32 LLQueuedThread::processNextRequest()
if (req) if (req)
{ {
// process request // process request
U32 start_priority = req->getPriority();
bool complete = req->processRequest(); bool complete = req->processRequest();
if (complete) if (complete)
...@@ -457,9 +458,8 @@ S32 LLQueuedThread::processNextRequest() ...@@ -457,9 +458,8 @@ S32 LLQueuedThread::processNextRequest()
lockData(); lockData();
req->setStatus(STATUS_QUEUED); req->setStatus(STATUS_QUEUED);
mRequestQueue.insert(req); mRequestQueue.insert(req);
U32 priority = req->getPriority();
unlockData(); unlockData();
if (priority < PRIORITY_NORMAL) if (mThreaded && start_priority <= PRIORITY_LOW)
{ {
ms_sleep(1); // sleep the thread a little ms_sleep(1); // sleep the thread a little
} }
......
...@@ -448,6 +448,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker() ...@@ -448,6 +448,7 @@ LLTextureFetchWorker::~LLTextureFetchWorker()
mFormattedImage = NULL; mFormattedImage = NULL;
clearPackets(); clearPackets();
unlockWorkMutex(); unlockWorkMutex();
mFetcher->removeFromHTTPQueue(mID);
} }
void LLTextureFetchWorker::clearPackets() void LLTextureFetchWorker::clearPackets()
...@@ -821,6 +822,13 @@ bool LLTextureFetchWorker::doWork(S32 param) ...@@ -821,6 +822,13 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mFormattedImage.notNull()) if (mFormattedImage.notNull())
{ {
cur_size = mFormattedImage->getDataSize(); // amount of data we already have 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; mRequestedSize = mDesiredSize;
mRequestedDiscard = mDesiredDiscard; mRequestedDiscard = mDesiredDiscard;
...@@ -871,26 +879,16 @@ bool LLTextureFetchWorker::doWork(S32 param) ...@@ -871,26 +879,16 @@ bool LLTextureFetchWorker::doWork(S32 param)
llinfos << "HTTP GET failed for: " << mUrl llinfos << "HTTP GET failed for: " << mUrl
<< " Status: " << mGetStatus << " Reason: '" << mGetReason << "'" << " Status: " << mGetStatus << " Reason: '" << mGetReason << "'"
<< " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl; << " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl;
if (cur_size == 0) ++mHTTPFailCount;
if (mHTTPFailCount >= max_attempts)
{ {
++mHTTPFailCount; resetFormattedData();
if (mHTTPFailCount >= max_attempts) return true; // failed
{
resetFormattedData();
return true; // failed
}
else
{
mState = SEND_HTTP_REQ;
return false; // retry
}
} }
else else
{ {
// mFormattedImage gauranteed to not be NULL since cur_size != 0 mState = SEND_HTTP_REQ;
mLoadedDiscard = mFormattedImage->getDiscardLevel(); return false; // retry
mState = DECODE_IMAGE;
return false; // use what we have
} }
} }
......
...@@ -494,7 +494,7 @@ void LLGLTexMemBar::draw() ...@@ -494,7 +494,7 @@ void LLGLTexMemBar::draw()
#endif #endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d RAW:%d HTP:%d", text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d RAW:%d HTP:%d CRE:%d",
gTextureList.getNumImages(), gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(), LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount, LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
...@@ -502,7 +502,8 @@ void LLGLTexMemBar::draw() ...@@ -502,7 +502,8 @@ void LLGLTexMemBar::draw()
LLLFSThread::sLocal->getPending(), LLLFSThread::sLocal->getPending(),
LLAppViewer::getImageDecodeThread()->getPending(), LLAppViewer::getImageDecodeThread()->getPending(),
LLImageRaw::sRawImageCount, LLImageRaw::sRawImageCount,
LLAppViewer::getTextureFetch()->getNumHTTPRequests()); LLAppViewer::getTextureFetch()->getNumHTTPRequests(),
gTextureList.mCreateTextureList.size());
LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*2, LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*2,
text_color, LLFontGL::LEFT, LLFontGL::TOP); text_color, LLFontGL::LEFT, LLFontGL::TOP);
......
...@@ -588,7 +588,7 @@ void LLViewerTextureList::updateImages(F32 max_time) ...@@ -588,7 +588,7 @@ void LLViewerTextureList::updateImages(F32 max_time)
F32 total_max_time = max_time; F32 total_max_time = max_time;
max_time -= updateImagesFetchTextures(max_time); max_time -= updateImagesFetchTextures(max_time);
max_time = llmax(max_time, total_max_time*.25f); // at least 25% of max_time max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time
max_time -= updateImagesCreateTextures(max_time); max_time -= updateImagesCreateTextures(max_time);
if (!mDirtyTextureList.empty()) if (!mDirtyTextureList.empty())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment