diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-08-18 19:16:03 +0300 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-08-18 19:16:03 +0300 |
commit | cfe0ba90352c48a2b9f5006c4c8e824dc472cdc9 (patch) | |
tree | 58515df5648b7a7819b4cb62e88431c1b4747e79 /indra/newview/llviewerassetstorage.cpp | |
parent | 61e318564e5c492ff7da70ef05f9596c4af8d369 (diff) | |
parent | e8b31d03b4f6f0ffb981b4ea150743daf7b4a958 (diff) |
Merge branch 'master' into DRTVWR-515-maint
# Conflicts:
# indra/newview/llimprocessing.cpp
Diffstat (limited to 'indra/newview/llviewerassetstorage.cpp')
-rw-r--r-- | indra/newview/llviewerassetstorage.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp index b295fa2977..cacdee7e83 100644 --- a/indra/newview/llviewerassetstorage.cpp +++ b/indra/newview/llviewerassetstorage.cpp @@ -179,7 +179,7 @@ void LLViewerAssetStorage::storeAssetData( delete req; if (callback) { - callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_VFS_CORRUPT); + callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_FAILED, LLExtStat::VFS_CORRUPT); } return; } @@ -220,7 +220,7 @@ void LLViewerAssetStorage::storeAssetData( if (callback) { - callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LL_EXSTAT_VFS_CORRUPT); + callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LLExtStat::VFS_CORRUPT); } return; } @@ -247,7 +247,7 @@ void LLViewerAssetStorage::storeAssetData( reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_ZERO_SIZE, __FILE__, __LINE__, "The file didn't exist or was zero length (VFS - can't tell which)" ); if (callback) { - callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LL_EXSTAT_NONEXISTENT_FILE); + callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LLExtStat::NONEXISTENT_FILE); } } } @@ -258,7 +258,7 @@ void LLViewerAssetStorage::storeAssetData( reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_NO_UPSTREAM, __FILE__, __LINE__, "No upstream provider" ); if (callback) { - callback(asset_id, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM); + callback(asset_id, user_data, LL_ERR_CIRCUIT_GONE, LLExtStat::NO_UPSTREAM); } } } @@ -344,7 +344,7 @@ void LLViewerAssetStorage::storeAssetData( } if (callback) { - callback(asset_id, user_data, LL_ERR_CANNOT_OPEN_FILE, LL_EXSTAT_BLOCKED_FILE); + callback(asset_id, user_data, LL_ERR_CANNOT_OPEN_FILE, LLExtStat::BLOCKED_FILE); } } } @@ -455,13 +455,18 @@ void LLViewerAssetStorage::assetRequestCoro( mCountStarted++; S32 result_code = LL_ERR_NOERR; - LLExtStat ext_status = LL_EXSTAT_NONE; + LLExtStat ext_status = LLExtStat::NONE; + if (!gAssetStorage) + { + LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: asset storage no longer exists" << LL_ENDL; + return; + } if (!gAgent.getRegion()) { LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_NONE; + ext_status = LLExtStat::NONE; removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status); return; } @@ -486,7 +491,7 @@ void LLViewerAssetStorage::assetRequestCoro( { LL_WARNS_ONCE("ViewerAsset") << "asset request fails: caps received but no viewer asset cap found" << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_NONE; + ext_status = LLExtStat::NONE; removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status); return; } @@ -501,7 +506,7 @@ void LLViewerAssetStorage::assetRequestCoro( LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts); - if (LLApp::isQuitting()) + if (LLApp::isQuitting() || !gAssetStorage) { // Bail out if result arrives after shutdown has been started. return; @@ -515,7 +520,7 @@ void LLViewerAssetStorage::assetRequestCoro( { LL_DEBUGS("ViewerAsset") << "request failed, status " << status.toTerseString() << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_NONE; + ext_status = LLExtStat::NONE; } else { @@ -541,13 +546,13 @@ void LLViewerAssetStorage::assetRequestCoro( // TODO asset-http: handle error LL_WARNS("ViewerAsset") << "Failure in vf.write()" << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_VFS_CORRUPT; + ext_status = LLExtStat::VFS_CORRUPT; } else if (!vf.rename(uuid, atype)) { LL_WARNS("ViewerAsset") << "rename failed" << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_VFS_CORRUPT; + ext_status = LLExtStat::VFS_CORRUPT; } else { @@ -559,7 +564,7 @@ void LLViewerAssetStorage::assetRequestCoro( // TODO asset-http: handle invalid size case LL_WARNS("ViewerAsset") << "bad size" << LL_ENDL; result_code = LL_ERR_ASSET_REQUEST_FAILED; - ext_status = LL_EXSTAT_NONE; + ext_status = LLExtStat::NONE; } } |