Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 62729 invoked from network); 14 Mar 2005 09:02:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 14 Mar 2005 09:02:52 -0000 Received: (qmail 97877 invoked by uid 500); 14 Mar 2005 09:02:50 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 97829 invoked by uid 500); 14 Mar 2005 09:02:50 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 97816 invoked by uid 500); 14 Mar 2005 09:02:50 -0000 Received: (qmail 97813 invoked by uid 99); 14 Mar 2005 09:02:50 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 14 Mar 2005 01:02:50 -0800 Received: (qmail 62631 invoked by uid 1146); 14 Mar 2005 09:02:48 -0000 Date: 14 Mar 2005 09:02:48 -0000 Message-ID: <20050314090248.62630.qmail@minotaur.apache.org> From: bodewig@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh SSHExec.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N bodewig 2005/03/14 01:02:48 Modified: src/main/org/apache/tools/ant/taskdefs/optional/ssh SSHExec.java Log: Explicitly disconnect the session, PR: 26757 Revision Changes Path 1.19 +6 -1 ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java Index: SSHExec.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/ssh/SSHExec.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- SSHExec.java 9 Mar 2005 00:20:41 -0000 1.18 +++ SSHExec.java 14 Mar 2005 09:02:48 -0000 1.19 @@ -137,9 +137,10 @@ ByteArrayOutputStream out = new ByteArrayOutputStream(); TeeOutputStream tee = new TeeOutputStream(out, System.out); + Session session = null; try { // execute the command - Session session = openSession(); + session = openSession(); session.setTimeout((int) maxwait); final ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setCommand(command); @@ -219,6 +220,10 @@ } else { log("Caught exception: " + e.getMessage(), Project.MSG_ERR); } + } finally { + if (session != null && session.isConnected()) { + session.disconnect(); + } } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org