hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HTTPCLIENT-1507) Quick start comments do not correspond to user guide
Date Fri, 16 May 2014 11:22:59 GMT

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-1507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13998567#comment-13998567

Oleg Kalnichevski commented on HTTPCLIENT-1507:

*Releasing connection != closing connection*. 

Connection is _always_ released in both cases. If CloseableHttpResponse#close is called while
there is still some response data is pending the connection gets shut down and discarded upon
release. HttpEntity#getContent#close on the other hand will attempt to consume the remaining
content thus making the connection potentially re-usable upon release.

> Quick start comments do not correspond to user guide
> ----------------------------------------------------
>                 Key: HTTPCLIENT-1507
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1507
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 4.3.3
>            Reporter: Michael Osipov
> [Quick start|http://hc.apache.org/httpcomponents-client-ga/quickstart.html] says:
> {quote}
> // The underlying HTTP connection is still held by the response object
> // to allow the response content to be streamed directly from the network socket.
> // In order to ensure correct deallocation of system resources
> // the user MUST either fully consume the response content  or abort request
> // execution by calling CloseableHttpResponse#close().
> {quote}
> but the [user guide|http://hc.apache.org/httpcomponents-client-4.3.x/tutorial/html/fundamentals.html#d5e145]
> {quote}
> The difference between closing the content stream and closing the response is that the
former will attempt to keep the underlying connection alive by consuming the entity content
while the latter immediately shuts down and discards the connection.
> {quote}
> This is a contradiction. The code which follows in the quick start is correct but not
the comment. Even if I consume the response content the underlying connection is still help

This message was sent by Atlassian JIRA

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

View raw message