From 4b84bdb77ee07dc74cbf6f8d0ce3a4cb1a2f0437 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 22 Jul 2009 22:16:37 +0000 Subject: [PATCH] Thank you, patnad, for a patch to advance the UrlModule's functionality. Mantis #3712 --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index 7d2876ca85..a74032fe06 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -240,13 +240,16 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp private Hashtable HttpRequestHandler(Hashtable request) { - foreach (KeyValuePair kvp in request) - { - m_log.DebugFormat("{0} = {1}", kvp.Key, kvp.Value.ToString()); - } + string uri = request["uri"].ToString(); + //A solution to this ugly mess would be to use only the /lslhttp// part of the URI as the key. + UrlData url = m_UrlMap["http://"+System.Environment.MachineName+":"+m_HttpServer.Port.ToString()+uri]; + + //UUID.Random() below is a hack! Eventually we will do HTTP requests and responses properly. + url.engine.PostScriptEvent(url.itemID, "http_request", new Object[] { UUID.Random().ToString(), request["http-method"].ToString(), request["body"].ToString() }); + Hashtable response = new Hashtable(); - response["int_response_code"] = 404; - response["str_response_string"] = "Test"; + response["int_response_code"] = 200; + response["str_response_string"] = "This is a generic response as OpenSim does not yet support proper responses. Your request has been passed to the object."; return response; }