change event pool timeout handling

master
UbitUmarov 2020-04-21 00:19:19 +01:00
parent 43fdbf87d4
commit 50b81258a9
2 changed files with 7 additions and 11 deletions

View File

@ -148,6 +148,10 @@ namespace OpenSim.Framework.Servers.HttpServer
if (responsedata.ContainsKey("keepalive")) if (responsedata.ContainsKey("keepalive"))
response.KeepAlive = (bool)responsedata["keepalive"]; response.KeepAlive = (bool)responsedata["keepalive"];
if (responsedata.ContainsKey("keepaliveTimeout"))
response.KeepAliveTimeout = (int)responsedata["keepaliveTimeout"];
if (responsedata.ContainsKey("prio")) if (responsedata.ContainsKey("prio"))
response.Priority = (int)responsedata["prio"]; response.Priority = (int)responsedata["prio"];

View File

@ -65,13 +65,6 @@ namespace OpenSim.Region.ClientStack.Linden
/// </value> /// </value>
public int DebugLevel { get; set; } public int DebugLevel { get; set; }
// Viewer post requests timeout in 60 secs
// https://bitbucket.org/lindenlab/viewer-release/src/421c20423df93d650cc305dc115922bb30040999/indra/llmessage/llhttpclient.cpp?at=default#cl-44
//
private const int VIEWER_TIMEOUT = 60 * 1000;
// Just to be safe, we work on a 10 sec shorter cycle
private const int SERVER_EQ_TIME_NO_EVENTS = VIEWER_TIMEOUT - (10 * 1000);
protected Scene m_scene; protected Scene m_scene;
private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
@ -363,7 +356,7 @@ namespace OpenSim.Region.ClientStack.Linden
caps.RegisterPollHandler( caps.RegisterPollHandler(
"EventQueueGet", "EventQueueGet",
new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS)); new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, int.MaxValue));
} }
public bool HasEvents(UUID requestID, UUID agentID) public bool HasEvents(UUID requestID, UUID agentID)
@ -396,7 +389,7 @@ namespace OpenSim.Region.ClientStack.Linden
} }
public void Drop(UUID requestID, UUID pAgentId) public void Drop(UUID requestID, UUID pAgentId)
{ {
// do nothing for now, hope client close will do it // do nothing, in last case http server will do it
} }
public Hashtable GetEvents(UUID requestID, UUID pAgentId) public Hashtable GetEvents(UUID requestID, UUID pAgentId)
@ -464,7 +457,7 @@ namespace OpenSim.Region.ClientStack.Linden
responsedata["content_type"] = "application/xml"; responsedata["content_type"] = "application/xml";
//string tt = OSDParser.SerializeLLSDXmlString(events); //string tt = OSDParser.SerializeLLSDXmlString(events);
responsedata["bin_response_data"] = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(events)); responsedata["bin_response_data"] = Encoding.UTF8.GetBytes(OSDParser.SerializeLLSDXmlString(events));
responsedata["keepaliveTimeout"] = 60;
//m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]); //m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", pAgentId, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
return responsedata; return responsedata;
} }
@ -476,7 +469,6 @@ namespace OpenSim.Region.ClientStack.Linden
responsedata["content_type"] = "text/plain"; responsedata["content_type"] = "text/plain";
responsedata["str_response_string"] = "<llsd></llsd>"; responsedata["str_response_string"] = "<llsd></llsd>";
responsedata["error_status_text"] = "<llsd></llsd>"; responsedata["error_status_text"] = "<llsd></llsd>";
responsedata["http_protocol_version"] = "HTTP/1.0";
responsedata["keepalive"] = false; responsedata["keepalive"] = false;
return responsedata; return responsedata;
} }