Author: markt
Date: Wed Dec 14 11:04:12 2016
New Revision: 1774169

URL: http://svn.apache.org/viewvc?rev=1774169&view=rev
Log:
Don't duplicate storage of maxKeepAliveRequests in the Processor

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java

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=1774169&r1=1774168&r2=1774169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Protocol.java Wed 
Dec 14 11:04:12 2016
@@ -390,6 +390,13 @@ public abstract class AbstractHttp11Prot
     public int getMaxKeepAliveRequests() {
         return getEndpoint().getMaxKeepAliveRequests();
     }
+    /**
+     * Set the maximum number of Keep-Alive requests to allow.
+     * This is to safeguard from DoS attacks. Setting to a negative
+     * value disables the limit.
+     *
+     * @param mkar The new maximum number of Keep-Alive requests allowed
+     */
     public void setMaxKeepAliveRequests(int mkar) {
         getEndpoint().setMaxKeepAliveRequests(mkar);
     }
@@ -641,7 +648,6 @@ public abstract class AbstractHttp11Prot
     protected Processor createProcessor() {
         Http11Processor processor = new Http11Processor(this);
         processor.setAdapter(getAdapter());
-        processor.setMaxKeepAliveRequests(getMaxKeepAliveRequests());
         processor.setConnectionUploadTimeout(getConnectionUploadTimeout());
         processor.setDisableUploadTimeout(getDisableUploadTimeout());
         processor.setCompressionMinSize(getCompressionMinSize());

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java?rev=1774169&r1=1774168&r2=1774169&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java Wed Dec 14 
11:04:12 2016
@@ -135,12 +135,6 @@ public class Http11Processor extends Abs
 
 
     /**
-     * Maximum number of Keep-Alive requests to honor.
-     */
-    protected int maxKeepAliveRequests = -1;
-
-
-    /**
      * Maximum timeout on uploads. 5 minutes as in Apache HTTPD server.
      */
     protected int connectionUploadTimeout = 300000;
@@ -376,29 +370,6 @@ public class Http11Processor extends Abs
 
 
     /**
-     * Set the maximum number of Keep-Alive requests to allow.
-     * This is to safeguard from DoS attacks. Setting to a negative
-     * value disables the limit.
-     *
-     * @param mkar The new maximum number of Keep-Alive requests allowed
-     */
-    public void setMaxKeepAliveRequests(int mkar) {
-        maxKeepAliveRequests = mkar;
-    }
-
-
-    /**
-     * Get the maximum number of Keep-Alive requests allowed. A negative value
-     * means there is no limit.
-     *
-     * @return the number of Keep-Alive requests that we will allow.
-     */
-    public int getMaxKeepAliveRequests() {
-        return maxKeepAliveRequests;
-    }
-
-
-    /**
      * Set the maximum size of a POST which will be buffered in SSL mode.
      * When a POST is received where the security constraints require a client
      * certificate, the POST body needs to be buffered while an SSL handshake
@@ -761,6 +732,7 @@ public class Http11Processor extends Abs
                 }
             }
 
+            int maxKeepAliveRequests = protocol.getMaxKeepAliveRequests();
             if (maxKeepAliveRequests == 1) {
                 keepAlive = false;
             } else if (maxKeepAliveRequests > 0 &&



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

Reply via email to