diff options
author | Dr Scofield | 2008-05-20 16:51:45 +0000 |
---|---|---|
committer | Dr Scofield | 2008-05-20 16:51:45 +0000 |
commit | a53cea6b7e4094ea51339c80ab5fe160a19a9f6b (patch) | |
tree | 7294600ad7bbec50ff34e35b1c46a380d2d7d549 /OpenSim/Framework | |
parent | From: Jeremy Bongio <jbongio@us.ibm.com> (diff) | |
download | opensim-SC-a53cea6b7e4094ea51339c80ab5fe160a19a9f6b.zip opensim-SC-a53cea6b7e4094ea51339c80ab5fe160a19a9f6b.tar.gz opensim-SC-a53cea6b7e4094ea51339c80ab5fe160a19a9f6b.tar.bz2 opensim-SC-a53cea6b7e4094ea51339c80ab5fe160a19a9f6b.tar.xz |
i'm extending the RestStreamHandler.Handler(...) signature to actually
provide OSHttpRequest and OSHttpResponse to our REST handler.
also, this adds proper RestPlugin.IsGod() checking against the X-OpenSim-Godkey
HTTP request header.
last, i added XML doc comments to RestPlugin.cs
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/CAPSService.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/Caps.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/RestMethod.cs | 3 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/RestStreamHandler.cs | 2 |
4 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Framework/Communications/CAPSService.cs b/OpenSim/Framework/Communications/CAPSService.cs index caf96ff..07bea9d 100644 --- a/OpenSim/Framework/Communications/CAPSService.cs +++ b/OpenSim/Framework/Communications/CAPSService.cs | |||
@@ -45,7 +45,8 @@ namespace OpenSim.Framework.Communications | |||
45 | m_server.AddStreamHandler(new RestStreamHandler("POST", path, restMethod)); | 45 | m_server.AddStreamHandler(new RestStreamHandler("POST", path, restMethod)); |
46 | } | 46 | } |
47 | 47 | ||
48 | public string CapsRequest(string request, string path, string param) | 48 | public string CapsRequest(string request, string path, string param, |
49 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
49 | { | 50 | { |
50 | System.Console.WriteLine("new caps request " + request + " from path " + path); | 51 | System.Console.WriteLine("new caps request " + request + " from path " + path); |
51 | return String.Empty; | 52 | return String.Empty; |
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 9725c94..8d8f945 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -208,8 +208,11 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
208 | /// <param name="request"></param> | 208 | /// <param name="request"></param> |
209 | /// <param name="path"></param> | 209 | /// <param name="path"></param> |
210 | /// <param name="param"></param> | 210 | /// <param name="param"></param> |
211 | /// <param name="httpRequest">HTTP request header object</param> | ||
212 | /// <param name="httpResponse">HTTP response header object</param> | ||
211 | /// <returns></returns> | 213 | /// <returns></returns> |
212 | public string CapsRequest(string request, string path, string param) | 214 | public string CapsRequest(string request, string path, string param, |
215 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
213 | { | 216 | { |
214 | m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); | 217 | m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); |
215 | //Console.WriteLine("caps request " + request); | 218 | //Console.WriteLine("caps request " + request); |
@@ -503,8 +506,11 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
503 | /// <param name="request"></param> | 506 | /// <param name="request"></param> |
504 | /// <param name="path"></param> | 507 | /// <param name="path"></param> |
505 | /// <param name="param"></param> | 508 | /// <param name="param"></param> |
509 | /// <param name="httpRequest">HTTP request header object</param> | ||
510 | /// <param name="httpResponse">HTTP response header object</param> | ||
506 | /// <returns></returns> | 511 | /// <returns></returns> |
507 | public string ScriptTaskInventory(string request, string path, string param) | 512 | public string ScriptTaskInventory(string request, string path, string param, |
513 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
508 | { | 514 | { |
509 | try | 515 | try |
510 | { | 516 | { |
@@ -558,7 +564,8 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
558 | /// <param name="path"></param> | 564 | /// <param name="path"></param> |
559 | /// <param name="param"></param> | 565 | /// <param name="param"></param> |
560 | /// <returns></returns> | 566 | /// <returns></returns> |
561 | public string NoteCardAgentInventory(string request, string path, string param) | 567 | public string NoteCardAgentInventory(string request, string path, string param, |
568 | OSHttpRequest httpRequest, OSHttpResponse httpResponse) | ||
562 | { | 569 | { |
563 | m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName); | 570 | m_log.Debug("[CAPS]: NoteCardAgentInventory Request in region: " + m_regionName); |
564 | //libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); | 571 | //libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); |
diff --git a/OpenSim/Framework/Servers/RestMethod.cs b/OpenSim/Framework/Servers/RestMethod.cs index 1a31ef1..6bd34f5 100644 --- a/OpenSim/Framework/Servers/RestMethod.cs +++ b/OpenSim/Framework/Servers/RestMethod.cs | |||
@@ -27,5 +27,6 @@ | |||
27 | 27 | ||
28 | namespace OpenSim.Framework.Servers | 28 | namespace OpenSim.Framework.Servers |
29 | { | 29 | { |
30 | public delegate string RestMethod(string request, string path, string param); | 30 | public delegate string RestMethod(string request, string path, string param, |
31 | OSHttpRequest httpRequest, OSHttpResponse httpResponse); | ||
31 | } | 32 | } |
diff --git a/OpenSim/Framework/Servers/RestStreamHandler.cs b/OpenSim/Framework/Servers/RestStreamHandler.cs index 301b0a9..44c9dfc 100644 --- a/OpenSim/Framework/Servers/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/RestStreamHandler.cs | |||
@@ -49,7 +49,7 @@ namespace OpenSim.Framework.Servers | |||
49 | streamReader.Close(); | 49 | streamReader.Close(); |
50 | 50 | ||
51 | string param = GetParam(path); | 51 | string param = GetParam(path); |
52 | string responseString = m_restMethod(requestBody, path, param); | 52 | string responseString = m_restMethod(requestBody, path, param, httpRequest, httpResponse); |
53 | 53 | ||
54 | return Encoding.UTF8.GetBytes(responseString); | 54 | return Encoding.UTF8.GetBytes(responseString); |
55 | } | 55 | } |