cURL / Mailing Lists / curl-library / Single Mail

curl-library

Active FTP uploads

From: Patrick Heeb <speedpat_at_gmx.net>
Date: Wed, 07 Jun 2006 10:11:03 +0200

I am trying to do parallel active mode FTP uploads with the multi
interface and detected a strange behaviour.
The first upload of each connection timeout's waiting for the server to
connect. Retrying with
the same easy handle then starts the upload immediately.

Am I missing something?

thanks
Patrick

<code>
        curl_easy_setopt(item_handles[i], CURLOPT_UPLOAD, 1);
        curl_easy_setopt(item_handles[i], CURLOPT_USERPWD,
loginInfo.c_str());
        curl_easy_setopt(item_handles[i],
CURLOPT_FTP_CREATE_MISSING_DIRS, 1);
        curl_easy_setopt(item_handles[i], CURLOPT_FTPPORT, "192.168.2.224");
        curl_easy_setopt(item_handles[i], CURLOPT_FTP_USE_EPRT, 0);
        curl_easy_setopt(item_handles[i], CURLOPT_TIMEOUT, 30);
        curl_easy_setopt(item_handles[i], CURLOPT_FTP_RESPONSE_TIMEOUT, 30);
        curl_easy_setopt(item_handles[i], CURLOPT_VERBOSE, 1);
        curl_easy_setopt(item_handles[i], CURLOPT_URL,
itemDestinationPath.c_str());
        curl_easy_setopt(item_handles[i], CURLOPT_READDATA, file);
</code>

the verbose log:

* About to connect() to legolas port 21
* Trying 192.168.2.94... * About to connect() to legolas port 21
* Trying 192.168.2.94... * Connected to legolas (192.168.2.94) port 21
* Connected to legolas (192.168.2.94) port 21
< 220 Welcome to Legolas FTP service.

> USER bast

< 220 Welcome to Legolas FTP service.

> USER bast

< 331 Please specify the password.

> PASS xxxx

< 331 Please specify the password.

> PASS xxxx

< 230 Login successful.

* We have successfully logged in
> PWD

< 230 Login successful.

* We have successfully logged in
> PWD

< 257 "/home/bast"

* Entry path is '/home/bast'
* protocol connect phase DONE
< 257 "/home/bast"

* Entry path is '/home/bast'
* protocol connect phase DONE
* DO phase starts
> CWD /home

* DO phase starts
> CWD /home

< 250 Directory successfully changed.

> CWD bast

< 250 Directory successfully changed.

> CWD bast

< 250 Directory successfully changed.

> CWD test

< 250 Directory successfully changed.

> CWD test

< 250 Directory successfully changed.

> CWD a

< 250 Directory successfully changed.

> PORT 192,168,2,224,154,74

< 250 Directory successfully changed.

> PORT 192,168,2,224,195,177

< 200 PORT command successful. Consider using PASV.

* Connect data stream actively
* DO phase is comlete
< 200 PORT command successful. Consider using PASV.

* Connect data stream actively
* DO phase is comlete
* Connection time-out after 30001 ms
1149667169 ERROR FTPTransferConnection :
/home/ph/import_20060523_00001_00001_0000000045.xml a timeout was reached
* Connection time-out after 30001 ms
1149667169 ERROR FTPTransferConnection :
/home/ph/import_20060523_00001_00001_0000000045.xml a timeout was reached
* Re-using existing connection! (#0) with host legolas
* Connected to legolas (192.168.2.94) port 21
* Re-using existing connection! (#0) with host legolas
* Connected to legolas (192.168.2.94) port 21
* DO phase starts
> CWD /home/bast

* DO phase starts
> CWD /home/bast

< 250 Directory successfully changed.

> CWD /home

< 250 Directory successfully changed.

> CWD /home

< 250 Directory successfully changed.

> CWD bast

< 250 Directory successfully changed.

> CWD bast

< 250 Directory successfully changed.

> CWD test

< 250 Directory successfully changed.

> CWD test

< 250 Directory successfully changed.

> CWD a

< 250 Directory successfully changed.

> PORT 192,168,2,224,188,62

< 250 Directory successfully changed.

> PORT 192,168,2,224,232,10

< 200 PORT command successful. Consider using PASV.

* Connect data stream actively
* DO phase is comlete
< 200 PORT command successful. Consider using PASV.

* Connect data stream actively
* DO phase is comlete
* DO-MORE phase starts
> TYPE I

< 200 Switching to Binary mode.

> STOR import_20060523_00001_00001_0000000045.xml

< 150 Ok to send data.

* Connection accepted from server
* DO-MORE phase ends
* DO-MORE phase starts
> TYPE I

< 200 Switching to Binary mode.

> STOR import_20060523_00001_00001_0000000045.xml

< 150 Ok to send data.

* Connection accepted from server
* DO-MORE phase ends
* Remembering we are in dir /home/bast/test/
< 226 File receive OK.

* Connection #0 to host legolas left intact
* Remembering we are in dir /home/bast/test/a/
< 226 File receive OK.

* Connection #0 to host legolas left intact
> QUIT

< 221 Goodbye.

* Closing connection #0
> QUIT

< 221 Goodbye.

* Closing connection #0
Received on 2006-06-07