aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-02-12 21:32:03 +0000
committerJustin Clark-Casey (justincc)2010-02-12 21:32:03 +0000
commit802a969267da9ed2780ea66c736c3d531e336dfa (patch)
tree85b088d4e9b4cf3dbb800845a27cf8f42e6e4094 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
parentAdd missing refernce to prebuild (backport from presence-refactor) (diff)
downloadopensim-SC_OLD-802a969267da9ed2780ea66c736c3d531e336dfa.zip
opensim-SC_OLD-802a969267da9ed2780ea66c736c3d531e336dfa.tar.gz
opensim-SC_OLD-802a969267da9ed2780ea66c736c3d531e336dfa.tar.bz2
opensim-SC_OLD-802a969267da9ed2780ea66c736c3d531e336dfa.tar.xz
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.
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs48
1 files changed, 27 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
index fd3aaf4..2f21e6d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs
@@ -38,12 +38,9 @@ using OpenSim.Services.Interfaces;
38 38
39namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset 39namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
40{ 40{
41 public class LocalAssetServicesConnector : 41 public class LocalAssetServicesConnector : ISharedRegionModule, IAssetService
42 ISharedRegionModule, IAssetService
43 { 42 {
44 private static readonly ILog m_log = 43 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 LogManager.GetLogger(
46 MethodBase.GetCurrentMethod().DeclaringType);
47 44
48 private IImprovedAssetCache m_Cache = null; 45 private IImprovedAssetCache m_Cache = null;
49 46
@@ -72,7 +69,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
72 IConfig assetConfig = source.Configs["AssetService"]; 69 IConfig assetConfig = source.Configs["AssetService"];
73 if (assetConfig == null) 70 if (assetConfig == null)
74 { 71 {
75 m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); 72 m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: AssetService missing from OpenSim.ini");
76 return; 73 return;
77 } 74 }
78 75
@@ -81,22 +78,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
81 78
82 if (serviceDll == String.Empty) 79 if (serviceDll == String.Empty)
83 { 80 {
84 m_log.Error("[ASSET CONNECTOR]: No LocalServiceModule named in section AssetService"); 81 m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService");
85 return; 82 return;
86 } 83 }
87 84
88 Object[] args = new Object[] { source }; 85 Object[] args = new Object[] { source };
89 m_AssetService = 86 m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args);
90 ServerUtils.LoadPlugin<IAssetService>(serviceDll,
91 args);
92 87
93 if (m_AssetService == null) 88 if (m_AssetService == null)
94 { 89 {
95 m_log.Error("[ASSET CONNECTOR]: Can't load asset service"); 90 m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: Can't load asset service");
96 return; 91 return;
97 } 92 }
98 m_Enabled = true; 93 m_Enabled = true;
99 m_log.Info("[ASSET CONNECTOR]: Local asset connector enabled"); 94 m_log.Info("[LOCAL ASSET SERVICES CONNECTOR]: Local asset connector enabled");
100 } 95 }
101 } 96 }
102 } 97 }
@@ -134,11 +129,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
134 m_Cache = null; 129 m_Cache = null;
135 } 130 }
136 131
137 m_log.InfoFormat("[ASSET CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName); 132 m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled local assets for region {0}", scene.RegionInfo.RegionName);
138 133
139 if (m_Cache != null) 134 if (m_Cache != null)
140 { 135 {
141 m_log.InfoFormat("[ASSET CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName); 136 m_log.InfoFormat("[LOCAL ASSET SERVICES CONNECTOR]: Enabled asset caching for region {0}", scene.RegionInfo.RegionName);
142 } 137 }
143 else 138 else
144 { 139 {
@@ -151,6 +146,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
151 146
152 public AssetBase Get(string id) 147 public AssetBase Get(string id)
153 { 148 {
149// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Synchronously requesting asset {0}", id);
150
154 AssetBase asset = null; 151 AssetBase asset = null;
155 if (m_Cache != null) 152 if (m_Cache != null)
156 asset = m_Cache.Get(id); 153 asset = m_Cache.Get(id);
@@ -160,7 +157,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
160 asset = m_AssetService.Get(id); 157 asset = m_AssetService.Get(id);
161 if ((m_Cache != null) && (asset != null)) 158 if ((m_Cache != null) && (asset != null))
162 m_Cache.Cache(asset); 159 m_Cache.Cache(asset);
160
161// if (null == asset)
162// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not synchronously find asset with id {0}", id);
163 } 163 }
164
164 return asset; 165 return asset;
165 } 166 }
166 167
@@ -204,15 +205,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
204 205
205 public bool Get(string id, Object sender, AssetRetrieved handler) 206 public bool Get(string id, Object sender, AssetRetrieved handler)
206 { 207 {
207 AssetBase asset = null; 208// m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id);
208 209
209 if (m_Cache != null) 210 if (m_Cache != null)
210 m_Cache.Get(id);
211
212 if (asset != null)
213 { 211 {
214 Util.FireAndForget(delegate { handler(id, sender, asset); }); 212 AssetBase asset = m_Cache.Get(id);
215 return true; 213
214 if (asset != null)
215 {
216 Util.FireAndForget(delegate { handler(id, sender, asset); });
217 return true;
218 }
216 } 219 }
217 220
218 return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a) 221 return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a)
@@ -220,6 +223,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
220 if ((a != null) && (m_Cache != null)) 223 if ((a != null) && (m_Cache != null))
221 m_Cache.Cache(a); 224 m_Cache.Cache(a);
222 225
226// if (null == a)
227// m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);
228
223 Util.FireAndForget(delegate { handler(assetID, s, a); }); 229 Util.FireAndForget(delegate { handler(assetID, s, a); });
224 }); 230 });
225 } 231 }