commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Archie Cobbs (JIRA)" <j...@apache.org>
Subject [jira] [Created] (NET-387) TelnetClient use of FromNetASCIIInputStream and ToNetASCIIOutputStream breaks binary mode on non-Windows platforms
Date Tue, 22 Mar 2011 16:59:06 GMT
TelnetClient use of FromNetASCIIInputStream and ToNetASCIIOutputStream breaks binary mode on
non-Windows platforms
------------------------------------------------------------------------------------------------------------------

                 Key: NET-387
                 URL: https://issues.apache.org/jira/browse/NET-387
             Project: Commons Net
          Issue Type: Bug
          Components: Telnet
    Affects Versions: 2.2
            Reporter: Archie Cobbs


I am trying to use the telnet client in conjunction with the telnet BINARY option.

However, the commons-net telnet client has ASCII line-ending conversion hard-coded into it!
The result is that even in BINARY mode, any occurrence of CR-LF is replaced by your platform's
default line ending sequence. So unless you happen to be running Windows, BINARY mode is screwed
up. How ironic.

The attached patch works for me: it seems like this line ending conversion that it's doing
is not the job of this library. The telnet protocol has CRLF line endings by definition so
this is what any user of this client should expect. If the user of this library wants platform-specific
line endings then they can wrap their input in a {{java.io.LineNumberReader}}.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message