diff options
author | Melanie Thielker | 2009-05-26 01:27:22 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-26 01:27:22 +0000 |
commit | 2f74a7e3a67a443df13bca0521168417c60be646 (patch) | |
tree | 13499dab214bcfd7c32198f74c3c422802de5a7d /OpenSim | |
parent | Addresses mantis #3718. (diff) | |
download | opensim-SC-2f74a7e3a67a443df13bca0521168417c60be646.zip opensim-SC-2f74a7e3a67a443df13bca0521168417c60be646.tar.gz opensim-SC-2f74a7e3a67a443df13bca0521168417c60be646.tar.bz2 opensim-SC-2f74a7e3a67a443df13bca0521168417c60be646.tar.xz |
Couple of tweaks to the URL module: handle script reset gracefully and
stop crashing http server threads.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index a3bcd5f..9c6f49b 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs | |||
@@ -33,6 +33,7 @@ using System.Reflection; | |||
33 | using log4net; | 33 | using log4net; |
34 | using Nini.Config; | 34 | using Nini.Config; |
35 | using OpenMetaverse; | 35 | using OpenMetaverse; |
36 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework.Servers.HttpServer; | 37 | using OpenSim.Framework.Servers.HttpServer; |
37 | using OpenSim.Region.Framework.Interfaces; | 38 | using OpenSim.Region.Framework.Interfaces; |
38 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
@@ -96,6 +97,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
96 | } | 97 | } |
97 | 98 | ||
98 | scene.RegisterModuleInterface<IUrlModule>(this); | 99 | scene.RegisterModuleInterface<IUrlModule>(this); |
100 | |||
101 | scene.EventManager.OnScriptReset += OnScriptReset; | ||
99 | } | 102 | } |
100 | 103 | ||
101 | public void RegionLoaded(Scene scene) | 104 | public void RegionLoaded(Scene scene) |
@@ -121,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
121 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); | 124 | engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" }); |
122 | return urlcode; | 125 | return urlcode; |
123 | } | 126 | } |
124 | string url = "http://"+System.Environment.MachineName+":"+m_HttpServer.Port.ToString()+"/lslhttp/"+urlcode.ToString()+"/"; | 127 | string url = "http://"+Util.GetLocalHost()+":"+m_HttpServer.Port.ToString()+"/lslhttp/"+urlcode.ToString()+"/"; |
125 | 128 | ||
126 | UrlData urlData = new UrlData(); | 129 | UrlData urlData = new UrlData(); |
127 | urlData.hostID = host.UUID; | 130 | urlData.hostID = host.UUID; |
@@ -238,8 +241,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp | |||
238 | } | 241 | } |
239 | Hashtable response = new Hashtable(); | 242 | Hashtable response = new Hashtable(); |
240 | response["int_response_code"] = 404; | 243 | response["int_response_code"] = 404; |
244 | response["str_response_string"] = "Test"; | ||
241 | 245 | ||
242 | return response; | 246 | return response; |
243 | } | 247 | } |
248 | |||
249 | private void OnScriptReset(uint localID, UUID itemID) | ||
250 | { | ||
251 | ScriptRemoved(itemID); | ||
252 | } | ||
244 | } | 253 | } |
245 | } | 254 | } |