aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Friends
diff options
context:
space:
mode:
authorOren Hurvitz2014-06-01 17:39:11 +0300
committerOren Hurvitz2014-07-21 08:30:03 +0100
commit99ac770abbe3a95887c4b10c82f3985aa878eeef (patch)
tree8c946dab083dd50a352f3861415eca43185d8d95 /OpenSim/Server/Handlers/Friends
parentSet "[Terrain]SendTerrainUpdatesByViewDistance=true" by default. (diff)
downloadopensim-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/Friends')
-rw-r--r--OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs15
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)