summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorAdam Moss <moss@lindenlab.com>2008-12-02 20:35:40 +0000
committerAdam Moss <moss@lindenlab.com>2008-12-02 20:35:40 +0000
commitfd46865a502036b9e4414e7ec4950faf551b1f14 (patch)
tree634dbca07e829d3906ed555341118c361aa1bb14 /indra/llmessage
parentde7d6cf4dfa1db2945e3ed4a3e8257d72674a496 (diff)
QAR-1040 maint-viewer-11 + OpenAL combo mergeme
svn merge -c104451 svn+ssh://svn.lindenlab.com/svn/linden/branches/moss/openal-maint-viewer-11-combo-r104448
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llassetstorage.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index af149d0f62..7f47dfec92 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -539,8 +539,19 @@ void LLAssetStorage::downloadCompleteCallback(
return;
}
- req->setUUID(file_id);
- req->setType(file_type);
+ // Inefficient since we're doing a find through a list that may have thousands of elements.
+ // This is due for refactoring; we will probably change mPendingDownloads into a set.
+ request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
+ gAssetStorage->mPendingDownloads.end(),
+ req);
+ // If the LLAssetRequest doesn't exist in the downloads queue, then it either has already been deleted
+ // by _cleanupRequests, or it's a transfer.
+ if (download_iter != gAssetStorage->mPendingDownloads.end())
+ {
+ req->setUUID(file_id);
+ req->setType(file_type);
+ }
+
if (LL_ERR_NOERR == result)
{
// we might have gotten a zero-size file
@@ -563,7 +574,7 @@ void LLAssetStorage::downloadCompleteCallback(
{
request_list_t::iterator curiter = iter++;
LLAssetRequest* tmp = *curiter;
- if ((tmp->getUUID() == req->getUUID()) && (tmp->getType()== req->getType()))
+ if ((tmp->getUUID() == file_id) && (tmp->getType()== file_type))
{
requests.push_front(tmp);
iter = gAssetStorage->mPendingDownloads.erase(curiter);