Return-Path: X-Original-To: apmail-hc-commits-archive@www.apache.org Delivered-To: apmail-hc-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 41BE1996A for ; Fri, 17 May 2013 15:05:41 +0000 (UTC) Received: (qmail 72385 invoked by uid 500); 17 May 2013 15:05:41 -0000 Delivered-To: apmail-hc-commits-archive@hc.apache.org Received: (qmail 72357 invoked by uid 500); 17 May 2013 15:05:41 -0000 Mailing-List: contact commits-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list commits@hc.apache.org Received: (qmail 72349 invoked by uid 99); 17 May 2013 15:05:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 15:05:41 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2013 15:05:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 5D8C423889E2 for ; Fri, 17 May 2013 15:05:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1483844 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Date: Fri, 17 May 2013 15:05:16 -0000 To: commits@hc.apache.org From: olegk@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130517150516.5D8C423889E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: olegk Date: Fri May 17 15:05:16 2013 New Revision: 1483844 URL: http://svn.apache.org/r1483844 Log: Workaround a bug in state management of re-opened connections in HttpCore Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java?rev=1483844&r1=1483843&r2=1483844&view=diff ============================================================================== --- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java (original) +++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java Fri May 17 15:05:16 2013 @@ -274,12 +274,12 @@ public class MainClientExec implements C if (needAuthentication( targetAuthState, proxyAuthState, route, request, response, context)) { + // Make sure the response body is fully consumed, if present + final HttpEntity entity = response.getEntity(); + EntityUtils.consume(entity); if (connHolder.isReusable()) { - // Make sure the response body is fully consumed, if present - final HttpEntity entity = response.getEntity(); - EntityUtils.consume(entity); - // entity consumed above is not an auto-release entity, - // need to mark the connection re-usable explicitly + // TODO consume response body on if connection is re-usable + // (requires post 4.3-beta2 bug fix in HttpCore) } else { managedConn.close(); if (proxyAuthState.getState() == AuthProtocolState.SUCCESS