You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2014/05/21 11:35:49 UTC

svn commit: r1596521 - /httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java

Author: olegk
Date: Wed May 21 09:35:49 2014
New Revision: 1596521

URL: http://svn.apache.org/r1596521
Log:
HTTPCLIENT-1507: clarified behavior of CloseableHttpResponse#close()

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java?rev=1596521&r1=1596520&r2=1596521&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java Wed May 21 09:35:49 2014
@@ -50,9 +50,10 @@ public class QuickStart {
             // 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().
-
+            // the user MUST call CloseableHttpResponse#close() from a finally clause.
+            // Please note that if response content is not fully consumed the underlying
+            // connection cannot be safely re-used and will be shut down and discarded
+            // by the connection manager.
             try {
                 System.out.println(response1.getStatusLine());
                 HttpEntity entity1 = response1.getEntity();