From d7121a422a334f20e96d09251cf7382164b590db Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 22 Jun 2007 22:21:08 +0000 Subject: Started work on CAPS support, now we have our first test capability, MapLayer requests are handled by CAPS. --- Common/OpenSim.Servers/BaseHttpServer.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'Common/OpenSim.Servers') diff --git a/Common/OpenSim.Servers/BaseHttpServer.cs b/Common/OpenSim.Servers/BaseHttpServer.cs index 3daec8d..71c36a7 100644 --- a/Common/OpenSim.Servers/BaseHttpServer.cs +++ b/Common/OpenSim.Servers/BaseHttpServer.cs @@ -66,6 +66,7 @@ namespace OpenSim.Servers protected Dictionary m_restHandlers = new Dictionary(); protected Dictionary m_rpcHandlers = new Dictionary(); protected int m_port; + protected bool firstcaps = true; public BaseHttpServer(int port) { @@ -74,6 +75,7 @@ namespace OpenSim.Servers public bool AddRestHandler(string method, string path, RestMethod handler) { + Console.WriteLine("adding new REST handler for path " + path); string methodKey = String.Format("{0}: {1}", method, path); if (!this.m_restHandlers.ContainsKey(methodKey)) @@ -158,7 +160,14 @@ namespace OpenSim.Servers protected virtual string ParseLLSDXML(string requestBody) { // dummy function for now - IMPLEMENT ME! - return ""; + Console.WriteLine("LLSD request "+requestBody); + string resp = ""; + if (firstcaps) + { + resp = "MapLayerhttp://127.0.0.1:9000/CAPS/"; + firstcaps = false; + } + return resp; } protected virtual string ParseXMLRPC(string requestBody) @@ -204,6 +213,7 @@ namespace OpenSim.Servers //Console.WriteLine(requestBody); string responseString = ""; + Console.WriteLine("new request " + request.ContentType); switch (request.ContentType) { case "text/xml": @@ -217,7 +227,9 @@ namespace OpenSim.Servers case "application/xml": // probably LLSD we hope, otherwise it should be ignored by the parser - responseString = ParseLLSDXML(requestBody); + // responseString = ParseLLSDXML(requestBody); + Console.WriteLine(" request " + request.HttpMethod + " to " + request.RawUrl); + responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); response.AddHeader("Content-type", "application/xml"); break; -- cgit v1.1