You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2013/05/24 16:06:41 UTC

svn commit: r1486059 - /tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java

Author: markt
Date: Fri May 24 14:06:40 2013
New Revision: 1486059

URL: http://svn.apache.org/r1486059
Log:
Marginally more efficient

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java?rev=1486059&r1=1486058&r2=1486059&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/filters/SavedRequestInputFilter.java Fri May 24 14:06:40 2013
@@ -49,6 +49,9 @@ public class SavedRequestInputFilter imp
     @Override
     public int doRead(ByteChunk chunk, org.apache.coyote.Request request)
             throws IOException {
+        if(input.getOffset()>= input.getEnd())
+            return -1;
+
         int writeLength = 0;
 
         if (chunk.getLimit() > 0 && chunk.getLimit() < input.getLength()) {
@@ -57,9 +60,6 @@ public class SavedRequestInputFilter imp
             writeLength = input.getLength();
         }
 
-        if(input.getOffset()>= input.getEnd())
-            return -1;
-
         input.substract(chunk.getBuffer(), 0, writeLength);
         chunk.setOffset(0);
         chunk.setEnd(writeLength);



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