diff options
author | Oren Hurvitz | 2014-06-01 17:39:11 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-07-21 08:30:03 +0100 |
commit | 99ac770abbe3a95887c4b10c82f3985aa878eeef (patch) | |
tree | 8c946dab083dd50a352f3861415eca43185d8d95 /OpenSim/Server/Handlers/Map | |
parent | Set "[Terrain]SendTerrainUpdatesByViewDistance=true" by default. (diff) | |
download | opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.zip opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.gz opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.bz2 opensim-SC_OLD-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.xz |
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Server/Handlers/Map')
-rw-r--r-- | OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index a896fdb..649a27e 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -188,7 +188,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
188 | 188 | ||
189 | rootElement.AppendChild(result); | 189 | rootElement.AppendChild(result); |
190 | 190 | ||
191 | return DocToBytes(doc); | 191 | return Util.DocToBytes(doc); |
192 | } | 192 | } |
193 | 193 | ||
194 | private byte[] FailureResult(string msg) | 194 | private byte[] FailureResult(string msg) |
@@ -215,18 +215,7 @@ namespace OpenSim.Server.Handlers.MapImage | |||
215 | 215 | ||
216 | rootElement.AppendChild(message); | 216 | rootElement.AppendChild(message); |
217 | 217 | ||
218 | return DocToBytes(doc); | 218 | return Util.DocToBytes(doc); |
219 | } | ||
220 | |||
221 | private byte[] DocToBytes(XmlDocument doc) | ||
222 | { | ||
223 | MemoryStream ms = new MemoryStream(); | ||
224 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
225 | xw.Formatting = Formatting.Indented; | ||
226 | doc.WriteTo(xw); | ||
227 | xw.Flush(); | ||
228 | |||
229 | return ms.ToArray(); | ||
230 | } | 219 | } |
231 | 220 | ||
232 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) | 221 | private System.Net.IPAddress GetCallerIP(IOSHttpRequest request) |