From 2a1b5e3540692eb90ccb943fb0aec08c14e9445b Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 14:14:22 +0100 Subject: [PATCH 1/2] A small fix for remote console to accommodate PollServiceArgs behavior a bit better --- OpenSim/Framework/Console/RemoteConsole.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 67bff4c8de..a005e20d14 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -197,7 +197,7 @@ namespace OpenSim.Framework.Console string uri = "/ReadResponses/" + sessionID.ToString() + "/"; - m_Server.AddPollServiceHTTPHandler(uri, HandleHttpCloseSession, + m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll, new PollServiceEventArgs(HasEvents, GetEvents, NoEvents, sessionID)); @@ -230,6 +230,11 @@ namespace OpenSim.Framework.Console return reply; } + private Hashtable HandleHttpPoll(Hashtable request) + { + return new Hashtable(); + } + private Hashtable HandleHttpCloseSession(Hashtable request) { DoExpire(); From 04170521f081bf009bf15f76451b119dc280a438 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 14:59:31 +0100 Subject: [PATCH 2/2] Add a UUID param to NoEvents in PollServiceEventArgs to make it more generic --- OpenSim/Framework/Console/RemoteConsole.cs | 6 +++--- .../Framework/Servers/HttpServer/PollServiceEventArgs.cs | 2 +- .../Servers/HttpServer/PollServiceRequestManager.cs | 2 +- .../Framework/Servers/HttpServer/PollServiceWorkerThread.cs | 2 +- .../CoreModules/Framework/EventQueue/EventQueueGetModule.cs | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index a005e20d14..5a18b94622 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -393,12 +393,12 @@ namespace OpenSim.Framework.Console lock (m_Connections) { if (!m_Connections.ContainsKey(sessionID)) - return NoEvents(); + return NoEvents(UUID.Zero); c = m_Connections[sessionID]; } c.last = System.Environment.TickCount; if (c.lastLineSeen >= m_LineNumber) - return NoEvents(); + return NoEvents(UUID.Zero); Hashtable result = new Hashtable(); @@ -440,7 +440,7 @@ namespace OpenSim.Framework.Console return result; } - private Hashtable NoEvents() + private Hashtable NoEvents(UUID id) { Hashtable result = new Hashtable(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index fed490e5b4..ed387d12f5 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -34,7 +34,7 @@ namespace OpenSim.Framework.Servers.HttpServer public delegate Hashtable GetEventsMethod(UUID pId, string request); - public delegate Hashtable NoEventsMethod(); + public delegate Hashtable NoEventsMethod(UUID pId); public class PollServiceEventArgs : EventArgs { diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 4020190108..db80f1dacd 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer foreach (object o in m_requests) { PollServiceHttpRequest req = (PollServiceHttpRequest) o; - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); } m_requests.Clear(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 41fb37651d..1e8706c417 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs @@ -112,7 +112,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if ((Environment.TickCount - req.RequestTime) > m_timeout) { - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); } else diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 34d46a0d7b..26eed42fe9 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs @@ -350,7 +350,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue lock (queue) { if (queue.Count == 0) - return NoEvents(); + return NoEvents(pAgentId); element = queue.Dequeue(); // 15s timeout } @@ -398,7 +398,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); } - public Hashtable NoEvents() + public Hashtable NoEvents(UUID agentID) { Hashtable responsedata = new Hashtable(); responsedata["int_response_code"] = 502;