aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-18 16:21:59 +0300
committerOren Hurvitz2014-04-20 06:23:38 +0100
commit3f76f721372496011efc9328783f9f446b91a92b (patch)
treef18d8962103e902003a1ce6899b71f652cdad44d /OpenSim/Region/CoreModules
parentStopped setting the Service URL "GatekeeperURI" on users' accounts. It isn't ... (diff)
downloadopensim-SC_OLD-3f76f721372496011efc9328783f9f446b91a92b.zip
opensim-SC_OLD-3f76f721372496011efc9328783f9f446b91a92b.tar.gz
opensim-SC_OLD-3f76f721372496011efc9328783f9f446b91a92b.tar.bz2
opensim-SC_OLD-3f76f721372496011efc9328783f9f446b91a92b.tar.xz
Better error-handling when storing assets: recognize that 'null' is an error value
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs2
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs19
2 files changed, 9 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index 532bc74..cbf32ad 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -143,7 +143,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
143 asset1.Data = asset.Data; 143 asset1.Data = asset.Data;
144 144
145 string id = m_scene.AssetService.Store(asset1); 145 string id = m_scene.AssetService.Store(asset1);
146 if (id == string.Empty) 146 if (String.IsNullOrEmpty(id))
147 { 147 {
148 m_log.DebugFormat("[HG ASSET MAPPER]: Failed to post asset {0} to asset server {1}: the server did not accept the asset", asset.ID, url); 148 m_log.DebugFormat("[HG ASSET MAPPER]: Failed to post asset {0} to asset server {1}: the server did not accept the asset", asset.ID, url);
149 success = false; 149 success = false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index ff8b051..38862ca 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -346,7 +346,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
346 return asset.ID; 346 return asset.ID;
347 } 347 }
348 348
349 string id = string.Empty; 349 string id;
350 if (IsHG(asset.ID)) 350 if (IsHG(asset.ID))
351 { 351 {
352 if (m_AssetPerms.AllowedExport(asset.Type)) 352 if (m_AssetPerms.AllowedExport(asset.Type))
@@ -357,18 +357,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
357 else 357 else
358 id = m_GridService.Store(asset); 358 id = m_GridService.Store(asset);
359 359
360 if (id != String.Empty) 360 if (String.IsNullOrEmpty(id))
361 { 361 return string.Empty;
362 // Placing this here, so that this work with old asset servers that don't send any reply back 362
363 // SynchronousRestObjectRequester returns somethins that is not an empty string 363 asset.ID = id;
364 if (id != null)
365 asset.ID = id;
366 364
367 if (m_Cache != null) 365 if (m_Cache != null)
368 m_Cache.Cache(asset); 366 m_Cache.Cache(asset);
369 }
370 return id;
371 367
368 return id;
372 } 369 }
373 370
374 public bool UpdateContent(string id, byte[] data) 371 public bool UpdateContent(string id, byte[] data)