diff options
author | Oren Hurvitz | 2014-06-01 17:39:11 +0300 |
---|---|---|
committer | Oren Hurvitz | 2014-07-21 08:30:03 +0100 |
commit | 99ac770abbe3a95887c4b10c82f3985aa878eeef (patch) | |
tree | 8c946dab083dd50a352f3861415eca43185d8d95 /OpenSim/Server/Handlers/Hypergrid | |
parent | Set "[Terrain]SendTerrainUpdatesByViewDistance=true" by default. (diff) | |
download | opensim-SC-99ac770abbe3a95887c4b10c82f3985aa878eeef.zip opensim-SC-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.gz opensim-SC-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.bz2 opensim-SC-99ac770abbe3a95887c4b10c82f3985aa878eeef.tar.xz |
Close streams immediately when we finish using them
Diffstat (limited to 'OpenSim/Server/Handlers/Hypergrid')
-rw-r--r-- | OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index a2bdadb..37b47ed 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -335,7 +335,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
335 | 335 | ||
336 | rootElement.AppendChild(result); | 336 | rootElement.AppendChild(result); |
337 | 337 | ||
338 | return DocToBytes(doc); | 338 | return Util.DocToBytes(doc); |
339 | } | 339 | } |
340 | 340 | ||
341 | private byte[] SuccessResult(string value) | 341 | private byte[] SuccessResult(string value) |
@@ -362,7 +362,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
362 | 362 | ||
363 | rootElement.AppendChild(message); | 363 | rootElement.AppendChild(message); |
364 | 364 | ||
365 | return DocToBytes(doc); | 365 | return Util.DocToBytes(doc); |
366 | } | 366 | } |
367 | 367 | ||
368 | 368 | ||
@@ -395,7 +395,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
395 | 395 | ||
396 | rootElement.AppendChild(message); | 396 | rootElement.AppendChild(message); |
397 | 397 | ||
398 | return DocToBytes(doc); | 398 | return Util.DocToBytes(doc); |
399 | } | 399 | } |
400 | 400 | ||
401 | private byte[] BoolResult(bool value) | 401 | private byte[] BoolResult(bool value) |
@@ -417,21 +417,9 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
417 | 417 | ||
418 | rootElement.AppendChild(result); | 418 | rootElement.AppendChild(result); |
419 | 419 | ||
420 | return DocToBytes(doc); | 420 | return Util.DocToBytes(doc); |
421 | } | 421 | } |
422 | 422 | ||
423 | private byte[] DocToBytes(XmlDocument doc) | ||
424 | { | ||
425 | MemoryStream ms = new MemoryStream(); | ||
426 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
427 | xw.Formatting = Formatting.Indented; | ||
428 | doc.WriteTo(xw); | ||
429 | xw.Flush(); | ||
430 | |||
431 | return ms.ToArray(); | ||
432 | } | ||
433 | |||
434 | |||
435 | #endregion | 423 | #endregion |
436 | } | 424 | } |
437 | } | 425 | } |