aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs22
1 files changed, 6 insertions, 16 deletions
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
index 2d67c6d..49dbcb5 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs
@@ -40,6 +40,7 @@ using OpenSim.Server.Base;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41using OpenSim.Framework; 41using OpenSim.Framework;
42using OpenSim.Framework.Servers.HttpServer; 42using OpenSim.Framework.Servers.HttpServer;
43using OpenSim.Framework.ServiceAuth;
43using OpenMetaverse; 44using OpenMetaverse;
44 45
45namespace OpenSim.Server.Handlers.Presence 46namespace OpenSim.Server.Handlers.Presence
@@ -50,13 +51,13 @@ namespace OpenSim.Server.Handlers.Presence
50 51
51 private IPresenceService m_PresenceService; 52 private IPresenceService m_PresenceService;
52 53
53 public PresenceServerPostHandler(IPresenceService service) : 54 public PresenceServerPostHandler(IPresenceService service, IServiceAuth auth) :
54 base("POST", "/presence") 55 base("POST", "/presence", auth)
55 { 56 {
56 m_PresenceService = service; 57 m_PresenceService = service;
57 } 58 }
58 59
59 public override byte[] Handle(string path, Stream requestData, 60 protected override byte[] ProcessRequest(string path, Stream requestData,
60 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 61 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
61 { 62 {
62 StreamReader sr = new StreamReader(requestData); 63 StreamReader sr = new StreamReader(requestData);
@@ -264,7 +265,7 @@ namespace OpenSim.Server.Handlers.Presence
264 265
265 rootElement.AppendChild(result); 266 rootElement.AppendChild(result);
266 267
267 return DocToBytes(doc); 268 return Util.DocToBytes(doc);
268 } 269 }
269 270
270 private byte[] FailureResult() 271 private byte[] FailureResult()
@@ -286,18 +287,7 @@ namespace OpenSim.Server.Handlers.Presence
286 287
287 rootElement.AppendChild(result); 288 rootElement.AppendChild(result);
288 289
289 return DocToBytes(doc); 290 return Util.DocToBytes(doc);
290 }
291
292 private byte[] DocToBytes(XmlDocument doc)
293 {
294 MemoryStream ms = new MemoryStream();
295 XmlTextWriter xw = new XmlTextWriter(ms, null);
296 xw.Formatting = Formatting.Indented;
297 doc.WriteTo(xw);
298 xw.Flush();
299
300 return ms.ToArray();
301 } 291 }
302 292
303 } 293 }