diff options
author | Oren Hurvitz | 2014-06-01 17:39:11 +0300 |
---|---|---|
committer | Justin Clark-Casey | 2014-08-02 00:55:57 +0100 |
commit | e41e52e09727842d990a31e2a5f7f3e9c88fe8b3 (patch) | |
tree | 5779c9f42cd913f63e2d237b5a407214933585db /OpenSim/Server/Handlers/Avatar | |
parent | Add code to GridService to check for overlapping of varregions (diff) | |
download | opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.zip opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.gz opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.bz2 opensim-SC_OLD-e41e52e09727842d990a31e2a5f7f3e9c88fe8b3.tar.xz |
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Server/Handlers/Avatar')
-rw-r--r-- | OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 59dbed4..ff8699f 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -247,7 +247,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
247 | 247 | ||
248 | rootElement.AppendChild(result); | 248 | rootElement.AppendChild(result); |
249 | 249 | ||
250 | return DocToBytes(doc); | 250 | return Util.DocToBytes(doc); |
251 | } | 251 | } |
252 | 252 | ||
253 | private byte[] FailureResult() | 253 | private byte[] FailureResult() |
@@ -269,18 +269,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
269 | 269 | ||
270 | rootElement.AppendChild(result); | 270 | rootElement.AppendChild(result); |
271 | 271 | ||
272 | return DocToBytes(doc); | 272 | return Util.DocToBytes(doc); |
273 | } | ||
274 | |||
275 | private byte[] DocToBytes(XmlDocument doc) | ||
276 | { | ||
277 | MemoryStream ms = new MemoryStream(); | ||
278 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
279 | xw.Formatting = Formatting.Indented; | ||
280 | doc.WriteTo(xw); | ||
281 | xw.Flush(); | ||
282 | |||
283 | return ms.ToArray(); | ||
284 | } | 273 | } |
285 | 274 | ||
286 | } | 275 | } |