From e41e52e09727842d990a31e2a5f7f3e9c88fe8b3 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 1 Jun 2014 17:39:11 +0300 Subject: Close streams immediately when we finish using them --- .../Server/Handlers/Friends/FriendsServerPostHandler.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'OpenSim/Server/Handlers/Friends') 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 rootElement.AppendChild(result); - return DocToBytes(doc); + return Util.DocToBytes(doc); } private byte[] FailureResult() @@ -261,18 +261,7 @@ namespace OpenSim.Server.Handlers.Friends rootElement.AppendChild(message); - return DocToBytes(doc); - } - - private byte[] DocToBytes(XmlDocument doc) - { - MemoryStream ms = new MemoryStream(); - XmlTextWriter xw = new XmlTextWriter(ms, null); - xw.Formatting = Formatting.Indented; - doc.WriteTo(xw); - xw.Flush(); - - return ms.ToArray(); + return Util.DocToBytes(doc); } void FromKeyValuePairs(Dictionary kvp, out string principalID, out string friend, out int flags) -- cgit v1.1