From fcabdab7bc7466a8a56c0f034c56ca22124e8060 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 2 Jul 2007 16:03:58 +0000 Subject: * Started working on LlsdMethod for BaseHttpServer *Renamed IRestHandler.cs to RestMethod.cs which is the correct name. --- OpenSim/Framework/Servers/BaseHttpServer.cs | 8 +---- OpenSim/Framework/Servers/IRestHandler.cs | 35 ------------------ OpenSim/Framework/Servers/LlsdMethod.cs | 8 +++++ .../Servers/OpenSim.Framework.Servers.csproj | 41 +++++++++++++--------- .../Servers/OpenSim.Framework.Servers.dll.build | 2 +- OpenSim/Framework/Servers/RestMethod.cs | 35 ++++++++++++++++++ OpenSim/Region/Capabilities/LLSDType.cs | 10 +++++- 7 files changed, 79 insertions(+), 60 deletions(-) delete mode 100644 OpenSim/Framework/Servers/IRestHandler.cs create mode 100644 OpenSim/Framework/Servers/LlsdMethod.cs create mode 100644 OpenSim/Framework/Servers/RestMethod.cs (limited to 'OpenSim') diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 681bb46..0442b1a 100644 --- a/OpenSim/Framework/Servers/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/BaseHttpServer.cs @@ -224,15 +224,9 @@ namespace OpenSim.Framework.Servers break; case "application/xml": - // probably LLSD we hope, otherwise it should be ignored by the parser - // responseString = ParseLLSDXML(requestBody); - responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); - response.AddHeader("Content-type", "application/xml"); - break; - case "application/octet-stream": // probably LLSD we hope, otherwise it should be ignored by the parser - // responseString = ParseLLSDXML(requestBody); + // responseString = ParseLLSDXML(requestBody); responseString = ParseREST(requestBody, request.RawUrl, request.HttpMethod); response.AddHeader("Content-type", "application/xml"); break; diff --git a/OpenSim/Framework/Servers/IRestHandler.cs b/OpenSim/Framework/Servers/IRestHandler.cs deleted file mode 100644 index a2b6bf0..0000000 --- a/OpenSim/Framework/Servers/IRestHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Copyright (c) Contributors, http://www.openmetaverse.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ -using System; -using System.Collections.Generic; -using System.Text; - -namespace OpenSim.Framework.Servers -{ - public delegate string RestMethod( string request, string path, string param ); -} diff --git a/OpenSim/Framework/Servers/LlsdMethod.cs b/OpenSim/Framework/Servers/LlsdMethod.cs new file mode 100644 index 0000000..4ce4287 --- /dev/null +++ b/OpenSim/Framework/Servers/LlsdMethod.cs @@ -0,0 +1,8 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework.Servers +{ + public delegate string LlsdMethod(string request, string path, string param); +} diff --git a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj index 399f456..d6d0815 100644 --- a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj +++ b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.csproj @@ -1,4 +1,4 @@ - + Local 8.0.50727 @@ -6,7 +6,8 @@ {2CC71860-0000-0000-0000-000000000000} Debug AnyCPU - + + OpenSim.Framework.Servers @@ -15,9 +16,11 @@ IE50 false Library - + + OpenSim.Framework.Servers - + + @@ -28,7 +31,8 @@ TRACE;DEBUG - + + True 4096 False @@ -37,7 +41,8 @@ False False 4 - + + False @@ -46,7 +51,8 @@ TRACE - + + False 4096 True @@ -55,22 +61,24 @@ False False 4 - + + - + ..\..\..\bin\libsecondlife.dll False - + System.dll False - + + System.Xml.dll False - + ..\..\..\bin\XMLRPC.dll False @@ -80,13 +88,13 @@ OpenSim.Framework {8ACA2445-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False OpenSim.Framework.Console {A7CD0630-0000-0000-0000-000000000000} {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - False + False @@ -96,7 +104,8 @@ Code - + + Code @@ -113,4 +122,4 @@ - + \ No newline at end of file diff --git a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build index 7401b07..60b204d 100644 --- a/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build +++ b/OpenSim/Framework/Servers/OpenSim.Framework.Servers.dll.build @@ -13,7 +13,7 @@ - + diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs new file mode 100644 index 0000000..a2b6bf0 --- /dev/null +++ b/OpenSim/Framework/Servers/RestMethod.cs @@ -0,0 +1,35 @@ +/* +* Copyright (c) Contributors, http://www.openmetaverse.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Framework.Servers +{ + public delegate string RestMethod( string request, string path, string param ); +} diff --git a/OpenSim/Region/Capabilities/LLSDType.cs b/OpenSim/Region/Capabilities/LLSDType.cs index 7da5861..a2ae8df 100644 --- a/OpenSim/Region/Capabilities/LLSDType.cs +++ b/OpenSim/Region/Capabilities/LLSDType.cs @@ -34,7 +34,7 @@ namespace OpenSim.Region.Capabilities [AttributeUsage(AttributeTargets.Class)] public class LLSDType : Attribute { - private string myType; + protected string myType; public LLSDType(string type) { @@ -50,4 +50,12 @@ namespace OpenSim.Region.Capabilities } } } + + [AttributeUsage(AttributeTargets.Class)] + public class LLSDMap : LLSDType + { + public LLSDMap() : base( "MAP" ) + { + } + } } -- cgit v1.1