From 3ca1481c3da08f7da68ec9a1007587389e10d37f Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Thu, 26 Mar 2009 06:56:10 +0000 Subject: * Minor fixes, inverted an if for readability and introduced a virtual pre-process step on the asset cache --- .../Framework/Communications/Cache/AssetCache.cs | 24 ++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index bd0b1b1..d79645e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -333,6 +333,9 @@ namespace OpenSim.Framework.Communications.Cache public virtual void AssetReceived(AssetBase asset, bool IsTexture) { AssetInfo assetInf = new AssetInfo(asset); + + ProcessRecievedAsset(IsTexture, assetInf); + if (!m_memcache.Contains(assetInf.FullID)) { m_memcache.AddOrUpdate(assetInf.FullID, assetInf, TimeSpan.FromHours(24)); @@ -347,10 +350,19 @@ namespace OpenSim.Framework.Communications.Cache req.NumPackets = CalculateNumPackets(assetInf.Data); RequestedAssets.Remove(assetInf.FullID); - // If it's a direct request for a script, drop it - // because it's a hacked client - if (req.AssetRequestSource != 2 || assetInf.Type != 10) - lock(AssetRequests) AssetRequests.Add(req); + + if (req.AssetRequestSource == 2 && assetInf.Type == 10) + { + // If it's a direct request for a script, drop it + // because it's a hacked client + } + else + { + lock (AssetRequests) + { + AssetRequests.Add(req); + } + } } } @@ -377,6 +389,10 @@ namespace OpenSim.Framework.Communications.Cache } } + protected void ProcessRecievedAsset(bool IsTexture, AssetInfo assetInf) + { + } + // See IAssetReceiver public virtual void AssetNotFound(UUID assetID, bool IsTexture) { -- cgit v1.1