diff options
Diffstat (limited to 'OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs')
-rw-r--r-- | OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs b/OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs index 4e4960c..9e4c00e 100644 --- a/OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs +++ b/OpenSim/Server/Handlers/Authorization/AuthorizationServerGetHandler.cs | |||
@@ -55,16 +55,41 @@ namespace OpenSim.Server.Handlers.Authorization | |||
55 | public override byte[] Handle(string path, Stream request, | 55 | public override byte[] Handle(string path, Stream request, |
56 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | 56 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) |
57 | { | 57 | { |
58 | byte[] result = new byte[0]; | 58 | // always return success for now, this is just stub functionality |
59 | return SuccessResult(); | ||
60 | } | ||
61 | |||
62 | private byte[] SuccessResult() | ||
63 | { | ||
64 | XmlDocument doc = new XmlDocument(); | ||
65 | |||
66 | XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration, | ||
67 | "", ""); | ||
68 | |||
69 | doc.AppendChild(xmlnode); | ||
59 | 70 | ||
60 | string[] p = SplitParams(path); | 71 | XmlElement rootElement = doc.CreateElement("", "Authorization", |
72 | ""); | ||
61 | 73 | ||
62 | if (p.Length == 0) | 74 | doc.AppendChild(rootElement); |
63 | return result; | ||
64 | 75 | ||
65 | // Process web request | 76 | XmlElement result = doc.CreateElement("", "Result", ""); |
77 | result.AppendChild(doc.CreateTextNode("success")); | ||
78 | |||
79 | rootElement.AppendChild(result); | ||
80 | |||
81 | return DocToBytes(doc); | ||
82 | } | ||
83 | |||
84 | private byte[] DocToBytes(XmlDocument doc) | ||
85 | { | ||
86 | MemoryStream ms = new MemoryStream(); | ||
87 | XmlTextWriter xw = new XmlTextWriter(ms, null); | ||
88 | xw.Formatting = Formatting.Indented; | ||
89 | doc.WriteTo(xw); | ||
90 | xw.Flush(); | ||
66 | 91 | ||
67 | return result; | 92 | return ms.GetBuffer(); |
68 | } | 93 | } |
69 | } | 94 | } |
70 | } | 95 | } |