You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bi...@apache.org on 2002/08/08 07:37:10 UTC

cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters IdentityInputFilter.java

billbarker    2002/08/07 22:37:10

  Modified:    http11/src/java/org/apache/coyote/http11/filters
                        IdentityInputFilter.java
  Log:
  Avoid looping on when trying to trash un-read input.
  
  Fix for Bug #11417
  Reported By: Amund Elstad amund.elstad@ergo.no
  
  Revision  Changes    Path
  1.10      +6 -1      jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java
  
  Index: IdentityInputFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/IdentityInputFilter.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- IdentityInputFilter.java	9 Apr 2002 18:35:54 -0000	1.9
  +++ IdentityInputFilter.java	8 Aug 2002 05:37:10 -0000	1.10
  @@ -200,7 +200,12 @@
   
           // Consume extra bytes.
           while (remaining > 0) {
  -            remaining = remaining - buffer.doRead(endChunk, null);
  +            int nread = buffer.doRead(endChunk, null);
  +            if (nread > 0 ) {
  +                remaining = remaining - nread;
  +            } else { // errors are handled higher up.
  +                remaining = 0;
  +            }
           }
   
           // If too many bytes were read, return the amount.
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>