aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llassetstorage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2009-04-30 13:04:20 -0500
committerJacek Antonelli2009-04-30 13:07:16 -0500
commitca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch)
tree8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/llmessage/llassetstorage.cpp
parentSecond Life viewer sources 1.22.11 (diff)
downloadmeta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2
meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/llmessage/llassetstorage.cpp')
-rw-r--r--linden/indra/llmessage/llassetstorage.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp
index a89a786..2966b60 100644
--- a/linden/indra/llmessage/llassetstorage.cpp
+++ b/linden/indra/llmessage/llassetstorage.cpp
@@ -17,7 +17,8 @@
17 * There are special exceptions to the terms and conditions of the GPL as 17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception 18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or 19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception 20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 * 22 *
22 * By copying, modifying or distributing this software, you acknowledge 23 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above, 24 * that you have read and understood your obligations described above,
@@ -539,8 +540,19 @@ void LLAssetStorage::downloadCompleteCallback(
539 return; 540 return;
540 } 541 }
541 542
542 req->setUUID(file_id); 543 // Inefficient since we're doing a find through a list that may have thousands of elements.
543 req->setType(file_type); 544 // This is due for refactoring; we will probably change mPendingDownloads into a set.
545 request_list_t::iterator download_iter = std::find(gAssetStorage->mPendingDownloads.begin(),
546 gAssetStorage->mPendingDownloads.end(),
547 req);
548 // If the LLAssetRequest doesn't exist in the downloads queue, then it either has already been deleted
549 // by _cleanupRequests, or it's a transfer.
550 if (download_iter != gAssetStorage->mPendingDownloads.end())
551 {
552 req->setUUID(file_id);
553 req->setType(file_type);
554 }
555
544 if (LL_ERR_NOERR == result) 556 if (LL_ERR_NOERR == result)
545 { 557 {
546 // we might have gotten a zero-size file 558 // we might have gotten a zero-size file
@@ -563,7 +575,7 @@ void LLAssetStorage::downloadCompleteCallback(
563 { 575 {
564 request_list_t::iterator curiter = iter++; 576 request_list_t::iterator curiter = iter++;
565 LLAssetRequest* tmp = *curiter; 577 LLAssetRequest* tmp = *curiter;
566 if ((tmp->getUUID() == req->getUUID()) && (tmp->getType()== req->getType())) 578 if ((tmp->getUUID() == file_id) && (tmp->getType()== file_type))
567 { 579 {
568 requests.push_front(tmp); 580 requests.push_front(tmp);
569 iter = gAssetStorage->mPendingDownloads.erase(curiter); 581 iter = gAssetStorage->mPendingDownloads.erase(curiter);
@@ -1198,6 +1210,9 @@ const char* LLAssetStorage::getErrorString(S32 status)
1198 case LL_ERR_CIRCUIT_GONE: 1210 case LL_ERR_CIRCUIT_GONE:
1199 return "Circuit gone"; 1211 return "Circuit gone";
1200 1212
1213 case LL_ERR_PRICE_MISMATCH:
1214 return "Viewer and server do not agree on price";
1215
1201 default: 1216 default:
1202 return "Unknown status"; 1217 return "Unknown status";
1203 } 1218 }