On Tue, 2008-10-07 at 20:51 +0100, sebb wrote:

...

> >
> >  Modified: 
> > httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  URL: 
> > http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java?rev=702599&r1=702598&r2=702599&view=diff
> >  
> > ==============================================================================
> >  --- 
> > httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  (original)
> >  +++ 
> > httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/ChunkedInputStream.java
> >  Tue Oct  7 12:33:57 2008
> >  @@ -219,8 +219,7 @@
> >          this.buffer.clear();
> >          int i = this.in.readLine(this.buffer);
> >          if (i == -1) {
> >  -            throw new MalformedChunkCodingException(
> >  -                    "Chunked stream ended unexpectedly");
> 
> Perhaps log a message here, as it is non-standard?
> 
> >  +            return 0;
> >          }
> >          int separator = this.buffer.indexOf(';');
> >          if (separator < 0) {
> >

HttpCore (for better or worse) does not have a dependency on a logging
toolkit. One possibility would be introducing a strict / lenient flag
and throwing MalformedChunkCodingException in the strict mode. However,
this cannot be done without breaking API compatibility with Android, not
until the 4.0.1 release. Besides, as it turned out the non-blocking
chunk content decoder in HttpCore NIO has always been lenient about the
missing closing chunk. At the very least, both implementations, blocking
and non-blocking, are consistent now.

I think it is a fairly harmless protocol violation, which probably can
be tolerated, as it should not result in any data corruption. 

Oleg


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

Reply via email to