Attempt to fix an issue I havebeen seeing, where asset server failure

results in a memory leak which will make the region crash and burn
after a while.
0.6.0-stable
Melanie Thielker 2008-08-31 10:42:35 +00:00
parent cd5f8cf9ec
commit 805deb5a9b
2 changed files with 15 additions and 1 deletions

View File

@ -63,6 +63,9 @@ namespace OpenSim.Framework.Communications.Cache
Stream s = rc.Request();
if (s == null)
return null;
if (s.Length > 0)
{
XmlSerializer xs = new XmlSerializer(typeof (AssetBase));

View File

@ -286,7 +286,18 @@ namespace OpenSim.Framework.Communications
_asyncException = null;
// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
_response = (HttpWebResponse) _request.GetResponse();
try
{
_response = (HttpWebResponse) _request.GetResponse();
}
catch (System.Net.WebException e)
{
m_log.ErrorFormat("[ASSET] Error fetching asset from asset server");
m_log.Debug(e.ToString());
return null;
}
Stream src = _response.GetResponseStream();
int length = src.Read(_readbuf, 0, BufferSize);
while (length > 0)