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

net: telnet: spy read EOL is reversed

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.4
    • Component/s: Telnet
    • Labels:
      None
    • Environment:

      Linux x64

      Description

      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

          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;
                  }
              }
          }
      

      should be replaced by

          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;
                  }
              }
          }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mailings@hupie.com Ferry Huberts
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: