diff options
author | Oren Hurvitz | 2014-06-01 17:39:11 +0300 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:55:57 +0100 |
commit | e41e52e09727842d990a31e2a5f7f3e9c88fe8b3 (patch) | |
tree | 5779c9f42cd913f63e2d237b5a407214933585db /OpenSim/Region/DataSnapshot | |
parent | Add code to GridService to check for overlapping of varregions (diff) | |
download | opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.zip opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.gz opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.bz2 opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.xz |
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r-- | OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 35 |
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 |