aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie2010-06-25 20:26:48 +0100
committerMelanie2010-06-25 20:26:48 +0100
commitdc9e9931eb6e1614d2a2a5f8c28941b5d6280103 (patch)
tree57a9714e264575c2b6045db07952495b81adeb6e /OpenSim/Services/Connectors
parentMake "Allow other residents to edit terrain" default to FALSE (diff)
parentfix web request exception reporting properly this time (diff)
downloadopensim-SC_OLD-dc9e9931eb6e1614d2a2a5f8c28941b5d6280103.zip
opensim-SC_OLD-dc9e9931eb6e1614d2a2a5f8c28941b5d6280103.tar.gz
opensim-SC_OLD-dc9e9931eb6e1614d2a2a5f8c28941b5d6280103.tar.bz2
opensim-SC_OLD-dc9e9931eb6e1614d2a2a5f8c28941b5d6280103.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs29
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