From fcabdab7bc7466a8a56c0f034c56ca22124e8060 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 2 Jul 2007 16:03:58 +0000 Subject: [PATCH] * Started working on LlsdMethod for BaseHttpServer *Renamed IRestHandler.cs to RestMethod.cs which is the correct name. --- OpenGridServices.sln | 127 ++++++++++-------- OpenSim/Framework/Servers/BaseHttpServer.cs | 8 +- OpenSim/Framework/Servers/LlsdMethod.cs | 8 ++ .../Servers/OpenSim.Framework.Servers.csproj | 41 +++--- .../OpenSim.Framework.Servers.dll.build | 2 +- .../{IRestHandler.cs => RestMethod.cs} | 0 OpenSim/Region/Capabilities/LLSDType.cs | 10 +- 7 files changed, 113 insertions(+), 83 deletions(-) create mode 100644 OpenSim/Framework/Servers/LlsdMethod.cs rename OpenSim/Framework/Servers/{IRestHandler.cs => RestMethod.cs} (100%) diff --git a/OpenGridServices.sln b/OpenGridServices.sln index 5f47b6b81e..2343bc085d 100644 --- a/OpenGridServices.sln +++ b/OpenGridServices.sln @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C# Express 2005 +# Visual Studio 2005 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data", "OpenSim\Framework\Data\OpenSim.Framework.Data.csproj", "{36B72A9B-0000-0000-0000-000000000000}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Framework.Data.DB4o", "OpenSim\Framework\Data.DB4o\OpenSim.Framework.Data.DB4o.csproj", "{FD2D303D-0000-0000-0000-000000000000}" @@ -25,61 +25,72 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSim.Grid.UserServer.Config", "OpenSim\Grid\UserServer.Config\OpenSim.Grid.UserServer.Config.csproj", "{08F87229-0000-0000-0000-000000000000}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU - {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU - {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectDependencies) = postSolution + ({FD2D303D-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) + ({17F7F694-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) + ({17F7F6BE-0000-0000-0000-000000000000}).2 = ({36B72A9B-0000-0000-0000-000000000000}) + ({6ECC56A9-0000-0000-0000-000000000000}).1 = ({36B72A9B-0000-0000-0000-000000000000}) + ({586E2916-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({60FCC3A6-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({60FCC3A6-0000-0000-0000-000000000000}).7 = ({4B7BFD1C-0000-0000-0000-000000000000}) + ({2FC96F92-0000-0000-0000-000000000000}).4 = ({36B72A9B-0000-0000-0000-000000000000}) + ({2FC96F92-0000-0000-0000-000000000000}).7 = ({586E2916-0000-0000-0000-000000000000}) + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36B72A9B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FD2D303D-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F7F694-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {17F7F6BE-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6ECC56A9-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {586E2916-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {586E2916-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5F1A03B-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4B7BFD1C-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60FCC3A6-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1442B635-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1442B635-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FC96F92-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {08F87229-0000-0000-0000-000000000000}.Debug|Any CPU.Build.0 = Debug|Any CPU + {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.ActiveCfg = Release|Any CPU + {08F87229-0000-0000-0000-000000000000}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection EndGlobal diff --git a/OpenSim/Framework/Servers/BaseHttpServer.cs b/OpenSim/Framework/Servers/BaseHttpServer.cs index 681bb46128..0442b1a974 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/LlsdMethod.cs b/OpenSim/Framework/Servers/LlsdMethod.cs new file mode 100644 index 0000000000..4ce4287bde --- /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 399f45634c..d6d0815095 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 7401b07d73..60b204df4c 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/IRestHandler.cs b/OpenSim/Framework/Servers/RestMethod.cs similarity index 100% rename from OpenSim/Framework/Servers/IRestHandler.cs rename to OpenSim/Framework/Servers/RestMethod.cs diff --git a/OpenSim/Region/Capabilities/LLSDType.cs b/OpenSim/Region/Capabilities/LLSDType.cs index 7da5861b15..a2ae8df294 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" ) + { + } + } }