Use of 100% CPU when disconnected after some time

This commit is contained in:
dotmg 2026-04-10 07:10:28 +02:00
parent 93b606ba99
commit c2c6472c6f

View file

@ -931,14 +931,24 @@ public class XITelnet {
byte[] rBuf = new byte[1024]; byte[] rBuf = new byte[1024];
int len = 0; int len = 0;
int i, j; int i, j;
int bclinf = 0;
try { try {
while(!ivTerminate) { while(!ivTerminate) {
try { try {
len = ivIn.read(buf); len = ivIn.read(buf);
if (len == -1) {
ivTerminate = true;
break;
}
} }
catch (InterruptedIOException iex) { //!!V 03/03/98 catch (InterruptedIOException iex) { //!!V 03/03/98
len = 0; len = 0;
bclinf ++;
if (bclinf > 1200) {
ivTerminate = true;
break;
}
} }
// process all IAC commands // process all IAC commands