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/Friends | |
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/Friends')
-rw-r--r-- | OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index d442443..3aab30b 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -229,7 +229,7 @@ namespace OpenSim.Server.Handlers.Friends | |||
229 | 229 | ||
230 | rootElement.AppendChild(result); | 230 | rootElement.AppendChild(result); |
231 | 231 | ||
232 | return DocToBytes(doc); | 232 | return Util.DocToBytes(doc); |
233 | } | 233 | } |
234 | 234 | ||
235 | private byte[] FailureResult() | 235 | private byte[] FailureResult() |
@@ -261,18 +261,7 @@ namespace OpenSim.Server.Handlers.Friends | |||
261 | 261 | ||
262 | rootElement.AppendChild(message); | 262 | rootElement.AppendChild(message); |
263 | 263 | ||
264 | return DocToBytes(doc); | 264 | return Util.DocToBytes(doc); |
265 | } | ||
266 | |||
267 | private byte[] DocToBytes(XmlDocument doc) | ||
268 | { | ||
269 | MemoryStream ms = new MemoryStream(); | ||
270 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
271 | xw.Formatting = Formatting.Indented; | ||
272 | doc.WriteTo(xw); | ||
273 | xw.Flush(); | ||
274 | |||
275 | return ms.ToArray(); | ||
276 | } | 265 | } |
277 | 266 | ||
278 | void FromKeyValuePairs(Dictionary<string, object> kvp, out string principalID, out string friend, out int flags) | 267 | void FromKeyValuePairs(Dictionary<string, object> kvp, out string principalID, out string friend, out int flags) |