From commits-return-65858-archive-asf-public=cust-asf.ponee.io@commons.apache.org Fri Feb 1 13:32:20 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 65BD7180627 for ; Fri, 1 Feb 2019 14:32:20 +0100 (CET) Received: (qmail 88637 invoked by uid 500); 1 Feb 2019 13:32:19 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 88628 invoked by uid 99); 1 Feb 2019 13:32:19 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2019 13:32:19 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id D1AD985790; Fri, 1 Feb 2019 13:32:18 +0000 (UTC) Date: Fri, 01 Feb 2019 13:32:18 +0000 To: "commits@commons.apache.org" Subject: [commons-vfs] branch master updated: [VFS-689] org.apache.commons.vfs2.provider.http.HttpFileObject.getHeadMethod() does not release connection when an exception is thrown. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <154902793879.12792.6645786741350410056@gitbox.apache.org> From: ggregory@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: commons-vfs X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: d8c1e06458e5ed739f7a07ff077b0843d1990ca7 X-Git-Newrev: a8f9164b85ab0145725713b6018863d338ff6230 X-Git-Rev: a8f9164b85ab0145725713b6018863d338ff6230 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-vfs.git The following commit(s) were added to refs/heads/master by this push: new a8f9164 [VFS-689] org.apache.commons.vfs2.provider.http.HttpFileObject.getHeadMethod() does not release connection when an exception is thrown. a8f9164 is described below commit a8f9164b85ab0145725713b6018863d338ff6230 Author: Gary Gregory AuthorDate: Fri Feb 1 08:32:17 2019 -0500 [VFS-689] org.apache.commons.vfs2.provider.http.HttpFileObject.getHeadMethod() does not release connection when an exception is thrown. --- .../org/apache/commons/vfs2/provider/http/HttpFileObject.java | 11 +++++++---- src/changes/changes.xml | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java index 1a73e14..9467dc8 100644 --- a/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java +++ b/commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java @@ -201,10 +201,13 @@ public class HttpFileObject extends AbstractFileObjec return method; } method = new HeadMethod(); - setupMethod(method); - final HttpClient client = getAbstractFileSystem().getClient(); - client.executeMethod(method); - method.releaseConnection(); + try { + setupMethod(method); + final HttpClient client = getAbstractFileSystem().getClient(); + client.executeMethod(method); + } finally { + method.releaseConnection(); + } return method; } diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 7710c3d..70340aa 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -137,6 +137,9 @@ The type attribute can be add,update,fix,remove. Add HTTP provider based on HttpComponents HttpClient 4. + + org.apache.commons.vfs2.provider.http.HttpFileObject.getHeadMethod() does not release connection when an exception is thrown. +