diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-05 14:08:26 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-05 14:08:26 +0000 |
commit | ab784567291b1925d616ea9b9d2577f42d2699a5 (patch) | |
tree | 7d4f4e1976f7a03adc136358ded5a2f866cf9285 /apps/netutils/ftpc/ftpc_listdir.c | |
parent | b20e2a5a26d3c9bbbea0dbea71227085bb8a135a (diff) | |
download | nuttx-ab784567291b1925d616ea9b9d2577f42d2699a5.tar.gz nuttx-ab784567291b1925d616ea9b9d2577f42d2699a5.tar.bz2 nuttx-ab784567291b1925d616ea9b9d2577f42d2699a5.zip |
More FTP bug fixes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3669 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/netutils/ftpc/ftpc_listdir.c')
-rw-r--r-- | apps/netutils/ftpc/ftpc_listdir.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/apps/netutils/ftpc/ftpc_listdir.c b/apps/netutils/ftpc/ftpc_listdir.c index d5de10ec3..e3af9b122 100644 --- a/apps/netutils/ftpc/ftpc_listdir.c +++ b/apps/netutils/ftpc/ftpc_listdir.c @@ -199,13 +199,19 @@ static int ftpc_recvdir(FAR struct ftpc_session_s *session, return ERROR; } - /* Accept the connection from the server */ + /* In active mode, we need to accept a connection on the data socket + * (in passive mode, we have already connected the data channel to + * the FTP server). + */ - ret = ftpc_sockaccept(&session->data, FTPC_IS_PASSIVE(session)); - if (ret != OK) + if (!FTPC_IS_PASSIVE(session)) { - ndbg("ftpc_sockaccept() failed: %d\n", errno); - return ERROR; + ret = ftpc_sockaccept(&session->data); + if (ret != OK) + { + ndbg("ftpc_sockaccept() failed: %d\n", errno); + return ERROR; + } } /* Receive the NLST directory list */ |