commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skolson56 <>
Subject PASV FTP Client and multiple list files
Date Mon, 07 Jul 2008 01:37:26 GMT

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)

            if (pasv() != FTPReply.ENTERING_PASSIVE_MODE)
                return null;

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:
Sent from the Commons - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message