[
https://issues.apache.org/jira/browse/NET-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14018728#comment-14018728
]
Ferry Huberts commented on NET-543:
-----------------------------------
Originates from commit:
Moving to TLP
git-svn-id: http://svn.apache.org/repos/asf/commons/proper/net/trunk@560660
13f79535-47bb-0310-9956-ffa450edef68
> net: telnet: spy read EOL is reversed
> -------------------------------------
>
> Key: NET-543
> URL: https://issues.apache.org/jira/browse/NET-543
> Project: Commons Net
> Issue Type: Bug
> Components: Telnet
> Affects Versions: 3.3
> Environment: Linux x64
> Reporter: Ferry Huberts
> Priority: Minor
>
> the code in Telnet::_spyRead has a bug that results in a 'reversed' EOL.
> I'm expecting SocketClient.NETASCII_EOL (\r\n) but I'm getting '\n\r'.
> the code
> {noformat}
> void _spyRead(int ch)
> {
> OutputStream spy = spyStream;
> if (spy != null)
> {
> try
> {
> if (ch != '\r')
> {
> spy.write(ch);
> if (ch == '\n')
> {
> spy.write('\r');
> }
> spy.flush();
> }
> }
> catch (IOException e)
> {
> spyStream = null;
> }
> }
> }
> {noformat}
> should be replaced by
> {noformat}
> void _spyRead(int ch)
> {
> OutputStream spy = spyStream;
> if (spy != null)
> {
> try
> {
> if (ch != '\r')
> {
> if (ch == '\n')
> {
> spy.write('\r');
> }
> spy.write(ch);
> spy.flush();
> }
> }
> catch (IOException e)
> {
> spyStream = null;
> }
> }
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.2#6252)