diff options
author | John Hurliman | 2010-06-24 13:43:38 -0700 |
---|---|---|
committer | John Hurliman | 2010-06-24 13:44:34 -0700 |
commit | 31b72790953a7323f2e4ad30a281c47b2253b6e0 (patch) | |
tree | 6a11fb5108153cf9fb192b0cfbb032a34e3752d5 | |
parent | * Fixed SimianGrid map tile uploads not having any objects in the images (diff) | |
download | opensim-SC-31b72790953a7323f2e4ad30a281c47b2253b6e0.zip opensim-SC-31b72790953a7323f2e4ad30a281c47b2253b6e0.tar.gz opensim-SC-31b72790953a7323f2e4ad30a281c47b2253b6e0.tar.bz2 opensim-SC-31b72790953a7323f2e4ad30a281c47b2253b6e0.tar.xz |
* SimianAssetServiceConnector Delete() was expecting the wrong type of response, reporting false errors
* Fixed a typo in a WebUtil error message
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 2 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 29 |
2 files changed, 23 insertions, 8 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 94862a6..e20866e 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -114,7 +114,7 @@ namespace OpenSim.Framework | |||
114 | } | 114 | } |
115 | catch (Exception ex) | 115 | catch (Exception ex) |
116 | { | 116 | { |
117 | m_log.Warn("GET from URL " + url + " failed: " + ex.Message); | 117 | m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message); |
118 | errorMessage = ex.Message; | 118 | errorMessage = ex.Message; |
119 | } | 119 | } |
120 | 120 | ||
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 3fdee9c..34bb8b3 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
371 | /// <returns></returns> | 371 | /// <returns></returns> |
372 | public bool Delete(string id) | 372 | public bool Delete(string id) |
373 | { | 373 | { |
374 | string errorMessage = String.Empty; | ||
375 | string url = m_serverUrl + id; | ||
376 | |||
374 | if (m_cache != null) | 377 | if (m_cache != null) |
375 | m_cache.Expire(id); | 378 | m_cache.Expire(id); |
376 | 379 | ||
377 | string url = m_serverUrl + id; | 380 | try |
381 | { | ||
382 | HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); | ||
383 | request.Method = "DELETE"; | ||
378 | 384 | ||
379 | OSDMap response = WebUtil.ServiceRequest(url, "DELETE"); | 385 | using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) |
380 | if (response["Success"].AsBoolean()) | 386 | { |
381 | return true; | 387 | if (response.StatusCode != HttpStatusCode.NoContent) |
382 | else | 388 | { |
383 | m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service"); | 389 | m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " + |
390 | response.StatusCode + " (" + response.StatusDescription + ")"); | ||
391 | } | ||
392 | } | ||
384 | 393 | ||
385 | return false; | 394 | return true; |
395 | } | ||
396 | catch (Exception ex) | ||
397 | { | ||
398 | m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message); | ||
399 | return false; | ||
400 | } | ||
386 | } | 401 | } |
387 | 402 | ||
388 | #endregion IAssetService | 403 | #endregion IAssetService |