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

net: telnet: spy read EOL is reversed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.3
    • 3.4
    • Telnet
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: