Author: trustin
Date: Mon Jan 14 21:06:51 2008
New Revision: 612015

URL: http://svn.apache.org/viewvc?rev=612015&view=rev
Log:
Better handling of chunked HTTP body - applied the patch from Eric Gaumer

Modified:
    
mina/trunk/filter-codec-http/src/main/java/org/apache/mina/filter/codec/http/ChunkedBodyDecodingState.java

Modified: 
mina/trunk/filter-codec-http/src/main/java/org/apache/mina/filter/codec/http/ChunkedBodyDecodingState.java
URL: 
http://svn.apache.org/viewvc/mina/trunk/filter-codec-http/src/main/java/org/apache/mina/filter/codec/http/ChunkedBodyDecodingState.java?rev=612015&r1=612014&r2=612015&view=diff
==============================================================================
--- 
mina/trunk/filter-codec-http/src/main/java/org/apache/mina/filter/codec/http/ChunkedBodyDecodingState.java
 (original)
+++ 
mina/trunk/filter-codec-http/src/main/java/org/apache/mina/filter/codec/http/ChunkedBodyDecodingState.java
 Mon Jan 14 21:06:51 2008
@@ -94,7 +94,7 @@
                         .throwDecoderException("Expected a chunk length.");
             }
 
-            String length = product.getString(asciiDecoder);
+            String length = product.getString(asciiDecoder).trim();
             lastChunkLength = Integer.parseInt(length, 16);
             if (chunkHasExtension) {
                 return SKIP_CHUNK_EXTENSION;
@@ -106,7 +106,7 @@
         @Override
         protected boolean isTerminator(byte b) {
             if (!(b >= '0' && b <= '9' || b >= 'a' && b <= 'f' || b >= 'A'
-                    && b <= 'F')) {
+                && b <= 'F' || b == ' ')) {
                 if (b == ' ' || b == '\r' || b == ';') {
                     chunkHasExtension = (b == ';' || b == ' ');
                     return true;


Reply via email to