diff options
4 files changed, 21 insertions, 25 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) |
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> |