some cleanup

0.9.1.0-post-fixes
UbitUmarov 2018-07-14 14:22:52 +01:00
parent 770f59ff87
commit f17b48e73e
1 changed files with 27 additions and 31 deletions

View File

@ -132,8 +132,6 @@ namespace OpenSim.Capabilities.Handlers
private bool FetchTexture(IOSHttpRequest httpRequest, IOSHttpResponse httpResponse, UUID textureID, string format)
{
// m_log.DebugFormat("[GETTEXTURE]: {0} with requested format {1}", textureID, format);
AssetBase texture;
if(!String.IsNullOrEmpty(m_RedirectURL))
{
string textureUrl = m_RedirectURL + "?texture_id=" + textureID.ToString();
@ -142,9 +140,9 @@ namespace OpenSim.Capabilities.Handlers
httpResponse.RedirectLocation = textureUrl;
return true;
}
else // no redirect
{
texture = m_assetService.Get(textureID.ToString());
// Fetch, Misses or invalid return a 404
AssetBase texture = m_assetService.Get(textureID.ToString());
if (texture != null)
{
if (texture.Type != (sbyte)AssetType.Texture)
@ -157,8 +155,8 @@ namespace OpenSim.Capabilities.Handlers
WriteTextureData(httpRequest, httpResponse, texture, format);
return true;
}
else
{
// need to convert format
AssetBase newTexture = new AssetBase(texture.ID + "-" + format, texture.Name, (sbyte)AssetType.Texture, texture.Metadata.CreatorID);
newTexture.Data = ConvertTextureData(texture, format);
if (newTexture.Data.Length == 0)
@ -170,8 +168,6 @@ namespace OpenSim.Capabilities.Handlers
WriteTextureData(httpRequest, httpResponse, newTexture, format);
return true;
}
}
}
// not found
// m_log.Warn("[GETTEXTURE]: Texture " + textureID + " not found");