aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llmessage/llassetstorage.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:07 -0500
committerJacek Antonelli2008-08-15 23:45:07 -0500
commit8465910c79b8e746e04fd581cca2d60399e569b9 (patch)
treef43fec3e83c46e0d6190dca923d6fb268b52ffdd /linden/indra/llmessage/llassetstorage.cpp
parentSecond Life viewer sources 1.18.2.1 (diff)
downloadmeta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.zip
meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.gz
meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.bz2
meta-impy-8465910c79b8e746e04fd581cca2d60399e569b9.tar.xz
Second Life viewer sources 1.18.3.2-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/llmessage/llassetstorage.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/linden/indra/llmessage/llassetstorage.cpp b/linden/indra/llmessage/llassetstorage.cpp
index 8696438..b1d7fef 100644
--- a/linden/indra/llmessage/llassetstorage.cpp
+++ b/linden/indra/llmessage/llassetstorage.cpp
@@ -365,11 +365,11 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
365 LLAssetRequest* tmp = *curiter; 365 LLAssetRequest* tmp = *curiter;
366 if (tmp->mUpCallback) 366 if (tmp->mUpCallback)
367 { 367 {
368 tmp->mUpCallback(tmp->getUUID(), tmp->mUserData, error); 368 tmp->mUpCallback(tmp->getUUID(), tmp->mUserData, error, LL_EXSTAT_NONE);
369 } 369 }
370 if (tmp->mDownCallback) 370 if (tmp->mDownCallback)
371 { 371 {
372 tmp->mDownCallback(mVFS, tmp->getUUID(), tmp->getType(), tmp->mUserData, error); 372 tmp->mDownCallback(mVFS, tmp->getUUID(), tmp->getType(), tmp->mUserData, error, LL_EXSTAT_NONE);
373 } 373 }
374 if (tmp->mInfoCallback) 374 if (tmp->mInfoCallback)
375 { 375 {
@@ -390,7 +390,7 @@ BOOL LLAssetStorage::hasLocalAsset(const LLUUID &uuid, const LLAssetType::EType
390/////////////////////////////////////////////////////////////////////////// 390///////////////////////////////////////////////////////////////////////////
391 391
392// IW - uuid is passed by value to avoid side effects, please don't re-add & 392// IW - uuid is passed by value to avoid side effects, please don't re-add &
393void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *,S32), void *user_data, BOOL is_priority) 393void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(LLVFS *vfs, const LLUUID&, LLAssetType::EType, void *, S32, LLExtStat), void *user_data, BOOL is_priority)
394{ 394{
395 lldebugs << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl; 395 lldebugs << "LLAssetStorage::getAssetData() - " << uuid << "," << LLAssetType::lookup(type) << llendl;
396 396
@@ -404,7 +404,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
404 // Special case early out for NULL uuid 404 // Special case early out for NULL uuid
405 if (callback) 405 if (callback)
406 { 406 {
407 callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE); 407 callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
408 } 408 }
409 return; 409 return;
410 } 410 }
@@ -459,7 +459,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
459 // unless there's a weird error 459 // unless there's a weird error
460 if (callback) 460 if (callback)
461 { 461 {
462 callback(mVFS, uuid, type, user_data, LL_ERR_NOERR); 462 callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
463 } 463 }
464 } 464 }
465} 465}
@@ -502,7 +502,7 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at
502 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; 502 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
503 if (callback) 503 if (callback)
504 { 504 {
505 callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE); 505 callback(mVFS, uuid, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
506 } 506 }
507 } 507 }
508} 508}
@@ -512,7 +512,7 @@ void LLAssetStorage::downloadCompleteCallback(
512 S32 result, 512 S32 result,
513 const LLUUID& file_id, 513 const LLUUID& file_id,
514 LLAssetType::EType file_type, 514 LLAssetType::EType file_type,
515 void* user_data) 515 void* user_data, LLExtStat ext_status)
516{ 516{
517 lldebugs << "LLAssetStorage::downloadCompleteCallback() for " << file_id 517 lldebugs << "LLAssetStorage::downloadCompleteCallback() for " << file_id
518 << "," << LLAssetType::lookup(file_type) << llendl; 518 << "," << LLAssetType::lookup(file_type) << llendl;
@@ -566,7 +566,7 @@ void LLAssetStorage::downloadCompleteCallback(
566 LLAssetRequest* tmp = *curiter; 566 LLAssetRequest* tmp = *curiter;
567 if (tmp->mDownCallback) 567 if (tmp->mDownCallback)
568 { 568 {
569 tmp->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), tmp->mUserData, result); 569 tmp->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), tmp->mUserData, result, ext_status);
570 } 570 }
571 delete tmp; 571 delete tmp;
572 } 572 }
@@ -586,7 +586,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
586 // Special case early out for NULL uuid 586 // Special case early out for NULL uuid
587 if (callback) 587 if (callback)
588 { 588 {
589 callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE); 589 callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
590 } 590 }
591 return; 591 return;
592 } 592 }
@@ -642,7 +642,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
642 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; 642 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
643 if (callback) 643 if (callback)
644 { 644 {
645 callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE); 645 callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
646 } 646 }
647 } 647 }
648 } 648 }
@@ -653,7 +653,7 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
653 // unless there's a weird error 653 // unless there's a weird error
654 if (callback) 654 if (callback)
655 { 655 {
656 callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR); 656 callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
657 } 657 }
658 } 658 }
659} 659}
@@ -662,7 +662,8 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
662 S32 result, 662 S32 result,
663 const LLUUID& file_id, 663 const LLUUID& file_id,
664 LLAssetType::EType file_type, 664 LLAssetType::EType file_type,
665 void* user_data) 665 void* user_data,
666 LLExtStat ext_status)
666{ 667{
667 LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data; 668 LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data;
668 if(!req) 669 if(!req)
@@ -693,7 +694,7 @@ void LLAssetStorage::downloadEstateAssetCompleteCallback(
693 } 694 }
694 } 695 }
695 696
696 req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getAType(), req->mUserData, result); 697 req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getAType(), req->mUserData, result, ext_status);
697} 698}
698 699
699void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &agent_id, const LLUUID &session_id, 700void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &agent_id, const LLUUID &session_id,
@@ -777,7 +778,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
777 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl; 778 llwarns << "Attempt to move asset data request upstream w/o valid upstream provider" << llendl;
778 if (callback) 779 if (callback)
779 { 780 {
780 callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE); 781 callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
781 } 782 }
782 } 783 }
783 } 784 }
@@ -788,7 +789,7 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
788 // unless there's a weird error 789 // unless there's a weird error
789 if (callback) 790 if (callback)
790 { 791 {
791 callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR); 792 callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
792 } 793 }
793 } 794 }
794} 795}
@@ -798,7 +799,8 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
798 S32 result, 799 S32 result,
799 const LLUUID& file_id, 800 const LLUUID& file_id,
800 LLAssetType::EType file_type, 801 LLAssetType::EType file_type,
801 void* user_data) 802 void* user_data,
803 LLExtStat ext_status)
802{ 804{
803 LLInvItemRequest *req = (LLInvItemRequest*)user_data; 805 LLInvItemRequest *req = (LLInvItemRequest*)user_data;
804 if(!req) 806 if(!req)
@@ -828,7 +830,7 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
828 } 830 }
829 } 831 }
830 832
831 req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), req->mUserData, result); 833 req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getType(), req->mUserData, result, ext_status);
832} 834}
833 835
834///////////////////////////////////////////////////////////////////////////////////////////////////////////////// 836/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -836,7 +838,7 @@ void LLAssetStorage::downloadInvItemCompleteCallback(
836///////////////////////////////////////////////////////////////////////////////////////////////////////////////// 838/////////////////////////////////////////////////////////////////////////////////////////////////////////////////
837 839
838// static 840// static
839void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, S32 result) // StoreAssetData callback (fixed) 841void LLAssetStorage::uploadCompleteCallback(const LLUUID& uuid, void *user_data, S32 result, LLExtStat ext_status) // StoreAssetData callback (fixed)
840{ 842{
841 if (!gAssetStorage) 843 if (!gAssetStorage)
842 { 844 {
@@ -876,10 +878,10 @@ void LLAssetStorage::processUploadComplete(LLMessageSystem *msg, void **user_dat
876 msg->getBOOLFast(_PREHASH_AssetBlock, _PREHASH_Success, success); 878 msg->getBOOLFast(_PREHASH_AssetBlock, _PREHASH_Success, success);
877 879
878 asset_type = (LLAssetType::EType)asset_type_s8; 880 asset_type = (LLAssetType::EType)asset_type_s8;
879 this_ptr->_callUploadCallbacks(uuid, asset_type, success); 881 this_ptr->_callUploadCallbacks(uuid, asset_type, success, LL_EXSTAT_NONE);
880} 882}
881 883
882void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType asset_type, BOOL success) 884void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType asset_type, BOOL success, LLExtStat ext_status )
883{ 885{
884 // SJB: We process the callbacks in reverse order, I do not know if this is important, 886 // SJB: We process the callbacks in reverse order, I do not know if this is important,
885 // but I didn't want to mess with it. 887 // but I didn't want to mess with it.
@@ -913,7 +915,7 @@ void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType
913 LLAssetRequest* req = *curiter; 915 LLAssetRequest* req = *curiter;
914 if (req->mUpCallback) 916 if (req->mUpCallback)
915 { 917 {
916 req->mUpCallback(uuid, req->mUserData, (success ? LL_ERR_NOERR : LL_ERR_ASSET_REQUEST_FAILED )); 918 req->mUpCallback(uuid, req->mUserData, (success ? LL_ERR_NOERR : LL_ERR_ASSET_REQUEST_FAILED ), ext_status );
917 } 919 }
918 delete req; 920 delete req;
919 } 921 }
@@ -1136,11 +1138,11 @@ bool LLAssetStorage::deletePendingRequest(LLAssetStorage::request_list_t* reques
1136 // Run callbacks. 1138 // Run callbacks.
1137 if (req->mUpCallback) 1139 if (req->mUpCallback)
1138 { 1140 {
1139 req->mUpCallback(req->getUUID(), req->mUserData, error); 1141 req->mUpCallback(req->getUUID(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED);
1140 } 1142 }
1141 if (req->mDownCallback) 1143 if (req->mDownCallback)
1142 { 1144 {
1143 req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error); 1145 req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED);
1144 } 1146 }
1145 if (req->mInfoCallback) 1147 if (req->mInfoCallback)
1146 { 1148 {
@@ -1193,7 +1195,7 @@ const char* LLAssetStorage::getErrorString(S32 status)
1193 1195
1194 1196
1195 1197
1196void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(const char*, const LLUUID&, void *, S32), void *user_data, BOOL is_priority) 1198void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, void (*callback)(const char*, const LLUUID&, void *, S32, LLExtStat), void *user_data, BOOL is_priority)
1197{ 1199{
1198 // check for duplicates here, since we're about to fool the normal duplicate checker 1200 // check for duplicates here, since we're about to fool the normal duplicate checker
1199 for (request_list_t::iterator iter = mPendingDownloads.begin(); 1201 for (request_list_t::iterator iter = mPendingDownloads.begin();
@@ -1223,7 +1225,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLAssetType::EType type, vo
1223} 1225}
1224 1226
1225// static 1227// static
1226void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 status) 1228void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, void *user_data, S32 status, LLExtStat ext_status)
1227{ 1229{
1228 LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data; 1230 LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data;
1229 char filename[LL_MAX_PATH] = ""; /* Flawfinder: ignore */ 1231 char filename[LL_MAX_PATH] = ""; /* Flawfinder: ignore */
@@ -1259,7 +1261,7 @@ void LLAssetStorage::legacyGetDataCallback(LLVFS *vfs, const LLUUID &uuid, LLAss
1259 } 1261 }
1260 } 1262 }
1261 1263
1262 legacy->mDownCallback(filename, uuid, legacy->mUserData, status); 1264 legacy->mDownCallback(filename, uuid, legacy->mUserData, status, ext_status);
1263 delete legacy; 1265 delete legacy;
1264} 1266}
1265 1267
@@ -1329,12 +1331,12 @@ void LLAssetStorage::storeAssetData(
1329} 1331}
1330 1332
1331// static 1333// static
1332void LLAssetStorage::legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status) 1334void LLAssetStorage::legacyStoreDataCallback(const LLUUID &uuid, void *user_data, S32 status, LLExtStat ext_status)
1333{ 1335{
1334 LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data; 1336 LLLegacyAssetRequest *legacy = (LLLegacyAssetRequest *)user_data;
1335 if (legacy && legacy->mUpCallback) 1337 if (legacy && legacy->mUpCallback)
1336 { 1338 {
1337 legacy->mUpCallback(uuid, legacy->mUserData, status); 1339 legacy->mUpCallback(uuid, legacy->mUserData, status, ext_status);
1338 } 1340 }
1339 delete legacy; 1341 delete legacy;
1340} 1342}