add some missing using(...

This commit is contained in:
UbitUmarov
2021-10-14 18:17:28 +01:00
parent 7dc9f14aef
commit 60c99756ed
3 changed files with 16 additions and 12 deletions

View File

@@ -80,16 +80,18 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
try
{
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
m_log.Debug("[WEBLOADER]: Downloading region information...");
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string xmlSource = String.Empty;
string tempStr = reader.ReadLine();
while (tempStr != null)
m_log.Debug("[WEBLOADER]: Downloading region information...");
using (HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse())
using (StreamReader reader = new StreamReader(webResponse.GetResponseStream()))
{
xmlSource = xmlSource + tempStr;
tempStr = reader.ReadLine();
string tempStr;
while ((tempStr = reader.ReadLine()) != null)
{
xmlSource += tempStr;
}
}
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
xmlSource.Length);
XmlDocument xmlDoc = new XmlDocument();

View File

@@ -559,11 +559,13 @@ namespace OpenSim
{
if (File.Exists(fileName))
{
StreamReader readFile = File.OpenText(fileName);
string currentLine;
while ((currentLine = readFile.ReadLine()) != null)
using(StreamReader readFile = File.OpenText(fileName))
{
m_log.Info("[!]" + currentLine);
string currentLine;
while ((currentLine = readFile.ReadLine()) != null)
{
m_log.Info("[!]" + currentLine);
}
}
}
}

View File

@@ -353,7 +353,6 @@ namespace OpenSim
if (startupConfig == null || startupConfig.GetBoolean("JobEngineEnabled", true))
WorkManager.JobEngine.Start();
if(m_networkServersInfo.HttpUsesSSL)
{
m_httpServerSSL = true;
@@ -449,6 +448,7 @@ namespace OpenSim
Scene scene = SetupScene(regionInfo, proxyOffset, Config);
m_log.Info("[REGIONMODULES]: Loading Region's modules");
if (controller != null)
controller.AddRegionToModules(scene);