cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FTP from an axis camera

From: <laurie.gellatly_at_netic.com>
Date: Mon, 11 Aug 2003 20:42:33 +1000

Hi Daniel,
Thanks for the swift reply.
Had a little trouble - I needed to build a win32 static library that I could
then debug.
Here is the more verbose code:
* About to connect() to 10.1.1.44:21
* Connected to 10.1.1.44 (10.1.1.44) port 21
< 220 Axis 2100 Network Camera 2.12 Feb 05 2001 ready.
> USER root
< 331 User name okay, need password.
> PASS password
< 230 User logged in, proceed.
* We have successfully logged in
> PWD
< 257 "/" is current directory.
* Entry path is '/'
> CWD tmp
< 250 Command successful.
> CWD jpg
< 250 Command successful.
> EPSV
< 500 Syntax error.
> PASV
< 500 Syntax error.
N.B. I also tried doing a curl_easy_setopt(curl, CURLOPT_FTP_USE_EPRT,
FALSE);
to try to stop it using EPSV but that did not work.
Also tried a curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION , TRUE); but
that aborted the code.

Appreciate your response.. What to try next?

Thanks ...Laurie :{)

----- Original Message -----
From: "Daniel Stenberg" <daniel_at_haxx.se>
To: <curl-library_at_lists.sourceforge.net>
Sent: Monday, August 11, 2003 3:02 AM
Subject: Re: FTP from an axis camera

> 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
>

-------------------------------------------------------
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-11