From f69f0281cf3ea9738e3815822a6c4227b2c3dce7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 3 Nov 2020 18:45:54 +0000 Subject: [PATCH] add some broken assets check/log, so i don't try to fix other code using one --- .../Handlers/GetAssets/GetAssetsHandler.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs b/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs index ce40d29abe..ab3b87a4c1 100644 --- a/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs +++ b/OpenSim/Capabilities/Handlers/GetAssets/GetAssetsHandler.cs @@ -114,7 +114,7 @@ namespace OpenSim.Capabilities.Handlers return; } - if (String.IsNullOrEmpty(assetStr)) + if (string.IsNullOrEmpty(assetStr)) return; UUID assetID = UUID.Zero; @@ -122,13 +122,27 @@ namespace OpenSim.Capabilities.Handlers return; AssetBase asset = m_assetService.Get(assetID.ToString(), serviceURL, false); - if (asset == null || asset.Type != (sbyte)type) + if (asset == null) { // m_log.Warn("[GETASSET]: not found: " + query + " " + assetStr); response.StatusCode = (int)HttpStatusCode.NotFound; return; } + if (asset.Type != (sbyte)type) + { + m_log.Warn("[GETASSET]: asset with wrong type: " + assetStr + " " + asset.Type.ToString() + " != " + ((sbyte)type).ToString()); + response.StatusCode = (int)HttpStatusCode.NotFound; + return; + } + + if (asset.Data.Length == 0) + { + m_log.Warn("[GETASSET]: asset with empty data: " + assetStr +" type " + asset.Type.ToString()); + response.StatusCode = (int)HttpStatusCode.NotFound; + return; + } + int len = asset.Data.Length; string range = null;