cancel keepalive if http status not OK, this maybe a bit 2 hardm but ok for now
parent
7f2cfe734b
commit
80de74e127
|
@ -161,7 +161,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
/// </value>
|
/// </value>
|
||||||
// public Hashtable Form { get; private set; }
|
// public Hashtable Form { get; private set; }
|
||||||
|
|
||||||
public string RawUrl
|
public string RawUrl
|
||||||
{
|
{
|
||||||
get { return m_request.Uri.AbsolutePath; }
|
get { return m_request.Uri.AbsolutePath; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -246,14 +246,25 @@ namespace OSHttpServer
|
||||||
if (m_headers["Server"] == null)
|
if (m_headers["Server"] == null)
|
||||||
sb.Append("Server: OSWebServer\r\n");
|
sb.Append("Server: OSWebServer\r\n");
|
||||||
|
|
||||||
int keepaliveS = m_context.TimeoutKeepAlive / 1000;
|
if(Status != HttpStatusCode.OK)
|
||||||
if (Connection == ConnectionType.KeepAlive && keepaliveS > 0 && m_context.MaxRequests > 0)
|
|
||||||
{
|
{
|
||||||
sb.AppendFormat("Keep-Alive:timeout={0}, max={1}\r\n", keepaliveS, m_context.MaxRequests);
|
sb.Append("Connection: close\r\n");
|
||||||
sb.Append("Connection: Keep-Alive\r\n");
|
Connection = ConnectionType.Close;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sb.Append("Connection: close\r\n");
|
{
|
||||||
|
int keepaliveS = m_context.TimeoutKeepAlive / 1000;
|
||||||
|
if (Connection == ConnectionType.KeepAlive && keepaliveS > 0 && m_context.MaxRequests > 0)
|
||||||
|
{
|
||||||
|
sb.AppendFormat("Keep-Alive:timeout={0}, max={1}\r\n", keepaliveS, m_context.MaxRequests);
|
||||||
|
sb.Append("Connection: Keep-Alive\r\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sb.Append("Connection: close\r\n");
|
||||||
|
Connection = ConnectionType.Close;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_headers["Connection"] != null)
|
if (m_headers["Connection"] != null)
|
||||||
m_headers["Connection"] = null;
|
m_headers["Connection"] = null;
|
||||||
|
|
Loading…
Reference in New Issue