You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2014/02/06 15:04:09 UTC

[jira] [Commented] (HTTPCORE-372) ChunkedInputStream and ChunkDecoder allows closing chunk absence

    [ https://issues.apache.org/jira/browse/HTTPCORE-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13893363#comment-13893363 ] 

Oleg Kalnichevski commented on HTTPCORE-372:
--------------------------------------------

Dmitry
The leniency in handling of closing chunks was introduced per user request to improve compatibility with early versions of Microsoft IIS servers. So, it is not really a bug. However I am fine with making 4.4 less forgiving about such protocol violations. 

However your patch also introduces some changes to the parsing logic in ChunkDecoder. Could you please split your patch into two change-sets, one containing ChunkDecoder refactoring and another one pertaining to handling of closing chunks and protocol compliance?

Oleg

> ChunkedInputStream and ChunkDecoder allows closing chunk absence
> ----------------------------------------------------------------
>
>                 Key: HTTPCORE-372
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-372
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>          Components: HttpCore, HttpCore NIO
>            Reporter: Dmitry Potapov
>             Fix For: 4.4-alpha1
>
>         Attachments: expect-closing-chunk.patch
>
>
> I've found that both these classes treats chunked streams without closing chunk as complete streams without any errors. This contradicts RFC2616 ยง3.6.1
> Consider the following scenario:
> 1. HttpClient sends request to Server
> 2. Server accepts request and send response headers with Transfer-Encoding: chunked
> 3. Server sends first chunk completely and dies with segfault before sending the next chunk
> 4. HttpClient receives response headers and creates ChunkedInputStream
> 5. ChunkedInputStream reads this first chunk and encounters eof
> Expected result:
> IOException thrown indicating incomplete response
> Actual result:
> No exception is thrown, -1 is returned on the next read and nobody knows that response is incomplete.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org