diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 8cd747e..ff8699f 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -39,6 +39,7 @@ using System.Collections.Generic; | |||
39 | using OpenSim.Server.Base; | 39 | 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.ServiceAuth; | ||
42 | using OpenSim.Framework.Servers.HttpServer; | 43 | using OpenSim.Framework.Servers.HttpServer; |
43 | using OpenMetaverse; | 44 | using OpenMetaverse; |
44 | 45 | ||
@@ -50,13 +51,13 @@ namespace OpenSim.Server.Handlers.Avatar | |||
50 | 51 | ||
51 | private IAvatarService m_AvatarService; | 52 | private IAvatarService m_AvatarService; |
52 | 53 | ||
53 | public AvatarServerPostHandler(IAvatarService service) : | 54 | public AvatarServerPostHandler(IAvatarService service, IServiceAuth auth) : |
54 | base("POST", "/avatar") | 55 | base("POST", "/avatar", auth) |
55 | { | 56 | { |
56 | m_AvatarService = service; | 57 | m_AvatarService = 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); |
@@ -246,7 +247,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
246 | 247 | ||
247 | rootElement.AppendChild(result); | 248 | rootElement.AppendChild(result); |
248 | 249 | ||
249 | return DocToBytes(doc); | 250 | return Util.DocToBytes(doc); |
250 | } | 251 | } |
251 | 252 | ||
252 | private byte[] FailureResult() | 253 | private byte[] FailureResult() |
@@ -268,18 +269,7 @@ namespace OpenSim.Server.Handlers.Avatar | |||
268 | 269 | ||
269 | rootElement.AppendChild(result); | 270 | rootElement.AppendChild(result); |
270 | 271 | ||
271 | return DocToBytes(doc); | 272 | return Util.DocToBytes(doc); |
272 | } | ||
273 | |||
274 | private byte[] DocToBytes(XmlDocument doc) | ||
275 | { | ||
276 | MemoryStream ms = new MemoryStream(); | ||
277 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
278 | xw.Formatting = Formatting.Indented; | ||
279 | doc.WriteTo(xw); | ||
280 | xw.Flush(); | ||
281 | |||
282 | return ms.ToArray(); | ||
283 | } | 273 | } |
284 | 274 | ||
285 | } | 275 | } |