diff options
author | Justin Clark-Casey (justincc) | 2013-04-04 00:36:15 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-04-04 00:36:15 +0100 |
commit | 831e4c38506140e9ece2db4b96b4f0960a0276a8 (patch) | |
tree | 8a341213d3da08c85a07c62145db0fcecaedad07 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |
parent | minor: Stop falsely logging that a teleport was being aborted on client logou... (diff) | |
download | opensim-SC_OLD-831e4c38506140e9ece2db4b96b4f0960a0276a8.zip opensim-SC_OLD-831e4c38506140e9ece2db4b96b4f0960a0276a8.tar.gz opensim-SC_OLD-831e4c38506140e9ece2db4b96b4f0960a0276a8.tar.bz2 opensim-SC_OLD-831e4c38506140e9ece2db4b96b4f0960a0276a8.tar.xz |
Fix bug where outstanding llHTTPRequests for scripts were not being aborted when they were deleted.
This was because AsyncCommandManager was handing an item ID to IHttpRequestModule.StopHttpRequest() rather than the expected request ID.
This commit also makes the http request asynchronous using BeginGetResponse() rather than doing this by launching a new thread
so that we can more safely abort it via HttpWebRequest.Abort() rather than aborting the thread itself.
This also renames StopHttpRequest() to StopHttpRequestsForScript() since any outstanding requests are now aborted and/or removed.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 47a9cdc..1c59624 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -28,7 +28,9 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | ||
31 | using System.Threading; | 32 | using System.Threading; |
33 | using log4net; | ||
32 | using OpenMetaverse; | 34 | using OpenMetaverse; |
33 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Monitoring; | 36 | using OpenSim.Framework.Monitoring; |
@@ -45,6 +47,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
45 | /// </summary> | 47 | /// </summary> |
46 | public class AsyncCommandManager | 48 | public class AsyncCommandManager |
47 | { | 49 | { |
50 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
51 | |||
48 | private static Thread cmdHandlerThread; | 52 | private static Thread cmdHandlerThread; |
49 | private static int cmdHandlerThreadCycleSleepms; | 53 | private static int cmdHandlerThreadCycleSleepms; |
50 | 54 | ||
@@ -225,6 +229,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
225 | /// <param name="itemID"></param> | 229 | /// <param name="itemID"></param> |
226 | public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID) | 230 | public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID) |
227 | { | 231 | { |
232 | // m_log.DebugFormat("[ASYNC COMMAND MANAGER]: Removing facilities for script {0}", itemID); | ||
233 | |||
228 | // Remove a specific script | 234 | // Remove a specific script |
229 | 235 | ||
230 | // Remove dataserver events | 236 | // Remove dataserver events |
@@ -236,7 +242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
236 | // Remove from: HttpRequest | 242 | // Remove from: HttpRequest |
237 | IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); | 243 | IHttpRequestModule iHttpReq = engine.World.RequestModuleInterface<IHttpRequestModule>(); |
238 | if (iHttpReq != null) | 244 | if (iHttpReq != null) |
239 | iHttpReq.StopHttpRequest(localID, itemID); | 245 | iHttpReq.StopHttpRequestsForScript(itemID); |
240 | 246 | ||
241 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); | 247 | IWorldComm comms = engine.World.RequestModuleInterface<IWorldComm>(); |
242 | if (comms != null) | 248 | if (comms != null) |