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

enterLocalPassiveMode is set back to Active on connect

    XMLWordPrintableJSON

Details

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

    Description

      enterLocalPassiveMode (exhibit A) docs claim that mode will be set to PASSIVE_LOCAL_DATA_CONNECTION_MODE "some other method such as" enterLocalActiveMode is called (exhibit B). However, active mode is being entered after connect is called. This behavior can be easily observed by modifying FtpExample by moving ftp.enterLocalPassiveMode() to before ftp.connect(server).

      Perhaps either the code or docs could be updated to remedy this. Versions prior to 2.0 behaved as documented.

      exhibit A:
      /***

      • Set the current data connection mode to
      • <code> PASSIVE_LOCAL_DATA_CONNECTION_MODE </code>. Use this
      • method only for data transfers between the client and server.
      • This method causes a PASV command to be issued to the server
      • before the opening of every data connection, telling the server to
      • open a data port to which the client will connect to conduct
      • data transfers. The FTPClient will stay in
      • <code> PASSIVE_LOCAL_DATA_CONNECTION_MODE </code> until the
      • mode is changed by calling some other method such as
      • {@link #enterLocalActiveMode enterLocalActiveMode() }

        ***/
        public void enterLocalPassiveMode()

        { __dataConnectionMode = PASSIVE_LOCAL_DATA_CONNECTION_MODE; // These will be set when just before a data connection is opened // in _openDataConnection_() __passiveHost = null; __passivePort = -1; }

      exhibit B

      @Override
      protected void connectAction() throws IOException

      { super._connectAction_(); __initDefaults(); }

      Attachments

        Activity

          People

            Unassigned Unassigned
            kbrown_at_turner Kevin Brown
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: