460746 HttpConfiguration#setPersistentConnectionsEnabled(boolean)
This commit is contained in:
parent
6ecfb96508
commit
deec5291f0
|
@ -262,12 +262,17 @@ class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandl
|
|||
{
|
||||
case HTTP_1_0:
|
||||
{
|
||||
if (_connection!=null)
|
||||
if (getHttpConfiguration().isPersistentConnectionsEnabled())
|
||||
{
|
||||
if (_connection.contains(HttpHeaderValue.KEEP_ALIVE.asString()))
|
||||
persistent=true;
|
||||
if (_connection!=null)
|
||||
{
|
||||
if (_connection.contains(HttpHeaderValue.KEEP_ALIVE.asString()))
|
||||
persistent=true;
|
||||
else
|
||||
persistent=_fields.contains(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.asString());
|
||||
}
|
||||
else
|
||||
persistent=_fields.contains(HttpHeader.CONNECTION, HttpHeaderValue.KEEP_ALIVE.asString());
|
||||
persistent=false;
|
||||
}
|
||||
else
|
||||
persistent=false;
|
||||
|
@ -288,15 +293,20 @@ class HttpChannelOverHttp extends HttpChannel implements HttpParser.RequestHandl
|
|||
return false;
|
||||
}
|
||||
|
||||
if (_connection!=null)
|
||||
if (getHttpConfiguration().isPersistentConnectionsEnabled())
|
||||
{
|
||||
if (_connection.contains(HttpHeaderValue.CLOSE.asString()))
|
||||
persistent=false;
|
||||
if (_connection!=null)
|
||||
{
|
||||
if (_connection.contains(HttpHeaderValue.CLOSE.asString()))
|
||||
persistent=false;
|
||||
else
|
||||
persistent=!_fields.contains(HttpHeader.CONNECTION, HttpHeaderValue.CLOSE.asString()); // handle multiple connection fields
|
||||
}
|
||||
else
|
||||
persistent=!_fields.contains(HttpHeader.CONNECTION, HttpHeaderValue.CLOSE.asString()); // handle multiple connection fields
|
||||
persistent=true;
|
||||
}
|
||||
else
|
||||
persistent=true;
|
||||
persistent=false;
|
||||
|
||||
if (!persistent)
|
||||
persistent = HttpMethod.CONNECT.is(_metadata.getMethod());
|
||||
|
|
|
@ -55,6 +55,7 @@ public class HttpConfiguration
|
|||
private boolean _sendXPoweredBy = false;
|
||||
private boolean _sendDateHeader = true;
|
||||
private boolean _delayDispatchUntilContent = true;
|
||||
private boolean _persistentConnectionsEnabled = true;
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
|
@ -181,6 +182,19 @@ public class HttpConfiguration
|
|||
return _secureScheme;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
@ManagedAttribute("True if HTTP/1 persistent connection are enabled")
|
||||
public boolean isPersistentConnectionsEnabled()
|
||||
{
|
||||
return _persistentConnectionsEnabled;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setPersistentConnectionsEnabled(boolean persistentConnectionsEnabled)
|
||||
{
|
||||
_persistentConnectionsEnabled = persistentConnectionsEnabled;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
public void setSendServerVersion (boolean sendServerVersion)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue