Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 41673 invoked from network); 18 Feb 2005 11:04:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Feb 2005 11:04:34 -0000 Received: (qmail 47413 invoked by uid 500); 18 Feb 2005 11:04:32 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 47055 invoked by uid 500); 18 Feb 2005 11:04:31 -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 47038 invoked by uid 500); 18 Feb 2005 11:04:30 -0000 Received: (qmail 47032 invoked by uid 99); 18 Feb 2005 11:04:30 -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; Fri, 18 Feb 2005 03:04:30 -0800 Received: (qmail 41574 invoked by uid 1146); 18 Feb 2005 11:04:28 -0000 Date: 18 Feb 2005 11:04:28 -0000 Message-ID: <20050218110428.41573.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/net RExecTask.java TelnetTask.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N bodewig 2005/02/18 03:04:28 Modified: . Tag: ANT_16_BRANCH WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/net Tag: ANT_16_BRANCH RExecTask.java TelnetTask.java Log: merge Revision Changes Path No revision No revision 1.503.2.177 +4 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.503.2.176 retrieving revision 1.503.2.177 diff -u -r1.503.2.176 -r1.503.2.177 --- WHATSNEW 14 Feb 2005 22:05:31 -0000 1.503.2.176 +++ WHATSNEW 18 Feb 2005 11:04:28 -0000 1.503.2.177 @@ -200,6 +200,10 @@ , , or tasks was always logged to System.out instead of to the managing Task. +* and would try to disconnect from servers they never + connetced to, potentially leading to exceptions in commons-net. + Bugzilla Report 33618. + Changes from Ant 1.6.1 to Ant 1.6.2 =================================== No revision No revision 1.4.2.5 +10 -10 ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java Index: RExecTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java,v retrieving revision 1.4.2.4 retrieving revision 1.4.2.5 diff -u -r1.4.2.4 -r1.4.2.5 --- RExecTask.java 23 Jun 2004 12:32:03 -0000 1.4.2.4 +++ RExecTask.java 18 Feb 2005 11:04:28 -0000 1.4.2.5 @@ -1,5 +1,5 @@ /* - * Copyright 2003-2004 The Apache Software Foundation + * Copyright 2003-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -342,15 +342,15 @@ /** Keep reading input stream until end of it or time-out */ rexec.waitForEOF(defaultTimeout); } finally { - if (rexec != null) { - try { - rexec.disconnect(); - } catch (IOException e) { - throw new BuildException("Error disconnecting from " - + server); - } - } - } + if (rexec != null && rexec.isConnected()) { + try { + rexec.disconnect(); + } catch (IOException e) { + throw new BuildException("Error disconnecting from " + + server); + } + } + } } /** * Process a 'typical' login. If it differs, use the read 1.20.2.7 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java Index: TelnetTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java,v retrieving revision 1.20.2.6 retrieving revision 1.20.2.7 diff -u -r1.20.2.6 -r1.20.2.7 --- TelnetTask.java 23 Jun 2004 12:26:35 -0000 1.20.2.6 +++ TelnetTask.java 18 Feb 2005 11:04:28 -0000 1.20.2.7 @@ -1,5 +1,5 @@ /* - * Copyright 2000,2002-2004 The Apache Software Foundation + * Copyright 2000,2002-2005 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -114,7 +114,7 @@ task.execute(telnet); } } finally { - if (telnet != null) { + if (telnet != null && telnet.isConnected()) { try { telnet.disconnect(); } catch (IOException e) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org