ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r937187 - in /ant/core/trunk: WHATSNEW src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
Date Fri, 23 Apr 2010 08:28:11 GMT
Author: bodewig
Date: Fri Apr 23 08:28:10 2010
New Revision: 937187

URL: http://svn.apache.org/viewvc?rev=937187&view=rev
Log:
telnet and rexec have been broken.  PR 49173.  Based on patch submitted by James Wartell

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
    ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=937187&r1=937186&r2=937187&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Fri Apr 23 08:28:10 2010
@@ -90,6 +90,10 @@ Fixed bugs:
    to a link inside the current directory without a leading ".".
    Bugzilla Report 49137
 
+ * <telnet> and <rexec> failed to find the expected strings when
+   waiting for responses and thus always failed.
+   Bugzilla Report 49173
+
 Other changes:
 --------------
 

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java?rev=937187&r1=937186&r2=937187&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/RExecTask.java Fri
Apr 23 08:28:10 2010
@@ -205,14 +205,15 @@ public class RExecTask extends Task {
                 StringBuffer sb = new StringBuffer();
                 int windowStart = -s.length();
                 if (timeout == null || timeout.intValue() == 0) {
-                    while (windowStart++ < 0
+                    while (windowStart < 0
                            || !sb.substring(windowStart).equals(s)) {
                         sb.append((char) is.read());
+                        windowStart++;
                     }
                 } else {
                     Calendar endTime = Calendar.getInstance();
                     endTime.add(Calendar.SECOND, timeout.intValue());
-                    while (windowStart++ < 0
+                    while (windowStart < 0
                            || !sb.substring(windowStart).equals(s)) {
                         while (Calendar.getInstance().before(endTime)
                             && is.available() == 0) {
@@ -224,6 +225,7 @@ public class RExecTask extends Task {
                                 getLocation());
                         }
                         sb.append((char) is.read());
+                        windowStart++;
                     }
                 }
                 log(sb.toString(), Project.MSG_INFO);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java?rev=937187&r1=937186&r2=937187&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/net/TelnetTask.java Fri
Apr 23 08:28:10 2010
@@ -342,14 +342,15 @@ public class TelnetTask extends Task {
                 StringBuffer sb = new StringBuffer();
                 int windowStart = -s.length();
                 if (timeout == null || timeout.intValue() == 0) {
-                    while (windowStart++ < 0
+                    while (windowStart < 0
                            || !sb.substring(windowStart).equals(s)) {
                         sb.append((char) is.read());
+                        windowStart++;
                     }
                 } else {
                     Calendar endTime = Calendar.getInstance();
                     endTime.add(Calendar.SECOND, timeout.intValue());
-                    while (windowStart++ < 0
+                    while (windowStart < 0
                            || !sb.substring(windowStart).equals(s)) {
                         while (Calendar.getInstance().before(endTime)
                                && is.available() == 0) {
@@ -363,6 +364,7 @@ public class TelnetTask extends Task {
                                 getLocation());
                         }
                         sb.append((char) is.read());
+                        windowStart++;
                     }
                 }
                 log(sb.toString(), Project.MSG_INFO);



Mime
View raw message