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

Problem, in __getReply method, parsing reply code with leading space

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.1
    • None
    • FTP
    • None
    • UNIX

    Description

      FTPClient.getStatus() function call failed complaining about malformed response code.

      After tracing the code, I found the problem at following class and line:
      org.apache.commons.net.ftp.FTP.__getReply(FTP.java:333)

      The issue is that this method always expects reply code at position 0 of the returned reply string. If the reply string has some leading spaces, it fails to parse the reply code and returns malformed reply string.

      Example of such a reply string:

            211-nhpssltest Ipswitch FTP Server
            Version 5.0.2
            Connected to 184.70.132.130
            Logged in as massba
            TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: STREAM
            No data connection
      211 End of status
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            a.amin Ahmad AMIN
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified