You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by skolson56 <s....@charter.net> on 2008/07/07 03:37:26 UTC

PASV FTP Client and multiple list files

Has anyone else seen this behavior in FtpClient 1.4.1?  A valid connection is
established, passive mode is successfully entered, and a successful list
files operation is performed.  If the current open FtpClient session/socket
is retained, still in passive modem and a second list files operation is
attempted, nothing happens.  The cause seems to be this snippet of code:

Line 508 (1.4.1 version of FtpClient)

        { // We must be in PASSIVE_LOCAL_DATA_CONNECTION_MODE
            if (pasv() != FTPReply.ENTERING_PASSIVE_MODE)
                return null;
            __parsePassiveModeReply((String)_replyLines.elementAt(0));

On the first setup, 227 is received (FTPReply.ENTERING_PASSIVE_MODE) and it
all works.  On the second list files op, since the socket is already open
and passive mode is already in effect, the second call to pasv() gets a 250
from the server, which causes this logic to return a null socket, thus the
resulting failure to issue the second list files op successfully.

Shouldn't this code check for a 250 and return the current socket if a 250
is received from the pasv() call?

Thanks in advance for any info - this is the first time I have seen what
looks like a bug in the FtpClient stuff, and I am unsure how to proceed
(file a jira?).  I may try building the source tomorrow, making the patch,
and seeing if it helps with multiple calls to listFiles on the same passive
session, at least in our case where we are hitting a standard Redhat ES FTP
server.  But I wanted to ask in case someone knows more about this.


-- 
View this message in context: http://www.nabble.com/PASV-FTP-Client-and-multiple-list-files-tp18308755p18308755.html
Sent from the Commons - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org