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

login in FTPClient does not always read the complete server response

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.4
    • 2.0
    • None
    • None

    Description

      When a password is required to connect the FTP server, the implementation of method login in class FTPClient ends with:
      return FTPReply.isPositiveCompletion(pass(password))
      which returns false for any code >= 300.

      However, some servers send a code 451 before returning the code 530 (NOT_LOGGED_IN). Ignoring this addtional answer,
      leads to desynch the client with the server, hence leading to unexpected behaviors in next exchanges.

      Threfore i propose to replace the above code in the end of the method with:

      _replyCode = p_Client.pass(p_Password);
      boolean result = FTPReply.isPositiveCompletion(_replyCode);
      if (!result && _replyCode==FTPReply.ACTION_ABORTED){
      try

      { _replyCode = p_Client.getReply(); }

      catch (Exception e)

      { e.printStackTrace(); }

      }
      return result;

      Attachments

        Activity

          People

            Unassigned Unassigned
            gillouxgaillard@wanadoo.fr Gilles Gaillard
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: