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

Oleg Kalnichevski commented on HTTPCORE-655:
--------------------------------------------

[~Marcono1234] Something along these lines:
* Note that this class NEVER closes the underlying stream, even when close
* gets called.  Instead, it will mark the underlying as connection as no longer 
valid.

> IdentityInputStream javadoc regarding close() does not match implementation
> ---------------------------------------------------------------------------
>
>                 Key: HTTPCORE-655
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-655
>             Project: HttpComponents HttpCore
>          Issue Type: Bug
>    Affects Versions: 4.4.14, 5.0.3
>            Reporter: Marcono1234
>            Priority: Minor
>
> The [documentation for 
> {{IdentityInputStream}}|https://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/impl/io/IdentityInputStream.html]
>  says:
> {quote}
> Note that this class NEVER closes the underlying stream, even when close gets 
> called. Instead, it will read until the end of the stream (until {{-1}} is 
> returned).
> {quote}
> Similarly the 
> [tutorials|https://hc.apache.org/httpcomponents-client-4.4.x/tutorial/html/fundamentals.html#d5e145]
>  also say:
> {quote}
> [closing the content stream] will attempt to keep the underlying connection 
> alive by consuming the entity content
> {quote}
> However, it appears that is not actually true. The 
> [implementation|https://github.com/apache/httpcomponents-core/blob/master/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/IdentityInputStream.java#L78-L80]
>  does not try to read the remaining content.
> Note however, that changing this might break existing applications because it 
> appears not many users are aware of this behavior (which can be seen by the 
> number of reports about {{ChunkedInputStream.close()}} blocking forever).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to