If a map request to a server fails, always close the outbound connection.

This probably doesn't help with the current memory leak.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-12 23:40:22 +01:00
parent ed142ead25
commit 78ff82bfe9

View File

@@ -682,7 +682,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
mapitemsrequest.ContentLength = buffer.Length; //Count bytes to send
os = mapitemsrequest.GetRequestStream();
os.Write(buffer, 0, buffer.Length); //Send it
os.Close();
//m_log.DebugFormat("[WORLD MAP]: Getting MapItems from {0}", httpserver);
}
catch (WebException ex)
@@ -705,6 +704,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
responseMap["connect"] = OSD.FromBoolean(false);
return responseMap;
}
finally
{
if (os != null)
os.Close();
}
string response_mapItems_reply = null;
{ // get the response