mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Make sure we dispose of WebResponse, StreamReader and Stream in various places where we were not already.
This commit is contained in:
@@ -168,22 +168,27 @@ namespace OpenSim.Services.Connectors
|
||||
// Let's wait for the response
|
||||
//m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall");
|
||||
|
||||
StreamReader sr = null;
|
||||
try
|
||||
{
|
||||
WebResponse webResponse = helloNeighbourRequest.GetResponse();
|
||||
if (webResponse == null)
|
||||
using (WebResponse webResponse = helloNeighbourRequest.GetResponse())
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[REST COMMS]: Null reply on DoHelloNeighbourCall post from {0} to {1}",
|
||||
thisRegion.RegionName, region.RegionName);
|
||||
if (webResponse == null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[REST COMMS]: Null reply on DoHelloNeighbourCall post from {0} to {1}",
|
||||
thisRegion.RegionName, region.RegionName);
|
||||
}
|
||||
|
||||
using (Stream s = webResponse.GetResponseStream())
|
||||
{
|
||||
using (StreamReader sr = new StreamReader(s))
|
||||
{
|
||||
//reply = sr.ReadToEnd().Trim();
|
||||
sr.ReadToEnd().Trim();
|
||||
//m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sr = new StreamReader(webResponse.GetResponseStream());
|
||||
//reply = sr.ReadToEnd().Trim();
|
||||
sr.ReadToEnd().Trim();
|
||||
//m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -193,11 +198,6 @@ namespace OpenSim.Services.Connectors
|
||||
|
||||
return false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (sr != null)
|
||||
sr.Close();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user