summaryrefslogtreecommitdiff
path: root/indra/llmessage/llassetstorage.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2007-01-17 23:02:00 +0000
committerSteven Bennetts <steve@lindenlab.com>2007-01-17 23:02:00 +0000
commit71d28bdbf0baab9302c8f458e3bdbcfc60d656d4 (patch)
tree19f051897838d5a75e5ce1e776bb52a330173171 /indra/llmessage/llassetstorage.cpp
parentfc664e93e62645fc6e9659664351e77f3c4b374f (diff)
merge release@56803 release-candidate@56833
Diffstat (limited to 'indra/llmessage/llassetstorage.cpp')
-rw-r--r--indra/llmessage/llassetstorage.cpp96
1 files changed, 72 insertions, 24 deletions
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index b23567288d..e2bfd0496b 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -465,15 +465,29 @@ void LLAssetStorage::_queueDataRequest(const LLUUID& uuid, LLAssetType::EType at
}
-void LLAssetStorage::downloadCompleteCallback(S32 result, void *user_data)
+void LLAssetStorage::downloadCompleteCallback(
+ S32 result,
+ const LLUUID& file_id,
+ LLAssetType::EType file_type,
+ void* user_data)
{
- LLAssetRequest* req = (LLAssetRequest *)user_data;
+ lldebugs << "LLAssetStorage::downloadCompleteCallback() for " << file_id
+ << "," << LLAssetType::lookup(file_type) << llendl;
+ LLAssetRequest* req = (LLAssetRequest*)user_data;
+ if(!req)
+ {
+ llwarns << "LLAssetStorage::downloadCompleteCallback called without"
+ "a valid request." << llendl;
+ return;
+ }
if (!gAssetStorage)
{
llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl;
return;
}
+ req->setUUID(file_id);
+ req->setType(file_type);
if (LL_ERR_NOERR == result)
{
// we might have gotten a zero-size file
@@ -601,15 +615,28 @@ void LLAssetStorage::getEstateAsset(const LLHost &object_sim, const LLUUID &agen
}
}
-void LLAssetStorage::downloadEstateAssetCompleteCallback(S32 result, void *user_data)
+void LLAssetStorage::downloadEstateAssetCompleteCallback(
+ S32 result,
+ const LLUUID& file_id,
+ LLAssetType::EType file_type,
+ void* user_data)
{
- LLEstateAssetRequest *req = (LLEstateAssetRequest *)user_data;
+ LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data;
+ if(!req)
+ {
+ llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without a valid request." << llendl;
+ return;
+ }
if (!gAssetStorage)
{
- llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl;
+ llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without any asset system, aborting!" << llendl;
return;
}
+ req->setUUID(file_id);
+ req->setType(file_type);
if (LL_ERR_NOERR == result)
{
// we might have gotten a zero-size file
@@ -636,29 +663,36 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
//
// Probably will get rid of this early out?
//
- if (asset_id.isNull())
+ //if (asset_id.isNull())
+ //{
+ // // Special case early out for NULL uuid
+ // if (callback)
+ // {
+ // callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE);
+ // }
+ // return;
+ //}
+
+ bool exists = false;
+ U32 size = 0;
+
+ if(asset_id.notNull())
{
- // Special case early out for NULL uuid
- if (callback)
+ exists = mVFS->getExists(asset_id, atype);
+ LLVFile file(mVFS, asset_id, atype);
+ size = exists ? file.getSize() : 0;
+ if(exists && size < 1)
{
- callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE);
+ llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl;
+ file.remove();
}
- return;
- }
- BOOL exists = mVFS->getExists(asset_id, atype);
- LLVFile file(mVFS, asset_id, atype);
- U32 size = exists ? file.getSize() : 0;
+ }
if (size < 1)
{
- if (exists)
- {
- llwarns << "Asset vfile " << asset_id << ":" << atype << " found with bad size " << file.getSize() << ", removing" << llendl;
- file.remove();
- }
-
- // See whether we should talk to the object's originating sim, or the upstream provider.
+ // See whether we should talk to the object's originating sim,
+ // or the upstream provider.
LLHost source_host;
if (object_sim.isOk())
{
@@ -688,7 +722,9 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
tpvf.setAsset(asset_id, atype);
tpvf.setCallback(downloadInvItemCompleteCallback, req);
- llinfos << "Starting transfer for " << asset_id << llendl;
+ llinfos << "Starting transfer for inventory asset "
+ << item_id << " owned by " << owner_id << "," << task_id
+ << llendl;
LLTransferTargetChannel *ttcp = gTransferManager.getTargetChannel(source_host, LLTCT_ASSET);
ttcp->requestTransfer(spi, tpvf, 100.f + (is_priority ? 1.f : 0.f));
}
@@ -715,15 +751,27 @@ void LLAssetStorage::getInvItemAsset(const LLHost &object_sim, const LLUUID &age
}
-void LLAssetStorage::downloadInvItemCompleteCallback(S32 result, void *user_data)
+void LLAssetStorage::downloadInvItemCompleteCallback(
+ S32 result,
+ const LLUUID& file_id,
+ LLAssetType::EType file_type,
+ void* user_data)
{
- LLInvItemRequest *req = (LLInvItemRequest *)user_data;
+ LLInvItemRequest *req = (LLInvItemRequest*)user_data;
+ if(!req)
+ {
+ llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
+ " without a valid request." << llendl;
+ return;
+ }
if (!gAssetStorage)
{
llwarns << "LLAssetStorage::downloadCompleteCallback called without any asset system, aborting!" << llendl;
return;
}
+ req->setUUID(file_id);
+ req->setType(file_type);
if (LL_ERR_NOERR == result)
{
// we might have gotten a zero-size file