* An attempt to fix mantis #3953
parent
cbeebc209d
commit
f727f26bcc
|
@ -274,7 +274,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
public void OnHandleRequestIOThread(IHttpClientContext context, IHttpRequest request)
|
||||
{
|
||||
OSHttpRequest req = new OSHttpRequest(context, request);
|
||||
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request));
|
||||
OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context);
|
||||
//resp.KeepAlive = req.KeepAlive;
|
||||
//m_log.Info("[Debug BASE HTTP SERVER]: Got Request");
|
||||
//HttpServerContextObj objstate= new HttpServerContextObj(req,resp);
|
||||
|
@ -444,6 +444,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
@ -746,6 +747,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
@ -778,6 +780,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
@ -888,6 +891,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
{
|
||||
response.Send();
|
||||
response.OutputStream.Flush();
|
||||
response.FreeContext();
|
||||
//response.OutputStream.Close();
|
||||
}
|
||||
catch (IOException e)
|
||||
|
@ -1103,6 +1107,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException f)
|
||||
{
|
||||
|
@ -1377,7 +1382,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
//response.OutputStream.Close();
|
||||
try
|
||||
{
|
||||
response.OutputStream.Flush();
|
||||
response.Send();
|
||||
|
||||
if (!response.KeepAlive)
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
@ -1414,6 +1423,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
@ -1449,6 +1459,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
try
|
||||
{
|
||||
response.Send();
|
||||
response.FreeContext();
|
||||
}
|
||||
catch (SocketException e)
|
||||
{
|
||||
|
|
|
@ -258,6 +258,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
|
||||
protected IHttpResponse _httpResponse;
|
||||
private IHttpClientContext _httpClientContext;
|
||||
|
||||
public OSHttpResponse() {}
|
||||
|
||||
|
@ -275,6 +276,12 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
public OSHttpResponse(OSHttpRequest req)
|
||||
{
|
||||
_httpResponse = new HttpResponse(req.IHttpClientContext, req.IHttpRequest);
|
||||
_httpClientContext = req.IHttpClientContext;
|
||||
}
|
||||
public OSHttpResponse(HttpResponse resp, IHttpClientContext clientContext)
|
||||
{
|
||||
_httpResponse = resp;
|
||||
_httpClientContext = clientContext;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -298,5 +305,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
_httpResponse.Send();
|
||||
|
||||
}
|
||||
public void FreeContext()
|
||||
{
|
||||
if (_httpClientContext != null)
|
||||
_httpClientContext.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)));
|
||||
m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext));
|
||||
}
|
||||
|
||||
m_requests.Clear();
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
private readonly BaseHttpServer m_server;
|
||||
private BlockingQueue<PollServiceHttpRequest> m_request;
|
||||
private bool m_running = true;
|
||||
private int m_timeout = 25000;
|
||||
private int m_timeout = 250;
|
||||
|
||||
|
||||
|
||||
|
@ -71,14 +71,14 @@ namespace OpenSim.Framework.Servers.HttpServer
|
|||
|
||||
Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd());
|
||||
m_server.DoHTTPGruntWork(responsedata,
|
||||
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request)));
|
||||
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((Environment.TickCount - req.RequestTime) > m_timeout)
|
||||
{
|
||||
m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(),
|
||||
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request)));
|
||||
new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1616,8 +1616,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
agentData.child = false;
|
||||
agentData.firstname = m_firstName;
|
||||
agentData.lastname = m_lastName;
|
||||
|
||||
|
||||
ICapabilitiesModule capsModule = m_scene.RequestModuleInterface<ICapabilitiesModule>();
|
||||
|
||||
if (capsModule == null) // can happen when shutting down.
|
||||
return agentData;
|
||||
|
||||
agentData.CapsPath = capsModule.GetCapsPath(m_agentId);
|
||||
agentData.ChildrenCapSeeds = new Dictionary<ulong,string>(capsModule.GetChildrenSeeds(m_agentId));
|
||||
|
||||
|
|
|
@ -375,7 +375,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
|||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["int_response_code"] = 200;
|
||||
responsedata["content_type"] = "application/xml";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["keepalive"] = true;
|
||||
responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(events);
|
||||
return responsedata;
|
||||
//m_log.DebugFormat("[EVENTQUEUE]: sending response for {0} in region {1}: {2}", agentID, m_scene.RegionInfo.RegionName, responsedata["str_response_string"]);
|
||||
|
@ -386,7 +386,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
|||
Hashtable responsedata = new Hashtable();
|
||||
responsedata["int_response_code"] = 502;
|
||||
responsedata["content_type"] = "text/plain";
|
||||
responsedata["keepalive"] = false;
|
||||
responsedata["keepalive"] = true;
|
||||
responsedata["str_response_string"] = "Upstream error: ";
|
||||
responsedata["error_status_text"] = "Upstream error:";
|
||||
responsedata["http_protocol_version"] = "HTTP/1.0";
|
||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue