From 1cb7695fb0bcdcbdbb6f2a410fd9f337438afef7 Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:48:02 -0700 Subject: [PATCH 1/3] Catch newid == null which is what happens if the asset service is offline (seems a connection failure does not throw an exception) --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index ae600bb6e7..bc56963991 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -271,6 +271,10 @@ namespace OpenSim.Services.Connectors { newID = SynchronousRestObjectRequester. MakeRequest("POST", uri, asset); + if (newID == null) + { + newID = UUID.Zero.ToString(); + } } catch (Exception e) { From 38384cc79c04fe9b97070104283be02511c4e12c Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:52:30 -0700 Subject: [PATCH 2/3] Report asset upload success if it has previously failed --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index bc56963991..bbccef9788 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -305,6 +305,10 @@ namespace OpenSim.Services.Connectors } else { + if (asset.UploadAttempts > 0) + { + m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString())); + } if (newID != String.Empty) { // Placing this here, so that this work with old asset servers that don't send any reply back From b38a22506b31041e29a1271db32046efcb14af4e Mon Sep 17 00:00:00 2001 From: Tom Grimshaw Date: Thu, 1 Jul 2010 08:55:52 -0700 Subject: [PATCH 3/3] Fix build break --- OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs index bbccef9788..94acd6cc66 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServiceConnector.cs @@ -307,7 +307,7 @@ namespace OpenSim.Services.Connectors { if (asset.UploadAttempts > 0) { - m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString())); + m_log.InfoFormat("[Assets] Upload of {0} succeeded after {1} failed attempts", asset.ID.ToString(), asset.UploadAttempts.ToString()); } if (newID != String.Empty) {