Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7B8069151 for ; Tue, 9 Dec 2014 20:39:13 +0000 (UTC) Received: (qmail 57018 invoked by uid 500); 9 Dec 2014 20:39:13 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 56972 invoked by uid 500); 9 Dec 2014 20:39:13 -0000 Mailing-List: contact dev-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 dev@hc.apache.org Received: (qmail 56961 invoked by uid 99); 9 Dec 2014 20:39:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Dec 2014 20:39:13 +0000 Date: Tue, 9 Dec 2014 20:39:13 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HTTPCLIENT-1588) CloseableHttpClient.execute do not close CloseableHttpResponse MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPCLIENT-1588?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved HTTPCLIENT-1588. ------------------------------------------- Resolution: Fixed Fix Version/s: 4.4 Beta2 Both ways are absolutely equivalent. Both calls end up releasing the underlying connection back to the connection manager. For consistency sake, though, I changed this method to close the response object from a finally clause. Oleg > CloseableHttpClient.execute do not close CloseableHttpResponse > -------------------------------------------------------------- > > Key: HTTPCLIENT-1588 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1588 > Project: HttpComponents HttpClient > Issue Type: Bug > Components: HttpClient > Affects Versions: 4.3.6 > Reporter: Marcin Kamionowski > Fix For: 4.4 Beta2 > > > CloseableHttpClient.execute in line 214 contains: > {code} > final HttpResponse response = execute(target, request, context); > {code} > The response real type is CloseableHttpResponse so it must be closed before returning result or throwing exception (https://hc.apache.org/httpcomponents-client-ga/quickstart.html) > Currently it only close InputStream returned from HttpEntity. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org