aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/RegionLoader
diff options
context:
space:
mode:
authorDiva Canto2013-02-27 20:50:03 -0800
committerDiva Canto2013-02-27 20:50:03 -0800
commit64b8ce73dabcf651beadcc11cbe94db69cc3ea0e (patch)
treeab7f3a63c166185a5fd9d6d5a7e36a18d63a9817 /OpenSim/Framework/RegionLoader
parentMoved the HG default variables out of [Startup] and into their own section [H... (diff)
parentAdd comment to example region modules about need to add Assembly annotation i... (diff)
downloadopensim-SC_OLD-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.zip
opensim-SC_OLD-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.gz
opensim-SC_OLD-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.bz2
opensim-SC_OLD-64b8ce73dabcf651beadcc11cbe94db69cc3ea0e.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Framework/RegionLoader')
-rw-r--r--OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs41
1 files changed, 29 insertions, 12 deletions
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
index a2f5d9c..05c64fa 100644
--- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
+++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs
@@ -74,16 +74,26 @@ namespace OpenSim.Framework.RegionLoader.Web
74 74
75 try 75 try
76 { 76 {
77 HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
78 m_log.Debug("[WEBLOADER]: Downloading region information...");
79 StreamReader reader = new StreamReader(webResponse.GetResponseStream());
80 string xmlSource = String.Empty; 77 string xmlSource = String.Empty;
81 string tempStr = reader.ReadLine(); 78
82 while (tempStr != null) 79 using (HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse())
83 { 80 {
84 xmlSource = xmlSource + tempStr; 81 m_log.Debug("[WEBLOADER]: Downloading region information...");
85 tempStr = reader.ReadLine(); 82
83 using (Stream s = webResponse.GetResponseStream())
84 {
85 using (StreamReader reader = new StreamReader(s))
86 {
87 string tempStr = reader.ReadLine();
88 while (tempStr != null)
89 {
90 xmlSource = xmlSource + tempStr;
91 tempStr = reader.ReadLine();
92 }
93 }
94 }
86 } 95 }
96
87 m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " + 97 m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
88 xmlSource.Length); 98 xmlSource.Length);
89 XmlDocument xmlDoc = new XmlDocument(); 99 XmlDocument xmlDoc = new XmlDocument();
@@ -107,17 +117,24 @@ namespace OpenSim.Framework.RegionLoader.Web
107 } 117 }
108 catch (WebException ex) 118 catch (WebException ex)
109 { 119 {
110 if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound) 120 using (HttpWebResponse response = (HttpWebResponse)ex.Response)
111 { 121 {
112 if (!allowRegionless) 122 if (response.StatusCode == HttpStatusCode.NotFound)
123 {
124 if (!allowRegionless)
125 throw ex;
126 }
127 else
128 {
113 throw ex; 129 throw ex;
130 }
114 } 131 }
115 else
116 throw ex;
117 } 132 }
118 133
119 if (regionCount > 0 | allowRegionless) 134 if (regionCount > 0 | allowRegionless)
135 {
120 return regionInfos; 136 return regionInfos;
137 }
121 else 138 else
122 { 139 {
123 m_log.Error("[WEBLOADER]: No region configs were available."); 140 m_log.Error("[WEBLOADER]: No region configs were available.");
@@ -127,4 +144,4 @@ namespace OpenSim.Framework.RegionLoader.Web
127 } 144 }
128 } 145 }
129 } 146 }
130} 147} \ No newline at end of file