Ejemplo n.º 1
0
void LLAssetStorage::downloadEstateAssetCompleteCallback(
	S32 result,
	const LLUUID& file_id,
	LLAssetType::EType file_type,
	void* callback_parm_req,
	LLExtStat ext_status)
{
	LLEstateAssetRequest *req = (LLEstateAssetRequest*)callback_parm_req;
	if(!req)
	{
		llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
			" without a valid request." << llendl;
		return;
	}
	if (!gAssetStorage)
	{
		llwarns << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
			" without any asset system, aborting!" << llendl;
		return;
	}

	if (LL_ERR_NOERR == result)
	{
		// we might have gotten a zero-size file
		LLVFile vfile(gAssetStorage->mVFS, file_id, file_type);
		if (vfile.getSize() <= 0)
		{
			llwarns << "downloadCompleteCallback has non-existent or zero-size asset!" << llendl;

			result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
			vfile.remove();
		}
	}

	req->mDownCallback(gAssetStorage->mVFS, file_id, file_type, req->mUserData, result, ext_status);

	delete req;
}
Ejemplo n.º 2
0
void LLAssetStorage::downloadEstateAssetCompleteCallback(
	S32 result,
	const LLUUID& file_id,
	LLAssetType::EType file_type,
	void* user_data,
	LLExtStat ext_status)
{
	LLEstateAssetRequest *req = (LLEstateAssetRequest*)user_data;
	if(!req)
	{
		LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
			" without a valid request." << LL_ENDL;
		return;
	}
	if (!gAssetStorage)
	{
		LL_WARNS() << "LLAssetStorage::downloadEstateAssetCompleteCallback called"
			" without any asset system, aborting!" << LL_ENDL;
		return;
	}

	req->setUUID(file_id);
	req->setType(file_type);
	if (LL_ERR_NOERR == result)
	{
		// we might have gotten a zero-size file
		LLVFile vfile(gAssetStorage->mVFS, req->getUUID(), req->getAType());
		if (vfile.getSize() <= 0)
		{
			LL_WARNS() << "downloadCompleteCallback has non-existent or zero-size asset!" << LL_ENDL;

			result = LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE;
			vfile.remove();
		}
	}

	if (result != LL_ERR_NOERR)
	{
		add(sFailedDownloadCount, 1);
	}
	req->mDownCallback(gAssetStorage->mVFS, req->getUUID(), req->getAType(), req->mUserData, result, ext_status);
}