git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277682 13f79535-47bb-0310-9956-ffa450edef68master
@@ -318,6 +318,10 @@ Fixed bugs: | |||||
<exec>, <apply>, or <java> tasks was always logged to System.out | <exec>, <apply>, or <java> tasks was always logged to System.out | ||||
instead of to the managing Task. | instead of to the managing Task. | ||||
* <telnet> and <rexec> 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 | Changes from Ant 1.6.1 to Ant 1.6.2 | ||||
=================================== | =================================== | ||||
@@ -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"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -342,15 +342,15 @@ public class RExecTask extends Task { | |||||
/** Keep reading input stream until end of it or time-out */ | /** Keep reading input stream until end of it or time-out */ | ||||
rexec.waitForEOF(defaultTimeout); | rexec.waitForEOF(defaultTimeout); | ||||
} finally { | } 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 | * Process a 'typical' login. If it differs, use the read | ||||
@@ -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"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
* you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
@@ -114,7 +114,7 @@ public class TelnetTask extends Task { | |||||
task.execute(telnet); | task.execute(telnet); | ||||
} | } | ||||
} finally { | } finally { | ||||
if (telnet != null) { | |||||
if (telnet != null && telnet.isConnected()) { | |||||
try { | try { | ||||
telnet.disconnect(); | telnet.disconnect(); | ||||
} catch (IOException e) { | } catch (IOException e) { | ||||