cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP from an axis camera

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 10 Aug 2003 19:02:52 +0200 (CEST)

On Sun, 10 Aug 2003 laurie.gellatly_at_netic.com wrote:

> curl_easy_setopt(curl, CURLOPT_URL,
> "ftp://root:password@10.1.1.44/tmp/resolv.conf");
> /* Define our callback to get called when there's data to be written */
> curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
> curl_easy_setopt(curl, CURLOPT_FTP_USE_EPRT, TRUE);

Since you're not using active FTP, enabling EPRT makes no difference.

> /* Set a pointer to our struct to pass to the callback */
> curl_easy_setopt(curl, CURLOPT_FILE, &ftpfile);
> /* Switch on full protocol/debug output */
> curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE);

Are you really using 7.10.6? Because we've recently made a change that should
make VERBOSE also show all incoming headers...

Since you doesn't seem to get to see any incoming headers when using VERBOSE,
you can instead set CURLOPT_DEBUGFUNCTION and output all incoming headers as
well it would help us debug/understand this! (The command line tool does this
when you use -v.)

> > CWD tmp
> > EPSV
> > PASV
> * Connected the data stream with PASV!
> But after that it returns with an error code 13.

The fact that it says "Connected the data stream" before returning an error is
a bug. I noticed that now because of your report here! ;-)

The 13 error is CURLE_FTP_WEIRD_PASV_REPLY which certainly indicates that the
server returned a response that libcurl couldn't parse. That's why I'm very
curious in getting to see that exact header line.

> What's the best way to debug this?

Set a break-point in the PASV parsing code and single-step from there!

> Have I missed setting some option?

Nope. It should deal with PASV when used like this.

> When I point the same code at a sun server it works fine.

That server probably returns a different response line.

> When I use NT's FTP command the Axis works fine.

That client has a different response parser. Obviously more functional in this
case. Does that command really use PASV?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-10