From 802a969267da9ed2780ea66c736c3d531e336dfa Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 12 Feb 2010 21:32:03 +0000
Subject: Fix http://opensimulator.org/mantis/view.php?id=4224 This resolves
the problem where eyes and hair would turn white on standalone configurations
When a client receives body part information, for some insane reason or other
it always ends up uploading this back to the server and then immediately
re-requesting it. This should have been okay since we stored that asset in
cache. However, the standalone asset service connector was not checking this
cache properly, so every time the client made the request for the asset it
has just loaded it would get a big fat null back in the face, causing it to
make clothes and hair white. This bug did not affect grids since they use a
different service connector.
---
.../Region/CoreModules/Asset/CenomeAssetCache.cs | 27 +++++++++++-----------
1 file changed, 14 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/CoreModules/Asset')
diff --git a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
index 1add0ab..1903eb9 100644
--- a/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/CenomeAssetCache.cs
@@ -91,6 +91,8 @@ namespace OpenSim.Region.CoreModules.Asset
///
public class CenomeMemoryAssetCache : IImprovedAssetCache, ISharedRegionModule
{
+ private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
+
///
/// Cache's default maximal asset count.
///
@@ -115,12 +117,7 @@ namespace OpenSim.Region.CoreModules.Asset
/// Asset's default expiration time in the cache.
///
public static readonly TimeSpan DefaultExpirationTime = TimeSpan.FromMinutes(30.0);
-
- ///
- /// Log manager instance.
- ///
- private static readonly ILog Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
-
+
///
/// Cache object.
///
@@ -170,7 +167,7 @@ namespace OpenSim.Region.CoreModules.Asset
{
if (maximalSize <= 0 || maximalCount <= 0)
{
- //Log.Debug("[ASSET CACHE]: Cenome asset cache is not enabled.");
+ //m_log.Debug("[ASSET CACHE]: Cenome asset cache is not enabled.");
m_enabled = false;
return;
}
@@ -186,7 +183,7 @@ namespace OpenSim.Region.CoreModules.Asset
CnmSynchronizedCache.Synchronized(new CnmMemoryCache(
maximalSize, maximalCount, expirationTime));
m_enabled = true;
- Log.DebugFormat(
+ m_log.DebugFormat(
"[ASSET CACHE]: Cenome asset cache enabled (MaxSize = {0} bytes, MaxCount = {1}, ExpirationTime = {2})",
maximalSize,
maximalCount,
@@ -205,6 +202,8 @@ namespace OpenSim.Region.CoreModules.Asset
{
if (asset != null)
{
+// m_log.DebugFormat("[CENOME ASSET CACHE]: Caching asset {0}", asset.ID);
+
long size = asset.Data != null ? asset.Data.Length : 1;
m_cache.Set(asset.ID, asset, size);
m_cachedCount++;
@@ -255,7 +254,7 @@ namespace OpenSim.Region.CoreModules.Asset
if (m_getCount == m_debugEpoch)
{
- Log.DebugFormat(
+ m_log.DebugFormat(
"[ASSET CACHE]: Cached = {0}, Get = {1}, Hits = {2}%, Size = {3} bytes, Avg. A. Size = {4} bytes",
m_cachedCount,
m_getCount,
@@ -267,6 +266,9 @@ namespace OpenSim.Region.CoreModules.Asset
m_cachedCount = 0;
}
+// if (null == assetBase)
+// m_log.DebugFormat("[CENOME ASSET CACHE]: Asset {0} not in cache", id);
+
return assetBase;
}
@@ -325,12 +327,11 @@ namespace OpenSim.Region.CoreModules.Asset
return;
string name = moduleConfig.GetString("AssetCaching");
- //Log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
+ //m_log.DebugFormat("[XXX] name = {0} (this module's name: {1}", name, Name);
if (name != Name)
- return;
-
- // This module is used
+ return;
+
long maxSize = DefaultMaxSize;
int maxCount = DefaultMaxCount;
TimeSpan expirationTime = DefaultExpirationTime;
--
cgit v1.1