tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1655284 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java AbstractHttp11Protocol.java Http11Nio2Processor.java Http11NioProcessor.java
Date Wed, 28 Jan 2015 12:47:00 GMT
Author: markt
Date: Wed Jan 28 12:46:59 2015
New Revision: 1655284

URL: http://svn.apache.org/r1655284
Log:
AbstractHttp11Processor is already obtaining the keep-alive timeout
directly from the Endpoint in some places so refactor to obtain it this
way consistently.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1655284&r1=1655283&r2=1655284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Wed Jan 28 12:46:59
2015
@@ -161,11 +161,6 @@ public abstract class AbstractHttp11Proc
      */
     protected int maxKeepAliveRequests = -1;
 
-    /**
-     * The number of seconds Tomcat will wait for a subsequent request
-     * before closing the connection.
-     */
-    protected int keepAliveTimeout = -1;
 
     /**
      * Maximum timeout on uploads. 5 minutes as in Apache HTTPD server.
@@ -427,21 +422,6 @@ public abstract class AbstractHttp11Proc
         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;
-    }
-
 
     /**
      * Set the maximum size of a POST which will be buffered in SSL mode.

Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java?rev=1655284&r1=1655283&r2=1655284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Wed Jan 28 12:46:59
2015
@@ -217,7 +217,6 @@ public abstract class AbstractHttp11Prot
     protected void configureProcessor(AbstractHttp11Processor<S> processor) {
         processor.setAdapter(getAdapter());
         processor.setMaxKeepAliveRequests(getMaxKeepAliveRequests());
-        processor.setKeepAliveTimeout(getKeepAliveTimeout());
         processor.setConnectionUploadTimeout(getConnectionUploadTimeout());
         processor.setDisableUploadTimeout(getDisableUploadTimeout());
         processor.setCompressionMinSize(getCompressionMinSize());

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Processor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Processor.java?rev=1655284&r1=1655283&r2=1655284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Nio2Processor.java Wed Jan 28 12:46:59
2015
@@ -81,13 +81,12 @@ public class Http11Nio2Processor extends
     protected void resetTimeouts() {
         if (!getErrorState().isError() && socketWrapper != null &&
                 asyncStateMachine.isAsyncDispatching()) {
-            long soTimeout = endpoint.getSoTimeout();
 
-            //reset the timeout
+            // Reset the timeout
             if (keepAlive) {
-                socketWrapper.setTimeout(keepAliveTimeout);
+                socketWrapper.setTimeout(endpoint.getKeepAliveTimeout());
             } else {
-                socketWrapper.setTimeout(soTimeout);
+                socketWrapper.setTimeout(endpoint.getSoTimeout());
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java?rev=1655284&r1=1655283&r2=1655284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java Wed Jan 28 12:46:59
2015
@@ -68,13 +68,12 @@ public class Http11NioProcessor extends
         final NioEndpoint.NioSocketWrapper attach = (NioEndpoint.NioSocketWrapper)socketWrapper.getSocket().getAttachment();
         if (!getErrorState().isError() && attach != null &&
                 asyncStateMachine.isAsyncDispatching()) {
-            long soTimeout = endpoint.getSoTimeout();
 
-            //reset the timeout
+            // Reset the timeout
             if (keepAlive) {
-                attach.setTimeout(keepAliveTimeout);
+                attach.setTimeout(endpoint.getKeepAliveTimeout());
             } else {
-                attach.setTimeout(soTimeout);
+                attach.setTimeout(endpoint.getSoTimeout());
             }
         }
     }



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


Mime
View raw message