tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r480598 - in /tomcat/tc6.0.x/trunk/java/org/apache: coyote/ajp/ coyote/http11/ tomcat/util/net/
Date Wed, 29 Nov 2006 15:28:01 GMT
Author: remm
Date: Wed Nov 29 07:28:00 2006
New Revision: 480598

URL: http://svn.apache.org/viewvc?view=rev&rev=480598
Log:
- Experiment with using soTimeout as the keepAliveTimeout if it's not specified (this way,
the configuration behavior 
  remains the same as before - by default).

Modified:
    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/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/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=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00 2006
@@ -17,9 +17,8 @@
 
 package org.apache.coyote.ajp;
 
-import java.lang.IndexOutOfBoundsException;
 import java.util.Hashtable;
-import java.util.Locale;
+
 import org.apache.tomcat.util.buf.ByteChunk;
 
 
@@ -42,7 +41,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 = -1;
     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=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00
2006
@@ -39,7 +39,6 @@
     public static final int DEFAULT_CONNECTION_LINGER = -1;
     public static final int DEFAULT_CONNECTION_TIMEOUT = 60000;
     public static final int DEFAULT_CONNECTION_UPLOAD_TIMEOUT = 300000;
-    public static final int DEFAULT_KEEPALIVE_TIMEOUT = 60000;
     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/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?view=diff&rev=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00
2006
@@ -476,6 +476,10 @@
         ep.setKeepAliveTimeout(timeout);
     }
 
+    public boolean getKeepAlive() {
+        return ((maxKeepAliveRequests != 0) && (maxKeepAliveRequests != 1));
+    }
+
     /**
      * Set the keep-alive policy for this connection.
      */

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=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00
2006
@@ -190,7 +190,7 @@
      * The number of seconds Tomcat will wait for a subsequent request
      * before closing the connection.
      */
-    protected int keepAliveTimeout = 15000;
+    protected int keepAliveTimeout = -1;
 
 
     /**

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=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00
2006
@@ -71,7 +71,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);
     }
@@ -292,16 +291,9 @@
      * 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;
-    }
+    protected int keepAliveTimeout = -1;
+    public int getKeepAliveTimeout() { return keepAliveTimeout; }
+    public void setKeepAliveTimeout(int timeout) { keepAliveTimeout = timeout; }
 
     // HTTP
     /**

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=480598&r1=480597&r2=480598
==============================================================================
--- 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 Wed Nov 29 07:28:00
2006
@@ -652,6 +652,11 @@
             }
         }
         
+        // Initialize keepalive timeout if it has not been set
+        if (keepAliveTimeout == -1) {
+            keepAliveTimeout = soTimeout;
+        }
+        
         // 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.



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


Mime
View raw message