aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services
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/Services
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/Services')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs23
-rw-r--r--OpenSim/Services/Interfaces/IAssetService.cs2
2 files changed, 12 insertions, 13 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 32415e9..910c0d7 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -221,7 +221,7 @@ namespace OpenSim.Services.Connectors
221 AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0, 221 AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0,
222 delegate(AssetBase a) 222 delegate(AssetBase a)
223 { 223 {
224 if (m_Cache != null) 224 if (a != null && m_Cache != null)
225 m_Cache.Cache(a); 225 m_Cache.Cache(a);
226 226
227 AssetRetrievedEx handlers; 227 AssetRetrievedEx handlers;
@@ -287,7 +287,7 @@ namespace OpenSim.Services.Connectors
287 287
288 string uri = m_ServerURI + "/assets/"; 288 string uri = m_ServerURI + "/assets/";
289 289
290 string newID = string.Empty; 290 string newID;
291 try 291 try
292 { 292 {
293 newID = SynchronousRestObjectRequester. 293 newID = SynchronousRestObjectRequester.
@@ -295,19 +295,18 @@ namespace OpenSim.Services.Connectors
295 } 295 }
296 catch (Exception e) 296 catch (Exception e)
297 { 297 {
298 m_log.WarnFormat("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1}", asset.ID, e.Message); 298 m_log.Warn(string.Format("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1} ", asset.ID, e.Message), e);
299 return string.Empty;
299 } 300 }
300 301
301 if (newID != String.Empty) 302 if (string.IsNullOrEmpty(newID))
302 { 303 return string.Empty;
303 // Placing this here, so that this work with old asset servers that don't send any reply back 304
304 // SynchronousRestObjectRequester returns somethins that is not an empty string 305 asset.ID = newID;
305 if (newID != null) 306
306 asset.ID = newID; 307 if (m_Cache != null)
308 m_Cache.Cache(asset);
307 309
308 if (m_Cache != null)
309 m_Cache.Cache(asset);
310 }
311 return newID; 310 return newID;
312 } 311 }
313 312
diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs
index 8f1e039..28c3315 100644
--- a/OpenSim/Services/Interfaces/IAssetService.cs
+++ b/OpenSim/Services/Interfaces/IAssetService.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Services.Interfaces
90 /// Returns a random ID if none is passed via the asset argument. 90 /// Returns a random ID if none is passed via the asset argument.
91 /// </remarks> 91 /// </remarks>
92 /// <param name="asset"></param> 92 /// <param name="asset"></param>
93 /// <returns></returns> 93 /// <returns>The Asset ID, or string.Empty if an error occurred</returns>
94 string Store(AssetBase asset); 94 string Store(AssetBase asset);
95 95
96 /// <summary> 96 /// <summary>