aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJohn Hurliman2010-06-24 13:43:38 -0700
committerJohn Hurliman2010-06-24 13:43:38 -0700
commit6848465ae24f2069c2cc3e67ff317ad2d085f5cb (patch)
tree5de32ecc585a8457af3a5dc89f1b010412196bb3
parentMove loading of parcels to before script start. Scripts using parcel functions (diff)
downloadopensim-SC_OLD-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.zip
opensim-SC_OLD-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.tar.gz
opensim-SC_OLD-6848465ae24f2069c2cc3e67ff317ad2d085f5cb.tar.bz2
opensim-SC_OLD-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 '')
-rw-r--r--OpenSim/Framework/WebUtil.cs2
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs29
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