-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Daniel Stenberg
Sent: Friday, November 13, 2009 2:14 PM
To: libcurl development
Subject: Re: Extra CWD in curl_easy on Windows

On Fri, 13 Nov 2009, Dave Galloway wrote:

> < 220 Microsoft FTP Service
>> USER zzzz
> < 331 Password required for zzzz.
>> PASS aaaaaaa
> < 230 User zzzz logged in.
>> PWD
> < 257 "/zzzz" is current directory.
> * Entry path is '/zzzz'
>> CWD /    <--------------------- This is new
> < 250 CWD command successful.
> * Remembering we are in dir "/"
> * Connection #0 to host xx.xxx.xx.xx left intact

That looks very strange. What URL and what QUOTE options have you used to make
it do this? Or put another way: how can we repeat this sequence of commands in
our ends?

--

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------

Using curl_easy on Windows XP, libcurl 7.19.6.

This code:

log_err (VI_WARN, "Initializing FTP Session");

curl_global_init(CURL_GLOBAL_DEFAULT);

curl = curl_easy_init();

// setup username and password
sprintf (userpass, "%s:%s", account, passwd);
curl_easy_setopt(curl, CURLOPT_USERPWD, userpass);

curl_easy_setopt(curl, CURLOPT_READFUNCTION, ftp_read_callback);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, ftp_write_callback);
curl_easy_setopt(curl, CURLOPT_VERBOSE, logfile ? TRUE : FALSE);

curl_easy_setopt(curl, CURLOPT_STDERR, logfile);

curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, curl_error);
curl_easy_setopt(curl, CURLOPT_PORT, FTP_PORT); // port 21
curl_easy_setopt(curl, CURLOPT_FTP_USE_EPSV, (long)FALSE);

curl_easy_setopt(curl, CURLOPT_NOBODY, (long)TRUE);
curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, FALSE);

curl_easy_setopt(curl, CURLOPT_UPLOAD, FALSE);

curl_easy_setopt(curl, CURLOPT_FTPLISTONLY, TRUE);

cmd_list = NULLPTR;

log_err (VI_WARN, "Logging in to xx.xxx.xx.xx");

curl_easy_setopt(curl, CURLOPT_URL, url);

curl_easy_setopt(curl, CURLOPT_QUOTE, cmd_list);

res = curl_easy_perform(curl);

log_err (VI_WARN, "Flush the log");


Generated this log file:

Initializing FTP Session
Logging in to xx.xxx.xx.xx
* About to connect() to xx.xxx.xx.xx port 21 (#0)
*   Trying xx.xxx.xx.xx... * connected
* Connected to xx.xxx.xx.xx port 21 (#0)
< 220 Microsoft FTP Service
> USER zzzz
< 331 Password required for zzzz.
> PASS aaaaaaaaa
< 230 User zzz logged in.
> PWD
< 257 "/zzz" is current directory.
* Entry path is '/zzzz'
> CWD / <---- This is the "extra CWD", not there when linked to libcurl 7.12.0
< 250 CWD command successful.
* Remembering we are in dir "/"
* Connection #0 to host xx.xxx.xx.xx left intact
Flush the log


Thanks again for any help,
Dave
(also, sorry for the previous top post, still learning)
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to