From 805deb5a9ba51307393dc5e11b100c86ee7c1b79 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 31 Aug 2008 10:42:35 +0000 Subject: 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. --- OpenSim/Framework/Communications/RestClient.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications/RestClient.cs') diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index b71a590..7d45186 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs @@ -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) -- cgit v1.1