diff options
Diffstat (limited to 'OpenSim/Services')
-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 |