cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Stating on FTP - possible bug?

From: Michael Wood <esiotrot_at_gmail.com>
Date: Sun, 23 Aug 2009 23:12:01 +0200

2009/8/23 Rafael Fernández López <ereslibre_at_kde.org>:
> Hi there,
>
> I am using libcurl to connect to remote hosts. The version is:
>
> curl 7.19.6 (i686-pc-linux-gnu) libcurl/7.19.6 OpenSSL/0.9.8k zlib/1.2.3.3
> Protocols: tftp ftp telnet dict http file https ftps
> Features: IPv6 Largefile NTLM SSL libz
>
> When using CURLOPT_CONNECT_ONLY with an FTP server, and sending FTP
> raw commands, I am getting the next error message from the FTP server:
>
> 425 Use PORT or PASV first
>
> IMHO if I am not missing something, I think that libcurl should
> completely connect to the host, so I can send raw ftp commands like
> "LIST" directly.
>
> Am I wrong ? Am I missing something ?

The LIST command requires a data connection to send back the output
and the data connection requires a PORT or PASV command so that both
sides know what IP/port to use.

Try it with telnet or netcat first to see how it works (you might want
to read the FTP RFC first) and then see if it makes sense to use
libcurl for what you want to do.

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-08-23