git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@937187 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -90,6 +90,10 @@ Fixed bugs: | |||||
| to a link inside the current directory without a leading ".". | to a link inside the current directory without a leading ".". | ||||
| Bugzilla Report 49137 | 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: | Other changes: | ||||
| -------------- | -------------- | ||||
| @@ -205,14 +205,15 @@ public class RExecTask extends Task { | |||||
| StringBuffer sb = new StringBuffer(); | StringBuffer sb = new StringBuffer(); | ||||
| int windowStart = -s.length(); | int windowStart = -s.length(); | ||||
| if (timeout == null || timeout.intValue() == 0) { | if (timeout == null || timeout.intValue() == 0) { | ||||
| while (windowStart++ < 0 | |||||
| while (windowStart < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | || !sb.substring(windowStart).equals(s)) { | ||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| windowStart++; | |||||
| } | } | ||||
| } else { | } else { | ||||
| Calendar endTime = Calendar.getInstance(); | Calendar endTime = Calendar.getInstance(); | ||||
| endTime.add(Calendar.SECOND, timeout.intValue()); | endTime.add(Calendar.SECOND, timeout.intValue()); | ||||
| while (windowStart++ < 0 | |||||
| while (windowStart < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | || !sb.substring(windowStart).equals(s)) { | ||||
| while (Calendar.getInstance().before(endTime) | while (Calendar.getInstance().before(endTime) | ||||
| && is.available() == 0) { | && is.available() == 0) { | ||||
| @@ -224,6 +225,7 @@ public class RExecTask extends Task { | |||||
| getLocation()); | getLocation()); | ||||
| } | } | ||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| windowStart++; | |||||
| } | } | ||||
| } | } | ||||
| log(sb.toString(), Project.MSG_INFO); | log(sb.toString(), Project.MSG_INFO); | ||||
| @@ -342,14 +342,15 @@ public class TelnetTask extends Task { | |||||
| StringBuffer sb = new StringBuffer(); | StringBuffer sb = new StringBuffer(); | ||||
| int windowStart = -s.length(); | int windowStart = -s.length(); | ||||
| if (timeout == null || timeout.intValue() == 0) { | if (timeout == null || timeout.intValue() == 0) { | ||||
| while (windowStart++ < 0 | |||||
| while (windowStart < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | || !sb.substring(windowStart).equals(s)) { | ||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| windowStart++; | |||||
| } | } | ||||
| } else { | } else { | ||||
| Calendar endTime = Calendar.getInstance(); | Calendar endTime = Calendar.getInstance(); | ||||
| endTime.add(Calendar.SECOND, timeout.intValue()); | endTime.add(Calendar.SECOND, timeout.intValue()); | ||||
| while (windowStart++ < 0 | |||||
| while (windowStart < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | || !sb.substring(windowStart).equals(s)) { | ||||
| while (Calendar.getInstance().before(endTime) | while (Calendar.getInstance().before(endTime) | ||||
| && is.available() == 0) { | && is.available() == 0) { | ||||
| @@ -363,6 +364,7 @@ public class TelnetTask extends Task { | |||||
| getLocation()); | getLocation()); | ||||
| } | } | ||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| windowStart++; | |||||
| } | } | ||||
| } | } | ||||
| log(sb.toString(), Project.MSG_INFO); | log(sb.toString(), Project.MSG_INFO); | ||||