mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +08:00
Close streams immediately when we finish using them
This commit is contained in:
@@ -373,24 +373,27 @@ namespace OpenSim.Region.DataSnapshot
|
||||
for (int i = 0; i < services.Length; i++)
|
||||
{
|
||||
string url = services[i].Trim();
|
||||
RestClient cli = new RestClient(url);
|
||||
cli.AddQueryParameter("service", serviceName);
|
||||
cli.AddQueryParameter("host", m_hostname);
|
||||
cli.AddQueryParameter("port", m_listener_port);
|
||||
cli.AddQueryParameter("secret", m_Secret.ToString());
|
||||
cli.RequestMethod = "GET";
|
||||
try
|
||||
using (RestClient cli = new RestClient(url))
|
||||
{
|
||||
reply = cli.Request(null);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
m_log.Warn("[DATASNAPSHOT]: Unable to notify " + url);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString());
|
||||
cli.AddQueryParameter("service", serviceName);
|
||||
cli.AddQueryParameter("host", m_hostname);
|
||||
cli.AddQueryParameter("port", m_listener_port);
|
||||
cli.AddQueryParameter("secret", m_Secret.ToString());
|
||||
cli.RequestMethod = "GET";
|
||||
try
|
||||
{
|
||||
reply = cli.Request(null);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
m_log.Warn("[DATASNAPSHOT]: Unable to notify " + url);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
byte[] response = new byte[1024];
|
||||
// int n = 0;
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user