remm        2002/08/12 07:34:10

  Modified:    http11/src/java/org/apache/coyote/http11/filters
                        ChunkedInputFilter.java
  Log:
  - Fix a derivative of bug 11117.
  - The buffer could be refilled while reading the chunk header. Also, this
    simplifies the algorithm.
  - Patch submitted by Michael Smith <msmith at ns.xn.com.au>
  
  Revision  Changes    Path
  1.7       +3 -16     
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java
  
  Index: ChunkedInputFilter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ChunkedInputFilter.java   8 Aug 2002 02:55:35 -0000       1.6
  +++ ChunkedInputFilter.java   12 Aug 2002 14:34:10 -0000      1.7
  @@ -283,8 +283,6 @@
   
           int result = 0;
           boolean eol = false;
  -        int begin = pos;
  -        int end = begin;
           boolean readDigit = false;
   
           while (!eol) {
  @@ -299,11 +297,9 @@
                   eol = true;
               } else {
                   if (HexUtils.DEC[buf[pos]] != -1) {
  -                    if (!readDigit) {
  -                        readDigit = true;
  -                        begin = pos;
  -                    }
  -                    end = pos;
  +                    readDigit = true;
  +                    result *= 16;
  +                    result += HexUtils.DEC[buf[pos]];
                   }
               }
   
  @@ -313,15 +309,6 @@
   
           if (!readDigit)
               return false;
  -
  -        int offset = 1;
  -        for (int i = end; i >= begin; i--) {
  -            int val = HexUtils.DEC[buf[i]];
  -            if (val == -1)
  -                return false;
  -            result = result + val * offset;
  -            offset = offset * 16;
  -        }
   
           if (result == 0)
               endChunk = true;
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to