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/Authentication/AuthenticationServerPostHandler.cs | |
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 '')
-rw-r--r-- | OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index 5d65f67..6ee98b3 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -209,7 +209,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
209 | 209 | ||
210 | rootElement.AppendChild(result); | 210 | rootElement.AppendChild(result); |
211 | 211 | ||
212 | return DocToBytes(doc); | 212 | return Util.DocToBytes(doc); |
213 | } | 213 | } |
214 | 214 | ||
215 | byte[] GetAuthInfo(UUID principalID) | 215 | byte[] GetAuthInfo(UUID principalID) |
@@ -279,7 +279,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
279 | 279 | ||
280 | rootElement.AppendChild(result); | 280 | rootElement.AppendChild(result); |
281 | 281 | ||
282 | return DocToBytes(doc); | 282 | return Util.DocToBytes(doc); |
283 | } | 283 | } |
284 | 284 | ||
285 | private byte[] SuccessResult(string token) | 285 | private byte[] SuccessResult(string token) |
@@ -306,18 +306,7 @@ namespace OpenSim.Server.Handlers.Authentication | |||
306 | 306 | ||
307 | rootElement.AppendChild(t); | 307 | rootElement.AppendChild(t); |
308 | 308 | ||
309 | return DocToBytes(doc); | 309 | return Util.DocToBytes(doc); |
310 | } | ||
311 | |||
312 | private byte[] DocToBytes(XmlDocument doc) | ||
313 | { | ||
314 | MemoryStream ms = new MemoryStream(); | ||
315 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
316 | xw.Formatting = Formatting.Indented; | ||
317 | doc.WriteTo(xw); | ||
318 | xw.Flush(); | ||
319 | |||
320 | return ms.GetBuffer(); | ||
321 | } | 310 | } |
322 | 311 | ||
323 | private byte[] ResultToBytes(Dictionary<string, object> result) | 312 | private byte[] ResultToBytes(Dictionary<string, object> result) |