Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-89

[net] TelnetClient broken for binary transmissions + solution

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • Telnet
    • None
    • Operating System: All
      Platform: All

    • 34763

    Description

      TelnetClient does not handle correctly binary transmissions in two places:

      First in TelnetClient#connectAction() the telnet input and output streams are
      wrapped in the NetASCII streams to handle net vs platform line separator
      conversion which breaks the binary data. My quick solution was to simply remove
      those two wrapping streams. A more general solution might be to provide access
      to the unfilterer stream with methods like getUnfilteredInputStream and
      getUnfilteredOutputStream or to dynamically stop the NetASCII stream from
      'corrupting' the stream when a TelnetOption.BINARY option is negotiated.

      Also, in TelnetInputStream#__read() there is a bug in the __receiveState
      handling for the _STATE_IAC state. When a second consecutive IAC (0x255) is
      received to encode the single 0x255 character, read does not return 0x255 but
      instead move on to reading the next char in the stream.
      ...

      The above bug report has been moved to the subtask NET-329

      I'll provide patches for this.
      Colin.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ng@metaxia.com Colin Surprenant
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: