tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r958911 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java filters/BufferedInputFilter.java
Date Tue, 29 Jun 2010 10:13:55 GMT
Author: jfclere
Date: Tue Jun 29 10:13:54 2010
New Revision: 958911

URL: http://svn.apache.org/viewvc?rev=958911&view=rev
Log:
Arrange filter logic.

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java
    tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.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=958911&r1=958910&r2=958911&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Jun 29 10:13:54
2010
@@ -54,6 +54,12 @@ public abstract class AbstractHttp11Proc
     protected static boolean isSecurityEnabled = 
         org.apache.coyote.Constants.IS_SECURITY_ENABLED;
 
+    /*
+     * 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;
+    
     /**
      * Associated adapter.
      */
@@ -764,7 +770,8 @@ public abstract class AbstractHttp11Proc
         // Create and add the chunked filters.
         //getInputBuffer().addFilter(new GzipInputFilter());
         getOutputBuffer().addFilter(new GzipOutputFilter());
-
+        
+        pluggableFilterIndex = getInputBuffer().getFilters().length;
     }
 
     
@@ -807,7 +814,7 @@ public abstract class AbstractHttp11Proc
                 (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)) {
                     getInputBuffer().addActiveFilter(inputFilters[i]);

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java?rev=958911&r1=958910&r2=958911&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/BufferedInputFilter.java Tue Jun 29
10:13:54 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;



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


Mime
View raw message