jira-importer opened a new issue, #1173:
URL: https://github.com/apache/httpcomponents-core/issues/1173

   
**[Marcono1234](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=marcono1234)**
 opened 
**[HTTPCORE-655](https://issues.apache.org/jira/browse/HTTPCORE-655?redirect=false)**
 and commented
   
   The [documentation for 
`IdentityInputStream`](https://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/org/apache/http/impl/io/IdentityInputStream.html)
 says:
   
   > 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).
   
   Similarly the 
[tutorials](https://hc.apache.org/httpcomponents-client-4.4.x/tutorial/html/fundamentals.html#d5e145)
 also say:
   
   > [closing the content stream] will attempt to keep the underlying 
connection alive by consuming the entity content
   
   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).
   
   
   ---
   
   **Affects:** 4.4.14, 5.0.3
   
   **Backported to:** 
[5.1-beta3](https://github.com/apache/httpcomponents-core/milestone/80?closed=1)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to