Index: ../../../Apache/httpcomponents/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java =================================================================== --- ../../../Apache/httpcomponents/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java Sun May 17 22:08:31 EEST 2009 +++ ../../../Apache/httpcomponents/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/codecs/ChunkDecoder.java (revision 775728) @@ -199,9 +199,9 @@ } int maxLen = this.chunkSize - this.pos; int len = this.buffer.read(dst, maxLen); - - validateChunk(maxLen, len); - + if (maxLen > 0 && len == 0 && this.endOfStream) { + throw new MalformedChunkCodingException("Truncated chunk"); + } this.pos += len; totalRead += len; @@ -241,12 +241,6 @@ return totalRead; } - protected void validateChunk(int maxLengthToRead, int actuallyReadLength) throws IOException { - if (maxLengthToRead > 0 && actuallyReadLength == 0 && this.endOfStream) { - throw new MalformedChunkCodingException("Truncated chunk"); - } - } - public Header[] getFooters() { if (this.footers != null) { return this.footers.clone();