aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot
diff options
context:
space:
mode:
authorOren Hurvitz2014-06-01 17:39:11 +0300
committerOren Hurvitz2014-07-21 08:30:03 +0100
commit99ac770abbe3a95887c4b10c82f3985aa878eeef (patch)
tree8c946dab083dd50a352f3861415eca43185d8d95 /OpenSim/Region/DataSnapshot
parentSet "[Terrain]SendTerrainUpdatesByViewDistance=true" by default. (diff)
downloadopensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.zip
opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.gz
opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.bz2
opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.xz
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs35
1 files changed, 19 insertions, 16 deletions
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 4a06f6e..33899aa 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -373,24 +373,27 @@ namespace OpenSim.Region.DataSnapshot
373 for (int i = 0; i < services.Length; i++) 373 for (int i = 0; i < services.Length; i++)
374 { 374 {
375 string url = services[i].Trim(); 375 string url = services[i].Trim();
376 RestClient cli = new RestClient(url); 376 using (RestClient cli = new RestClient(url))
377 cli.AddQueryParameter("service", serviceName);
378 cli.AddQueryParameter("host", m_hostname);
379 cli.AddQueryParameter("port", m_listener_port);
380 cli.AddQueryParameter("secret", m_Secret.ToString());
381 cli.RequestMethod = "GET";
382 try
383 {
384 reply = cli.Request(null);
385 }
386 catch (WebException)
387 { 377 {
388 m_log.Warn("[DATASNAPSHOT]: Unable to notify " + url); 378 cli.AddQueryParameter("service", serviceName);
389 } 379 cli.AddQueryParameter("host", m_hostname);
390 catch (Exception e) 380 cli.AddQueryParameter("port", m_listener_port);
391 { 381 cli.AddQueryParameter("secret", m_Secret.ToString());
392 m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString()); 382 cli.RequestMethod = "GET";
383 try
384 {
385 reply = cli.Request(null);
386 }
387 catch (WebException)
388 {
389 m_log.Warn("[DATASNAPSHOT]: Unable to notify " + url);
390 }
391 catch (Exception e)
392 {
393 m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString());
394 }
393 } 395 }
396
394 byte[] response = new byte[1024]; 397 byte[] response = new byte[1024];
395 // int n = 0; 398 // int n = 0;
396 try 399 try