tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r959428 - in /tomcat/tc5.5.x/trunk: ./ connectors/http11/src/java/org/apache/coyote/http11/ connectors/http11/src/java/org/apache/coyote/http11/filters/ container/webapps/docs/
Date Wed, 30 Jun 2010 20:43:37 GMT
Author: jfclere
Date: Wed Jun 30 20:43:36 2010
New Revision: 959428

URL: http://svn.apache.org/viewvc?rev=959428&view=rev
Log:
Arrange filter logic. Back port of r958911.

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
    tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
    tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=959428&r1=959427&r2=959428&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Wed Jun 30 20:43:36 2010
@@ -47,8 +47,3 @@ PATCHES PROPOSED TO BACKPORT:
   -0: markt - Consensus was for disabled in 5.5.x
               http://svn.apache.org/viewvc?view=revision&revision=749019
   -1:
-
-* Arrange filter logic.
-  http://svn.apache.org/viewvc?rev=958911&view=rev
-  +1: jfclere, markt, rjung, jim
-  -1:

Modified: tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=959428&r1=959427&r2=959428&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
(original)
+++ tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
Wed Jun 30 20:43:36 2010
@@ -77,6 +77,12 @@ public class Http11AprProcessor implemen
     protected static StringManager sm =
         StringManager.getManager(Constants.Package);
 
+    /*
+     * Tracks how many internal filters are in the filter library so they
+     * are skipped when looking for pluggable filters. 
+     */
+    private int pluggableFilterIndex = Integer.MAX_VALUE;
+
 
     // ----------------------------------------------------------- Constructors
 
@@ -1699,6 +1705,8 @@ public class Http11AprProcessor implemen
         //inputBuffer.addFilter(new GzipInputFilter());
         outputBuffer.addFilter(new GzipOutputFilter());
 
+        pluggableFilterIndex = inputBuffer.filterLibrary.length;
+
     }
 
 
@@ -1717,7 +1725,7 @@ public class Http11AprProcessor implemen
                 (inputFilters[Constants.CHUNKED_FILTER]);
             contentDelimitation = true;
         } else {
-            for (int i = 2; i < inputFilters.length; i++) {
+            for (int i = pluggableFilterIndex; i < inputFilters.length; i++) {
                 if (inputFilters[i].getEncodingName()
                     .toString().equals(encodingName)) {
                     inputBuffer.addActiveFilter(inputFilters[i]);

Modified: tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java?rev=959428&r1=959427&r2=959428&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
(original)
+++ tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java
Wed Jun 30 20:43:36 2010
@@ -78,6 +78,12 @@ public class Http11Processor implements 
     protected static StringManager sm =
         StringManager.getManager(Constants.Package);
 
+    /*
+     * Tracks how many internal filters are in the filter library so they
+     * are skipped when looking for pluggable filters. 
+     */
+    private int pluggableFilterIndex = Integer.MAX_VALUE;
+
 
     // ----------------------------------------------------------- Constructors
 
@@ -1657,6 +1663,8 @@ public class Http11Processor implements 
         //inputBuffer.addFilter(new GzipInputFilter());
         outputBuffer.addFilter(new GzipOutputFilter());
 
+        pluggableFilterIndex = inputBuffer.filterLibrary.length;
+
     }
 
 
@@ -1675,7 +1683,7 @@ public class Http11Processor implements 
                 (inputFilters[Constants.CHUNKED_FILTER]);
             contentDelimitation = true;
         } else {
-            for (int i = 2; i < inputFilters.length; i++) {
+            for (int i = pluggableFilterIndex; i < inputFilters.length; i++) {
                 if (inputFilters[i].getEncodingName()
                     .toString().equals(encodingName)) {
                     inputBuffer.addActiveFilter(inputFilters[i]);

Modified: tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java?rev=959428&r1=959427&r2=959428&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
(original)
+++ tomcat/tc5.5.x/trunk/connectors/http11/src/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
Wed Jun 30 20:43:36 2010
@@ -102,10 +102,12 @@ public class BufferedInputFilter impleme
     }
 
     public void recycle() {
-        if (buffered.getBuffer().length > 65536) {
-            buffered = null;
-        } else {
-            buffered.recycle();
+        if (buffered != null) {
+            if (buffered.getBuffer().length > 65536) {
+                buffered = null;
+            } else {
+                buffered.recycle();
+            }
         }
         tempRead.recycle();
         hasRead = false;

Modified: tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml?rev=959428&r1=959427&r2=959428&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml (original)
+++ tomcat/tc5.5.x/trunk/container/webapps/docs/changelog.xml Wed Jun 30 20:43:36 2010
@@ -107,6 +107,8 @@
   </subsection>
   <subsection name="Coyote">
     <changelog>
+      <fix>Arrange filter logic. (jfclere)
+      </fix>
       <fix>
         <bug>48613</bug>: Only attempt APR/native connector initialization if
         the Listener element has been specified in server.xml. (fhanik/kkolinko)



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


Mime
View raw message