[
https://issues.apache.org/jira/browse/NET-543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ferry Huberts updated NET-543:
------------------------------
Attachment: 0001-Fix-NET-543-net-telnet-spy-read-EOL-is-reversed.patch
Git patch (on git-svn-id:
http://svn.apache.org/repos/asf/commons/proper/net/trunk@1595704)
> 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
> Attachments:
> 0001-Fix-NET-543-net-telnet-spy-read-EOL-is-reversed.patch
>
>
> 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)