Author: markt
Date: Mon Oct 27 15:04:51 2008
New Revision: 708344

URL: http://svn.apache.org/viewvc?rev=708344&view=rev
Log:
Expose deferAccept for APR HTTP connector.
I did consider adding this to the AJP connector as well but since this is to 
work around a buggy client and we control the client in the AJP case, I 
couldn't see a need for it.
Patch provided by Michael Leinartas.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
    tomcat/trunk/webapps/docs/config/ajp.xml

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=708344&r1=708343&r2=708344&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Oct 
27 15:04:51 2008
@@ -250,7 +250,10 @@
     
     public void setSendfileThreadCount(int sendfileThreadCount) { 
endpoint.setSendfileThreadCount(sendfileThreadCount); }
     public int getSendfileThreadCount() { return 
endpoint.getSendfileThreadCount(); }
-    
+
+    public boolean getDeferAccept() { return endpoint.getDeferAccept(); }
+    public void setDeferAccept(boolean deferAccept) { 
endpoint.setDeferAccept(deferAccept); }
+
     protected int socketBuffer = 9000;
     public int getSocketBuffer() { return socketBuffer; }
     public void setSocketBuffer(int socketBuffer) { this.socketBuffer = 
socketBuffer; }

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=708344&r1=708343&r2=708344&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Mon Oct 27 
15:04:51 2008
@@ -156,15 +156,17 @@
     protected long sslContext = 0;
 
     
+    // ------------------------------------------------------------- Properties
+
+
     /**
      * Defer accept.
      */
     protected boolean deferAccept = true;
+    public void setDeferAccept(boolean deferAccept) { this.deferAccept = 
deferAccept; }
+    public boolean getDeferAccept() { return deferAccept; }
     
 
-    // ------------------------------------------------------------- Properties
-
-
     /**
      * External Executor based thread pool.
      */
@@ -659,8 +661,10 @@
         // 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) {
-            deferAccept = false;
+        if (deferAccept) {
+            if (Socket.optSet(serverSock, Socket.APR_TCP_DEFER_ACCEPT, 1) == 
Status.APR_ENOTIMPL) {
+                deferAccept = false;
+            }
         }
 
         // Initialize SSL if needed

Modified: tomcat/trunk/webapps/docs/config/ajp.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/ajp.xml?rev=708344&r1=708343&r2=708344&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/config/ajp.xml (original)
+++ tomcat/trunk/webapps/docs/config/ajp.xml Mon Oct 27 15:04:51 2008
@@ -236,6 +236,13 @@
       presented.  The default value is infinite (i.e. no timeout).</p>
     </attribute>
     
+    <attribute name="deferAccept" required="false">
+      <p>Sets the <code>TCP_DEFER_ACCEPT</code> flag on the listening socket 
for
+      this connector. The default value is <code>true</code> where
+      <code>TCP_DEFER_ACCEPT</code> is supported by the operating system,
+      otherwise it is <code>false</code>.</p>
+    </attribute>
+    
     <attribute name="executor" required="false">
       <p>A reference to the name in an <a href="executor.html">Executor</a> 
element.
          If this attribute is enabled, and the named executor exists, the 
connector will



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to