Return-Path: Delivered-To: apmail-jakarta-httpcomponents-commits-archive@www.apache.org Received: (qmail 49232 invoked from network); 1 Jul 2007 10:57:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Jul 2007 10:57:35 -0000 Received: (qmail 43156 invoked by uid 500); 1 Jul 2007 10:57:38 -0000 Delivered-To: apmail-jakarta-httpcomponents-commits-archive@jakarta.apache.org Received: (qmail 43140 invoked by uid 500); 1 Jul 2007 10:57:38 -0000 Mailing-List: contact httpcomponents-commits-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: httpcomponents-dev@jakarta.apache.org Delivered-To: mailing list httpcomponents-commits@jakarta.apache.org Received: (qmail 43131 invoked by uid 99); 1 Jul 2007 10:57:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 03:57:38 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Jul 2007 03:57:34 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 8147C1A981A; Sun, 1 Jul 2007 03:57:14 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r552278 - /jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java Date: Sun, 01 Jul 2007 10:57:14 -0000 To: httpcomponents-commits@jakarta.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070701105714.8147C1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Sun Jul 1 03:57:13 2007 New Revision: 552278 URL: http://svn.apache.org/viewvc?view=rev&rev=552278 Log: Some more tweaks Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java?view=diff&rev=552278&r1=552277&r2=552278 ============================================================================== --- jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java (original) +++ jakarta/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientConnectionRelease.java Sun Jul 1 03:57:13 2007 @@ -71,14 +71,12 @@ // If the response does not enclose an entity, there is no need // to bother about connection release if (entity != null) { - // do something useful with the response BufferedReader reader = new BufferedReader( new InputStreamReader(entity.getContent())); try { + // do something useful with the response System.out.println(reader.readLine()); - // In case of an IOException the connection will be released - // back to the connection manager automatically } catch (IOException ex) { @@ -99,8 +97,9 @@ // Closing the input stream will trigger connection release reader.close(); // Alternatively you may want to call this method when done - // with the response entity. It will also trigger connection - // release + // with the response entity to ensure the response content has + // been fully consumed. This will also trigger connection + // release entity.consumeContent(); }