aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Presence
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-11-03 21:44:39 +1000
committerDavid Walter Seikel2016-11-03 21:44:39 +1000
commit134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch)
tree216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Server/Handlers/Presence
parentMore changing to production grid. Double oops. (diff)
downloadopensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2
opensim-SC-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Server/Handlers/Presence')
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs5
-rw-r--r--OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs22
2 files changed, 10 insertions, 17 deletions
diff --git a/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs b/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
index 899cd8f..7a63c36 100644
--- a/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
+++ b/OpenSim/Server/Handlers/Presence/PresenceServerConnector.cs
@@ -30,6 +30,7 @@ using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Framework.ServiceAuth;
33using OpenSim.Server.Handlers.Base; 34using OpenSim.Server.Handlers.Base;
34 35
35namespace OpenSim.Server.Handlers.Presence 36namespace OpenSim.Server.Handlers.Presence
@@ -55,7 +56,9 @@ namespace OpenSim.Server.Handlers.Presence
55 Object[] args = new Object[] { config }; 56 Object[] args = new Object[] { config };
56 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(gridService, args); 57 m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(gridService, args);
57 58
58 server.AddStreamHandler(new PresenceServerPostHandler(m_PresenceService)); 59 IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
60
61 server.AddStreamHandler(new PresenceServerPostHandler(m_PresenceService, auth));
59 } 62 }
60 } 63 }
61} 64}
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 }