summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerassetstorage.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
commitf62579f29303b33ff331f3f0b0e8d4197755d279 (patch)
tree06744ee5ccb2280970c8eed3303db326fbd5c128 /indra/newview/llviewerassetstorage.cpp
parent611869b1035ef5677335a33169fb99413a90c3a6 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-548-maint-N
Diffstat (limited to 'indra/newview/llviewerassetstorage.cpp')
-rw-r--r--indra/newview/llviewerassetstorage.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index 0f102411d5..6aa1273174 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -102,10 +102,11 @@ public:
/// LLViewerAssetStorage
///----------------------------------------------------------------------------
+S32 LLViewerAssetStorage::sAssetCoroCount = 0;
+
// Unused?
LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer, const LLHost &upstream_host)
: LLAssetStorage(msg, xfer, upstream_host),
- mAssetCoroCount(0),
mCountRequests(0),
mCountStarted(0),
mCountCompleted(0),
@@ -117,7 +118,6 @@ LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *
LLViewerAssetStorage::LLViewerAssetStorage(LLMessageSystem *msg, LLXferManager *xfer)
: LLAssetStorage(msg, xfer),
- mAssetCoroCount(0),
mCountRequests(0),
mCountStarted(0),
mCountCompleted(0),
@@ -477,8 +477,7 @@ void LLViewerAssetStorage::assetRequestCoro(
LLGetAssetCallback callback,
void *user_data)
{
- LLScopedIncrement coro_count_boost(mAssetCoroCount);
- mCountStarted++;
+ LLScopedIncrement coro_count_boost(sAssetCoroCount); // static counter since corotine can outlive LLViewerAssetStorage
S32 result_code = LL_ERR_NOERR;
LLExtStat ext_status = LLExtStat::NONE;
@@ -488,6 +487,9 @@ void LLViewerAssetStorage::assetRequestCoro(
LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: asset storage no longer exists" << LL_ENDL;
return;
}
+
+ mCountStarted++;
+
if (!gAgent.getRegion())
{
LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL;
@@ -554,6 +556,18 @@ void LLViewerAssetStorage::assetRequestCoro(
result_code = LL_ERR_ASSET_REQUEST_FAILED;
ext_status = LLExtStat::NONE;
}
+ else if (!result.has(LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW))
+ {
+ LL_DEBUGS("ViewerAsset") << "request failed, no data returned!" << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LLExtStat::NONE;
+ }
+ else if (!result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].isBinary())
+ {
+ LL_DEBUGS("ViewerAsset") << "request failed, invalid data format!" << LL_ENDL;
+ result_code = LL_ERR_ASSET_REQUEST_FAILED;
+ ext_status = LLExtStat::NONE;
+ }
else
{
LL_DEBUGS("ViewerAsset") << "request succeeded, url " << url << LL_ENDL;
@@ -613,7 +627,7 @@ std::string LLViewerAssetStorage::getAssetURL(const std::string& cap_url, const
void LLViewerAssetStorage::logAssetStorageInfo()
{
LLMemory::logMemoryInfo(true);
- LL_INFOS("AssetStorage") << "Active coros " << mAssetCoroCount << LL_ENDL;
+ LL_INFOS("AssetStorage") << "Active coros " << sAssetCoroCount << LL_ENDL;
LL_INFOS("AssetStorage") << "mPendingDownloads size " << mPendingDownloads.size() << LL_ENDL;
LL_INFOS("AssetStorage") << "mCountStarted " << mCountStarted << LL_ENDL;
LL_INFOS("AssetStorage") << "mCountCompleted " << mCountCompleted << LL_ENDL;