git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@677887 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1,5 +1,6 @@ | |||||
| Amongst other, the following people contributed to ant: | Amongst other, the following people contributed to ant: | ||||
| Adam Blinkinsop | |||||
| Aleksandr Ishutin | Aleksandr Ishutin | ||||
| Alexey Panchenko | Alexey Panchenko | ||||
| Alexey Solofnenko | Alexey Solofnenko | ||||
| @@ -30,6 +30,10 @@ | |||||
| <introduction> | <introduction> | ||||
| These are some of the many people who have helped Ant become so successful. | These are some of the many people who have helped Ant become so successful. | ||||
| </introduction> | </introduction> | ||||
| <name> | |||||
| <first>Adam</first> | |||||
| <last>Blinkinsop</last> | |||||
| </name> | |||||
| <name> | <name> | ||||
| <first>Aleksandr</first> | <first>Aleksandr</first> | ||||
| <last>Ishutin</last> | <last>Ishutin</last> | ||||
| @@ -203,14 +203,17 @@ public class RExecTask extends Task { | |||||
| InputStream is = this.getInputStream(); | InputStream is = this.getInputStream(); | ||||
| try { | try { | ||||
| StringBuffer sb = new StringBuffer(); | StringBuffer sb = new StringBuffer(); | ||||
| int windowStart = -s.length(); | |||||
| if (timeout == null || timeout.intValue() == 0) { | if (timeout == null || timeout.intValue() == 0) { | ||||
| while (sb.toString().indexOf(s) == -1) { | |||||
| while (windowStart++ < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | |||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| } | } | ||||
| } else { | } else { | ||||
| Calendar endTime = Calendar.getInstance(); | Calendar endTime = Calendar.getInstance(); | ||||
| endTime.add(Calendar.SECOND, timeout.intValue()); | endTime.add(Calendar.SECOND, timeout.intValue()); | ||||
| while (sb.toString().indexOf(s) == -1) { | |||||
| while (windowStart++ < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | |||||
| while (Calendar.getInstance().before(endTime) | while (Calendar.getInstance().before(endTime) | ||||
| && is.available() == 0) { | && is.available() == 0) { | ||||
| Thread.sleep(PAUSE_TIME); | Thread.sleep(PAUSE_TIME); | ||||
| @@ -340,14 +340,17 @@ public class TelnetTask extends Task { | |||||
| InputStream is = this.getInputStream(); | InputStream is = this.getInputStream(); | ||||
| try { | try { | ||||
| StringBuffer sb = new StringBuffer(); | StringBuffer sb = new StringBuffer(); | ||||
| int windowStart = -s.length(); | |||||
| if (timeout == null || timeout.intValue() == 0) { | if (timeout == null || timeout.intValue() == 0) { | ||||
| while (sb.toString().indexOf(s) == -1) { | |||||
| while (windowStart++ < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | |||||
| sb.append((char) is.read()); | sb.append((char) is.read()); | ||||
| } | } | ||||
| } else { | } else { | ||||
| Calendar endTime = Calendar.getInstance(); | Calendar endTime = Calendar.getInstance(); | ||||
| endTime.add(Calendar.SECOND, timeout.intValue()); | endTime.add(Calendar.SECOND, timeout.intValue()); | ||||
| while (sb.toString().indexOf(s) == -1) { | |||||
| while (windowStart++ < 0 | |||||
| || !sb.substring(windowStart).equals(s)) { | |||||
| while (Calendar.getInstance().before(endTime) | while (Calendar.getInstance().before(endTime) | ||||
| && is.available() == 0) { | && is.available() == 0) { | ||||
| Thread.sleep(WAIT_INTERVAL); | Thread.sleep(WAIT_INTERVAL); | ||||