* SimianAssetServiceConnector Delete() was expecting the wrong type of response, reporting false errors
* Fixed a typo in a WebUtil error message0.7-release
parent
4f59a865af
commit
31b7279095
|
@ -114,7 +114,7 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
m_log.Warn("GET from URL " + url + " failed: " + ex.Message);
|
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
|
||||||
errorMessage = ex.Message;
|
errorMessage = ex.Message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -371,18 +371,33 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Delete(string id)
|
public bool Delete(string id)
|
||||||
{
|
{
|
||||||
|
string errorMessage = String.Empty;
|
||||||
|
string url = m_serverUrl + id;
|
||||||
|
|
||||||
if (m_cache != null)
|
if (m_cache != null)
|
||||||
m_cache.Expire(id);
|
m_cache.Expire(id);
|
||||||
|
|
||||||
string url = m_serverUrl + id;
|
try
|
||||||
|
{
|
||||||
|
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||||
|
request.Method = "DELETE";
|
||||||
|
|
||||||
|
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
|
||||||
|
{
|
||||||
|
if (response.StatusCode != HttpStatusCode.NoContent)
|
||||||
|
{
|
||||||
|
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Unexpected response when deleting asset " + url + ": " +
|
||||||
|
response.StatusCode + " (" + response.StatusDescription + ")");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
OSDMap response = WebUtil.ServiceRequest(url, "DELETE");
|
|
||||||
if (response["Success"].AsBoolean())
|
|
||||||
return true;
|
return true;
|
||||||
else
|
}
|
||||||
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service");
|
catch (Exception ex)
|
||||||
|
{
|
||||||
return false;
|
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service: " + ex.Message);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion IAssetService
|
#endregion IAssetService
|
||||||
|
|
Loading…
Reference in New Issue