Author: remy.maucherat(a)jboss.com
Date: 2008-10-27 11:01:23 -0400 (Mon, 27 Oct 2008)
New Revision: 817
Modified:
trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
trunk/webapps/docs/apr.xml
trunk/webapps/docs/changelog.xml
Log:
- Add defer accept flag.
Modified: trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2008-10-23 15:17:08 UTC (rev
816)
+++ trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java 2008-10-27 15:01:23 UTC (rev
817)
@@ -293,6 +293,9 @@
public boolean getReverseConnection() { return endpoint.isReverseConnection(); }
public void setReverseConnection(boolean reverseConnection) {
endpoint.setReverseConnection(reverseConnection); }
+ public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+ public void setDeferAccept(boolean deferAccept) {
endpoint.setDeferAccept(deferAccept); }
+
/**
* Should authentication be done in the native webserver layer,
* or in the Servlet container ?
Modified: trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
===================================================================
--- trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2008-10-23 15:17:08 UTC
(rev 816)
+++ trunk/java/org/apache/coyote/http11/Http11AprProtocol.java 2008-10-27 15:01:23 UTC
(rev 817)
@@ -247,6 +247,9 @@
public boolean getReverseConnection() { return endpoint.isReverseConnection(); }
public void setReverseConnection(boolean reverseConnection) {
endpoint.setReverseConnection(reverseConnection); }
+ public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+ public void setDeferAccept(boolean deferAccept) {
endpoint.setDeferAccept(deferAccept); }
+
/**
* The number of seconds Tomcat will wait for a subsequent request
* before closing the connection.
Modified: trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-23 15:17:08 UTC (rev
816)
+++ trunk/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-10-27 15:01:23 UTC (rev
817)
@@ -155,12 +155,6 @@
protected long sslContext = 0;
- /**
- * Defer accept.
- */
- protected boolean deferAccept = true;
-
-
// ------------------------------------------------------------- Properties
@@ -263,6 +257,14 @@
/**
+ * Defer accept.
+ */
+ protected boolean deferAccept = true;
+ public void setDeferAccept(boolean deferAccept) { this.deferAccept = deferAccept; }
+ public boolean getDeferAccept() { return deferAccept; }
+
+
+ /**
* Keep-Alive timeout.
*/
protected int keepAliveTimeout = -1;
@@ -621,7 +623,7 @@
// Delay accepting of new connections until data is available
// Only Linux kernels 2.4 + have that implemented
// on other platforms this call is noop and will return APR_ENOTIMPL.
- if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) ==
Status.APR_ENOTIMPL) {
+ if (deferAccept && (Socket.optSet(serverSock,
Socket.APR_TCP_DEFER_ACCEPT, 1) == Status.APR_ENOTIMPL)) {
deferAccept = false;
}
} else {
Modified: trunk/webapps/docs/apr.xml
===================================================================
--- trunk/webapps/docs/apr.xml 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/webapps/docs/apr.xml 2008-10-27 15:01:23 UTC (rev 817)
@@ -152,6 +152,10 @@
<attributes>
+ <attribute name="deferAccept" required="false">
+ <p>Use defer accept feature if available. The default value is
true.</p>
+ </attribute>
+
<attribute name="keepAliveTimeout" required="false">
<p>The number of milliseconds this <strong>Connector</strong>
will wait for
another HTTP request before closing the connection.
@@ -315,6 +319,10 @@
<attributes>
+ <attribute name="deferAccept" required="false">
+ <p>Use defer accept feature if available. The default value is
true.</p>
+ </attribute>
+
<attribute name="pollTime" required="false">
<p>Duration of a poll call. Lowering this value will slightly decrease
latency of connections
being kept alive in some cases, but will use more CPU as more poll calls are being
made. The
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2008-10-23 15:17:08 UTC (rev 816)
+++ trunk/webapps/docs/changelog.xml 2008-10-27 15:01:23 UTC (rev 817)
@@ -91,6 +91,9 @@
<fix>
New maxThreads default to 200, up from 40. (remm)
</fix>
+ <fix>
+ <bug>46077</bug>: Add configuration for deferAccept flag. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
Show replies by date