curl-library
Re: Active FTP uploads
Date: Wed, 07 Jun 2006 15:13:19 +0200
Hi Daniel,
yes, I'm doing 2 parallel uploads using the multi interface, so the 2
connections and login commands
are coming from this.
There is only a switch between the FTP Server and the client, no firewall.
The strange thing is:
After the timeout, the application retries the upload using the same
easy_handle
(* Re-using existing connection! (#0) with host legolas) and the server
immediately connects
to the client and the upload is done successfully.
In the server log you can see the timeout as well. After the first PORT
command there is a gap of 30sec
(the configured CURL timeout) and after the second PORT command (the
retry of the application)
the server connects immediately to the client.
server log:
Wed Jun 7 15:12:24 2006 [pid 15626] FTP response: Client
"192.168.2.224", "220 Welcome to Legolas FTP service."
Wed Jun 7 15:12:24 2006 [pid 15626] FTP command: Client
"192.168.2.224", "USER bast"
Wed Jun 7 15:12:24 2006 [pid 15626] [bast] FTP response: Client
"192.168.2.224", "331 Please specify the password."
Wed Jun 7 15:12:24 2006 [pid 15626] [bast] FTP command: Client
"192.168.2.224", "PASS <password>"
Wed Jun 7 15:12:24 2006 [pid 15625] [bast] OK LOGIN: Client "192.168.2.224"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "230 Login successful."
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "PWD"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "257 "/home/bast""
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD /home"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD bast"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD test"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "PORT 192,168,2,224,196,163"
Wed Jun 7 15:12:24 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "200 PORT command successful. Consider using PASV."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD /home/bast"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD /home"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD bast"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "CWD test"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "250 Directory successfully changed."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "PORT 192,168,2,224,184,146"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "200 PORT command successful. Consider using PASV."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "TYPE I"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "200 Switching to Binary mode."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "STOR import_20060523_00001_00001_0000000045.xml"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "150 Ok to send data."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] OK UPLOAD: Client
"192.168.2.224",
"/home/bast/test/import_20060523_00001_00001_0000000045.xml", 6039
bytes, 2525.68Kbyte/sec
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "226 File receive OK."
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP command: Client
"192.168.2.224", "QUIT"
Wed Jun 7 15:12:54 2006 [pid 15627] [bast] FTP response: Client
"192.168.2.224", "221 Goodbye."
curl verbose log:
* About to connect() to legolas port 21
* Trying 192.168.2.94... * Connected to legolas (192.168.2.94) port 21
< 220 Welcome to Legolas FTP service.
> USER bast
< 331 Please specify the password.
> PASS bast12
< 230 Login successful.
* We have successfully logged in
> PWD
< 257 "/home/bast"
* Entry path is '/home/bast'
* protocol connect phase DONE
* DO phase starts
> CWD /home
< 250 Directory successfully changed.
> CWD bast
< 250 Directory successfully changed.
> CWD test
< 250 Directory successfully changed.
> PORT 192,168,2,224,128,243
< 200 PORT command successful. Consider using PASV.
* Connect data stream actively
* DO phase is comlete
* Connection time-out after 30001 ms
1149685402 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
* DO phase starts
> CWD /home/bast
< 250 Directory successfully changed.
> CWD /home
< 250 Directory successfully changed.
> CWD bast
< 250 Directory successfully changed.
> CWD test
< 250 Directory successfully changed.
> PORT 192,168,2,224,226,245
< 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
* Remembering we are in dir /home/bast/test/
< 226 File receive OK.
* Connection #0 to host legolas left intact
> QUIT
< 221 Goodbye.
* Closing connection #0
Regards
Patrick
Received on 2006-06-07