From 442b27222828381a27c7c5eddc967a0de4c82d0a Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 17 Jul 2016 13:20:56 +0100 Subject: add a Drop method to PollService Event handlers, Drop requests on connections known to be lost or delay event check if they are sending a response --- .../CoreModules/Scripting/LSLHttp/UrlModule.cs | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Scripting') diff --git a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs index f563c68..c118f33 100644 --- a/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs @@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp string uri = "/lslhttp/" + urlcode.ToString() + "/"; PollServiceEventArgs args - = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); + = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); args.Type = PollServiceEventArgs.EventType.LslHttp; m_HttpServer.AddPollServiceHTTPHandler(uri, args); @@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp string uri = "/lslhttps/" + urlcode.ToString() + "/"; PollServiceEventArgs args - = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, urlcode, 25000); + = new PollServiceEventArgs(HttpRequestHandler, uri, HasEvents, GetEvents, NoEvents, Drop, urlcode, 25000); args.Type = PollServiceEventArgs.EventType.LslHttp; m_HttpsServer.AddPollServiceHTTPHandler(uri, args); @@ -530,6 +530,28 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp } } } + + private void Drop(UUID requestID, UUID sessionID) + { + UrlData url = null; + lock (m_RequestMap) + { + if (m_RequestMap.ContainsKey(requestID)) + { + url = m_RequestMap[requestID]; + m_RequestMap.Remove(requestID); + if(url != null) + { + lock (url.requests) + { + if(url.requests.ContainsKey(requestID)) + url.requests.Remove(requestID); + } + } + } + } + } + private Hashtable GetEvents(UUID requestID, UUID sessionID) { UrlData url = null; -- cgit v1.1