aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-31 10:42:35 +0000
committerMelanie Thielker2008-08-31 10:42:35 +0000
commit805deb5a9ba51307393dc5e11b100c86ee7c1b79 (patch)
tree3ea5d5aa6f720a8112e3c55d912291d18e13b084 /OpenSim/Framework/Communications
parent* Pragma out deprecation warning and comment out to remove other warnings in ... (diff)
downloadopensim-SC-805deb5a9ba51307393dc5e11b100c86ee7c1b79.zip
opensim-SC-805deb5a9ba51307393dc5e11b100c86ee7c1b79.tar.gz
opensim-SC-805deb5a9ba51307393dc5e11b100c86ee7c1b79.tar.bz2
opensim-SC-805deb5a9ba51307393dc5e11b100c86ee7c1b79.tar.xz
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.
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r--OpenSim/Framework/Communications/Cache/GridAssetClient.cs3
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs13
2 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
index 9cccf66..1c947dc 100644
--- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
+++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs
@@ -63,6 +63,9 @@ namespace OpenSim.Framework.Communications.Cache
63 63
64 Stream s = rc.Request(); 64 Stream s = rc.Request();
65 65
66 if (s == null)
67 return null;
68
66 if (s.Length > 0) 69 if (s.Length > 0)
67 { 70 {
68 XmlSerializer xs = new XmlSerializer(typeof (AssetBase)); 71 XmlSerializer xs = new XmlSerializer(typeof (AssetBase));
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
286 _asyncException = null; 286 _asyncException = null;
287 287
288// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); 288// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
289 _response = (HttpWebResponse) _request.GetResponse(); 289 try
290 {
291 _response = (HttpWebResponse) _request.GetResponse();
292 }
293 catch (System.Net.WebException e)
294 {
295 m_log.ErrorFormat("[ASSET] Error fetching asset from asset server");
296 m_log.Debug(e.ToString());
297
298 return null;
299 }
300
290 Stream src = _response.GetResponseStream(); 301 Stream src = _response.GetResponseStream();
291 int length = src.Read(_readbuf, 0, BufferSize); 302 int length = src.Read(_readbuf, 0, BufferSize);
292 while (length > 0) 303 while (length > 0)