[jira] Created: (NET-291) enterLocalPassiveMode is set back to Active on connect

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (NET-291) enterLocalPassiveMode is set back to Active on connect

ASF GitHub Bot (Jira)
enterLocalPassiveMode is set back to Active on connect
------------------------------------------------------

                 Key: NET-291
                 URL: https://issues.apache.org/jira/browse/NET-291
             Project: Commons Net
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Kevin Brown





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

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-291) enterLocalPassiveMode is set back to Active on connect

ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/NET-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763301#action_12763301 ]

Joseph Boyd commented on NET-291:
---------------------------------

This same behavior, calling __initDefaults() inside connectAction, also resets the fileType to its default, even though the javadocs for FTPClient.setFileType() indicate the type should stay the same until reset


> enterLocalPassiveMode is set back to Active on connect
> ------------------------------------------------------
>
>                 Key: NET-291
>                 URL: https://issues.apache.org/jira/browse/NET-291
>             Project: Commons Net
>          Issue Type: Bug
>    Affects Versions: 2.0
>            Reporter: Kevin Brown
>
> 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();
>     }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (NET-291) enterLocalPassiveMode is set back to Active on connect

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/NET-291?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb updated NET-291:
---------------------

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

  was:



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

    Component/s: FTP

> enterLocalPassiveMode is set back to Active on connect
> ------------------------------------------------------
>
>                 Key: NET-291
>                 URL: https://issues.apache.org/jira/browse/NET-291
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0
>            Reporter: Kevin Brown
>
> 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();
>     }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (NET-291) enterLocalPassiveMode is set back to Active on connect

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/NET-291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887427#action_12887427 ]

Sebb commented on NET-291:
--------------------------

The call to __initiDefaults() has been present since the original code was imported.

Presumably at least some of the fields do need to be reset as part of the connectAction method, but it's not immediately obvious which ones do need to be reset.

__initDefaults() is also called from the ctor, disconnect() and reinitialize(). Makes sense for the ctor and re-init; not sure whether disconnect() should reset everything.

Unfortunately changing this might cause some applications to break.

> enterLocalPassiveMode is set back to Active on connect
> ------------------------------------------------------
>
>                 Key: NET-291
>                 URL: https://issues.apache.org/jira/browse/NET-291
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.0
>            Reporter: Kevin Brown
>
> 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();
>     }

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.