You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2006/09/29 11:42:57 UTC

svn commit: r451202 - in /tomcat/tc6.0.x/trunk/java/org/apache: catalina/connector/ coyote/ajp/ coyote/http11/ tomcat/util/net/

Author: remm
Date: Fri Sep 29 02:42:56 2006
New Revision: 451202

URL: http://svn.apache.org/viewvc?view=rev&rev=451202
Log:
- The addition of keepAliveTimeout is useless for the regular connector, as it already has two different timeouts as an
  option.
- Make it default to soTimeout in the other cases.
- Sendfile should not use keepAliveTimeout, but soTimeout.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Constants.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/Constants.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Constants.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Protocol.java
    tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Constants.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Constants.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Constants.java Fri Sep 29 02:42:56 2006
@@ -34,7 +34,6 @@
     public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
     public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
     public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
-    public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
 
     public static final int PROCESSOR_IDLE = 0;
     public static final int PROCESSOR_ACTIVE = 1;

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Fri Sep 29 02:42:56 2006
@@ -68,6 +68,7 @@
         cHandler = new AjpConnectionHandler(this);
         setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
         setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
+        setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
         //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
         setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
     }

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/Constants.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/Constants.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/ajp/Constants.java Fri Sep 29 02:42:56 2006
@@ -38,7 +38,6 @@
     public static final int DEFAULT_CONNECTION_LINGER = -1;
     public static final int DEFAULT_CONNECTION_TIMEOUT = -1;
     public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
-    public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;    
     public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
     public static final boolean DEFAULT_TCP_NO_DELAY = true;
 

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Constants.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Constants.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Constants.java Fri Sep 29 02:42:56 2006
@@ -39,7 +39,6 @@
     public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
     public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
     public static final int DEFAULT_SERVER_SOCKET_TIMEOUT = 0;
-    public static final int DEFAULT_KEEPALIVE_TIMEOUT = 15000;
     public static final boolean DEFAULT_TCP_NO_DELAY = true;
     
     

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Fri Sep 29 02:42:56 2006
@@ -209,12 +209,6 @@
     protected int maxKeepAliveRequests = -1;
 
     /**
-     * The number of seconds Tomcat will wait for a subsequent request
-     * before closing the connection.
-     */
-    protected int keepAliveTimeout = 15000;
-
-    /**
      * SSL enabled ?
      */
     protected boolean ssl = false;
@@ -646,21 +640,6 @@
      */
     public int getMaxKeepAliveRequests() {
         return maxKeepAliveRequests;
-    }
-
-    /**
-     * Set the Keep-Alive timeout.
-     */
-    public void setKeepAliveTimeout(int timeout) {
-        keepAliveTimeout = timeout;
-    }
-
-
-    /**
-     * Return the number Keep-Alive timeout.
-     */
-    public int getKeepAliveTimeout() {
-        return keepAliveTimeout;
     }
 
     /**

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Fri Sep 29 02:42:56 2006
@@ -54,6 +54,7 @@
         cHandler = new Http11ConnectionHandler( this );
         setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
         setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
+        setKeepAliveTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
         //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
         setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
     }

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Processor.java Fri Sep 29 02:42:56 2006
@@ -185,12 +185,6 @@
      */
     protected int maxKeepAliveRequests = -1;
 
-    /**
-     * The number of seconds Tomcat will wait for a subsequent request
-     * before closing the connection.
-     */
-    protected int keepAliveTimeout = 15000;
-
 
     /**
      * SSL information.
@@ -627,22 +621,6 @@
     }
 
     /**
-     * Set the Keep-Alive timeout.
-     */
-    public void setKeepAliveTimeout(int timeout) {
-        keepAliveTimeout = timeout;
-    }
-
-
-    /**
-     * Return the number Keep-Alive timeout.
-     */
-    public int getKeepAliveTimeout() {
-        return keepAliveTimeout;
-    }
-
-
-    /**
      * Set the maximum size of a POST which will be buffered in SSL mode.
      */
     public void setMaxSavePostSize(int msps) {
@@ -799,13 +777,8 @@
 
             // Parsing the request header
             try {
-                if (!disableUploadTimeout && keptAlive) {
-                    if (keepAliveTimeout > 0) {
-                        socket.setSoTimeout(keepAliveTimeout);
-                    }
-                    else if (soTimeout > 0) {
-                        socket.setSoTimeout(soTimeout);                        
-                    }
+                if( !disableUploadTimeout && keptAlive && soTimeout > 0 ) {
+                    socket.setSoTimeout(soTimeout);
                 }
                 inputBuffer.parseRequestLine();
                 request.setStartTime(System.currentTimeMillis());

Modified: tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Protocol.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11Protocol.java Fri Sep 29 02:42:56 2006
@@ -70,7 +70,6 @@
     public Http11Protocol() {
         setSoLinger(Constants.DEFAULT_CONNECTION_LINGER);
         setSoTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
-        setKeepAliveTimeout(Constants.DEFAULT_KEEPALIVE_TIMEOUT);
         //setServerSoTimeout(Constants.DEFAULT_SERVER_SOCKET_TIMEOUT);
         setTcpNoDelay(Constants.DEFAULT_TCP_NO_DELAY);
     }
@@ -284,17 +283,6 @@
 
     // HTTP
     /**
-     * The number of seconds Tomcat will wait for a subsequent request
-     * before closing the connection. The default is the same as for
-     * Apache HTTP Server (15 000 milliseconds).
-     */
-    protected int keepAliveTimeout = 15000;
-    public int getKeepAliveTimeout() { return keepAliveTimeout; }
-    public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; }
-
-
-    // HTTP
-    /**
      * This timeout represents the socket timeout which will be used while
      * the adapter execution is in progress, unless disableUploadTimeout
      * is set to true. The default is the same as for Apache HTTP Server
@@ -591,7 +579,6 @@
                         new Http11Processor(protocol.maxHttpHeaderSize, protocol.endpoint);
                     processor.setAdapter(protocol.adapter);
                     processor.setMaxKeepAliveRequests(protocol.maxKeepAliveRequests);
-                    processor.setKeepAliveTimeout(protocol.keepAliveTimeout);
                     processor.setTimeout(protocol.timeout);
                     processor.setDisableUploadTimeout(protocol.disableUploadTimeout);
                     processor.setCompression(protocol.compression);

Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?view=diff&rev=451202&r1=451201&r2=451202
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep 29 02:42:56 2006
@@ -258,7 +258,7 @@
     /**
      * Keep-Alive timeout.
      */
-    protected int keepAliveTimeout = 15000;
+    protected int keepAliveTimeout = -1;
     public int getKeepAliveTimeout() { return keepAliveTimeout; }
     public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; }
 
@@ -1573,14 +1573,14 @@
         protected void init() {
             pool = Pool.create(serverSockPool);
             int size = sendfileSize / sendfileThreadCount;
-            sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+            sendfilePollset = allocatePoller(size, pool, soTimeout);
             if (sendfilePollset == 0 && size > 1024) {
                 size = 1024;
-                sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+                sendfilePollset = allocatePoller(size, pool, soTimeout);
             }
             if (sendfilePollset == 0) {
                 size = 62;
-                sendfilePollset = allocatePoller(size, pool, keepAliveTimeout);
+                sendfilePollset = allocatePoller(size, pool, soTimeout);
             }
             desc = new long[size * 2];
             sendfileData = new HashMap<Long, SendfileData>(size);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org