diff options
author | Melanie Thielker | 2017-02-01 16:31:01 +0000 |
---|---|---|
committer | Melanie Thielker | 2017-02-01 16:31:01 +0000 |
commit | a5151bb337cfee14dff6045d7f8e293201ae94ac (patch) | |
tree | f301338415da7160e48efcb4dc6cd1efc7faecaf /OpenSim/Region/CoreModules/ServiceConnectorsOut | |
parent | Secure sim stats with an (optional) password. (diff) | |
download | opensim-SC_OLD-a5151bb337cfee14dff6045d7f8e293201ae94ac.zip opensim-SC_OLD-a5151bb337cfee14dff6045d7f8e293201ae94ac.tar.gz opensim-SC_OLD-a5151bb337cfee14dff6045d7f8e293201ae94ac.tar.bz2 opensim-SC_OLD-a5151bb337cfee14dff6045d7f8e293201ae94ac.tar.xz |
Refactor asset handling as per Ubit's suggestion
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | 27 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | 17 |
2 files changed, 12 insertions, 32 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index ce61ff0..bf9327c 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -209,10 +209,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
209 | 209 | ||
210 | if (m_Cache != null) | 210 | if (m_Cache != null) |
211 | { | 211 | { |
212 | bool negative; | 212 | if (!m_Cache.Get(id, out asset)) |
213 | asset = m_Cache.Get(id, out negative); | ||
214 | |||
215 | if (negative) | ||
216 | return null; | 213 | return null; |
217 | 214 | ||
218 | if (asset != null) | 215 | if (asset != null) |
@@ -242,9 +239,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
242 | 239 | ||
243 | public AssetBase GetCached(string id) | 240 | public AssetBase GetCached(string id) |
244 | { | 241 | { |
245 | bool negative; | 242 | AssetBase asset = null; |
246 | if (m_Cache != null) | 243 | if (m_Cache != null) |
247 | return m_Cache.Get(id, out negative); | 244 | m_Cache.Get(id, out asset); |
248 | 245 | ||
249 | return null; | 246 | return null; |
250 | } | 247 | } |
@@ -255,10 +252,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
255 | 252 | ||
256 | if (m_Cache != null) | 253 | if (m_Cache != null) |
257 | { | 254 | { |
258 | bool negative; | 255 | if (!m_Cache.Get(id, out asset)) |
259 | asset = m_Cache.Get(id, out negative); | ||
260 | |||
261 | if (negative) | ||
262 | return null; | 256 | return null; |
263 | 257 | ||
264 | if (asset != null) | 258 | if (asset != null) |
@@ -281,10 +275,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
281 | 275 | ||
282 | if (m_Cache != null) | 276 | if (m_Cache != null) |
283 | { | 277 | { |
284 | bool negative; | 278 | if (!m_Cache.Get(id, out asset)) |
285 | asset = m_Cache.Get(id, out negative); | ||
286 | |||
287 | if (negative) | ||
288 | return null; | 279 | return null; |
289 | 280 | ||
290 | if (asset != null) | 281 | if (asset != null) |
@@ -304,10 +295,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
304 | 295 | ||
305 | if (m_Cache != null) | 296 | if (m_Cache != null) |
306 | { | 297 | { |
307 | bool negative; | 298 | if (!m_Cache.Get(id, out asset)) |
308 | asset = m_Cache.Get(id, out negative); | ||
309 | |||
310 | if (negative) | ||
311 | return false; | 299 | return false; |
312 | } | 300 | } |
313 | 301 | ||
@@ -398,9 +386,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
398 | { | 386 | { |
399 | AssetBase asset = null; | 387 | AssetBase asset = null; |
400 | 388 | ||
401 | bool negative; | ||
402 | if (m_Cache != null) | 389 | if (m_Cache != null) |
403 | asset = m_Cache.Get(id, out negative); | 390 | m_Cache.Get(id, out asset); |
404 | 391 | ||
405 | if (asset != null) | 392 | if (asset != null) |
406 | { | 393 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index bbaed21..2fe9733 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -159,10 +159,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
159 | AssetBase asset = null; | 159 | AssetBase asset = null; |
160 | if (m_Cache != null) | 160 | if (m_Cache != null) |
161 | { | 161 | { |
162 | bool negative; | 162 | if (!m_Cache.Get(id, out asset)) |
163 | asset = m_Cache.Get(id, out negative); | ||
164 | |||
165 | if (negative) | ||
166 | return null; | 163 | return null; |
167 | } | 164 | } |
168 | 165 | ||
@@ -183,13 +180,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
183 | { | 180 | { |
184 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id); | 181 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Cache request for {0}", id); |
185 | 182 | ||
183 | AssetBase asset = null; | ||
186 | if (m_Cache != null) | 184 | if (m_Cache != null) |
187 | { | 185 | m_Cache.Get(id, out asset); |
188 | bool negative; | ||
189 | return m_Cache.Get(id, out negative); | ||
190 | } | ||
191 | 186 | ||
192 | return null; | 187 | return asset; |
193 | } | 188 | } |
194 | 189 | ||
195 | public AssetMetadata GetMetadata(string id) | 190 | public AssetMetadata GetMetadata(string id) |
@@ -197,9 +192,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
197 | AssetBase asset = null; | 192 | AssetBase asset = null; |
198 | if (m_Cache != null) | 193 | if (m_Cache != null) |
199 | { | 194 | { |
200 | bool negative; | 195 | if (!m_Cache.Get(id, out asset)) |
201 | asset = m_Cache.Get(id, out negative); | ||
202 | if (negative) | ||
203 | return null; | 196 | return null; |
204 | } | 197 | } |
205 | 198 | ||