add some broken assets check/log, so i don't try to fix other code using one

This commit is contained in:
UbitUmarov
2020-11-03 18:45:54 +00:00
parent 9642453f9e
commit f69f0281cf

View File

@@ -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;