[
https://issues.apache.org/jira/browse/HTTPCORE-655?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17254587#comment-17254587
]
ASF subversion and git services commented on HTTPCORE-655:
----------------------------------------------------------
Commit ae3953384791eb7dcfd6dd98fd388881a2ee5abf in httpcomponents-core's branch
refs/heads/master from Marcono1234
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=ae39533 ]
HTTPCORE-655: Improve HTTP input and output streams' documentation regarding
close() (#240)
> 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]