dont let http keepalive and context reuse be true

avinationmerge
UbitUmarov 2015-09-23 23:59:50 +01:00
parent c83351b9c0
commit e441c9cac1
2 changed files with 16 additions and 3 deletions

View File

@ -1270,7 +1270,8 @@ namespace OpenSim.Framework.Servers.HttpServer
requestStream.Close();
//m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody);
response.KeepAlive = true;
// response.KeepAlive = true;
response.KeepAlive = false;
OSD llsdRequest = null;
OSD llsdResponse = null;
@ -1791,16 +1792,19 @@ namespace OpenSim.Framework.Servers.HttpServer
{
response.ProtocolVersion = (string)responsedata["http_protocol_version"];
}
/*
if (responsedata.ContainsKey("keepalive"))
{
bool keepalive = (bool)responsedata["keepalive"];
response.KeepAlive = keepalive;
}
if (responsedata.ContainsKey("reusecontext"))
response.ReuseContext = (bool) responsedata["reusecontext"];
*/
// disable this things
response.KeepAlive = false;
response.ReuseContext = false;
// Cross-Origin Resource Sharing with simple requests
if (responsedata.ContainsKey("access_control_allow_origin"))
@ -1814,8 +1818,11 @@ namespace OpenSim.Framework.Servers.HttpServer
contentType = "text/html";
}
// The client ignores anything but 200 here for web login, so ensure that this is 200 for that
response.StatusCode = responsecode;
if (responsecode == (int)OSHttpStatusCode.RedirectMovedPermanently)

View File

@ -148,6 +148,7 @@ namespace OpenSim.Framework.Servers.HttpServer
_httpResponse.Connection = ConnectionType.Close;
_httpResponse.KeepAlive = 0;
}
else
{
_httpResponse.Connection = ConnectionType.KeepAlive;
@ -320,6 +321,11 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Send()
{
_httpResponse.Body.Flush();
// disable this till they are safe to use
_httpResponse.Connection = ConnectionType.Close;
_httpResponse.Chunked = false;
_httpResponse.Send();
}