From 9cc801f6696df3e506f85514a7fb88b6f3eb71e6 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Sun, 7 Apr 2013 21:52:14 +0200 Subject: [PATCH] Added LLTextureFetchWorker::PerHostPtr Points to the AIPerHostRequestQueue instance corresponding to the hostname in LLTextureFetchWorker::mUrl. This is basically a cache as we could of course just retrieve that instance from mUrl at any time, everytime. Needed in a future commit. --- indra/newview/lltexturefetch.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e3aed97c1..b7d5d3a2b 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -253,6 +253,7 @@ private: LLUUID mID; LLHost mHost; std::string mUrl; + AIPerHostRequestQueuePtr mPerHostPtr; // Pointer to the AIPerHostRequestQueue corresponding to the host of mUrl. U8 mType; F32 mImagePriority; U32 mWorkPriority; @@ -795,6 +796,17 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, { mCanUseNET = mUrl.empty() ; + if (!mCanUseNET) + { + // Probably a file://, but well; in that case hostname will be empty. + std::string hostname = AIPerHostRequestQueue::extract_canonical_hostname(mUrl); + if (!hostname.empty()) + { + // Make sure mPerHostPtr is up to date with mUrl. + mPerHostPtr = AIPerHostRequestQueue::instance(hostname); + } + } + calcWorkPriority(); mType = host.isOk() ? LLImageBase::TYPE_AVATAR_BAKE : LLImageBase::TYPE_NORMAL; //llinfos << "Create: " << mID << " mHost:" << host << " Discard=" << discard << " URL:"<< mUrl << llendl; @@ -1150,6 +1162,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { mUrl = http_url + "/?texture_id=" + mID.asString().c_str(); mWriteToCacheState = CAN_WRITE ; //because this texture has a fixed texture id. + mPerHostPtr = AIPerHostRequestQueue::instance(AIPerHostRequestQueue::extract_canonical_hostname(http_url)); } else {