diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Server/Handlers/Presence | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-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.cs | 5 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Presence/PresenceServerPostHandler.cs | 22 |
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; | |||
30 | using OpenSim.Server.Base; | 30 | using OpenSim.Server.Base; |
31 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
32 | using OpenSim.Framework.Servers.HttpServer; | 32 | using OpenSim.Framework.Servers.HttpServer; |
33 | using OpenSim.Framework.ServiceAuth; | ||
33 | using OpenSim.Server.Handlers.Base; | 34 | using OpenSim.Server.Handlers.Base; |
34 | 35 | ||
35 | namespace OpenSim.Server.Handlers.Presence | 36 | namespace 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; | |||
40 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Servers.HttpServer; | 42 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenSim.Framework.ServiceAuth; | ||
43 | using OpenMetaverse; | 44 | using OpenMetaverse; |
44 | 45 | ||
45 | namespace OpenSim.Server.Handlers.Presence | 46 | namespace 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 | } |