diff options
author | John Hurliman | 2010-06-24 13:43:38 -0700 |
---|---|---|
committer | John Hurliman | 2010-06-24 13:43:38 -0700 |
commit | 6848465ae24f2069c2cc3e67ff317ad2d085f5cb (patch) | |
tree | 5de32ecc585a8457af3a5dc89f1b010412196bb3 /OpenSim/Services/Connectors | |
parent | Move loading of parcels to before script start. Scripts using parcel functions (diff) | |
download | opensim-SC-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.zip opensim-SC-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.tar.gz opensim-SC-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.tar.bz2 opensim-SC-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.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 'OpenSim/Services/Connectors')
-rw-r--r-- | OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | 29 |
1 files changed, 22 insertions, 7 deletions
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 |