Skip to content

Commit 41bab78

Browse files
committed
NET-329 TelnetInoutStream#__read() bug in the __receiveState handling for the _STATE_IAC state.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/net/branches/NET_2_0@962952 13f79535-47bb-0310-9956-ffa450edef68
1 parent e207fdd commit 41bab78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/apache/commons/net/telnet/TelnetInputStream.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ private int __read(boolean mayBlock) throws IOException
194194
/* TERMINAL-TYPE option (end)*/
195195
case TelnetCommand.IAC:
196196
__receiveState = _STATE_DATA;
197-
break;
197+
break; // exit to enclosing switch to return IAC from read
198198
default:
199-
break;
199+
__receiveState = _STATE_DATA;
200+
continue; // move on the next char, i.e. ignore IAC+unknown
200201
}
201-
__receiveState = _STATE_DATA;
202-
continue;
202+
break; // exit and return from read
203203
case _STATE_WILL:
204204
synchronized (__client)
205205
{

0 commit comments

Comments
 (0)