aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-26 01:27:22 +0000
committerMelanie Thielker2009-05-26 01:27:22 +0000
commit2f74a7e3a67a443df13bca0521168417c60be646 (patch)
tree13499dab214bcfd7c32198f74c3c422802de5a7d
parentAddresses mantis #3718. (diff)
downloadopensim-SC_OLD-2f74a7e3a67a443df13bca0521168417c60be646.zip
opensim-SC_OLD-2f74a7e3a67a443df13bca0521168417c60be646.tar.gz
opensim-SC_OLD-2f74a7e3a67a443df13bca0521168417c60be646.tar.bz2
opensim-SC_OLD-2f74a7e3a67a443df13bca0521168417c60be646.tar.xz
Couple of tweaks to the URL module: handle script reset gracefully and
stop crashing http server threads.
-rw-r--r--OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs11
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;
33using log4net; 33using log4net;
34using Nini.Config; 34using Nini.Config;
35using OpenMetaverse; 35using OpenMetaverse;
36using OpenSim.Framework;
36using OpenSim.Framework.Servers.HttpServer; 37using OpenSim.Framework.Servers.HttpServer;
37using OpenSim.Region.Framework.Interfaces; 38using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Region.Framework.Scenes; 39using 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}