You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Marcono1234 (Jira)" <ji...@apache.org> on 2020/12/23 15:57:00 UTC

[jira] [Comment Edited] (HTTPCORE-655) IdentityInputStream javadoc regarding close() does not match implementation

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

Marcono1234 edited comment on HTTPCORE-655 at 12/23/20, 3:56 PM:
-----------------------------------------------------------------

{quote}
as the connection is gong to be terminated anyway
{quote}
Could you explain that a little bit please? I am not that familiar with the HTTP protocol, but I thought since HTTP 1.1 connections are by default always reused.
Would the correct solution then be to remove that part of the {{IdentityInputStream}} documentation?


was (Author: marcono1234):
{quote}
as the connection is gong to be terminated anyway
{quote}
Could you explain that a little bit please? I am not that familiar with the HTTP protocol.
Would the correct solution then be to remove that part of the {{IdentityInputStream}} documentation?

> 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: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org