|
|
@@ -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); |
|
|
|