cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[ curl-Bugs-3429299 ] Active FTP hangs if server does not open data connection

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 27 Oct 2011 23:27:35 +0200

Bugs item #3429299, was opened at 2011-10-27 14:24
Message generated for change (Comment added) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3429299&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: ftp
Group: bad behaviour
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Gokhan Sengun (gseng)
Assigned to: Daniel Stenberg (bagder)
Summary: Active FTP hangs if server does not open data connection

Initial Comment:
Working with libcurl version 7.22.0

An active FTP connection is setup with multi interface. Sometimes it is just not possible for FTP server to connect to the port given by the client with PORT or EPRT command. Server could send 425 Can't open data connection or be just dead in the middle of transaction.

Killing the executable (and having a coredump) shows that AllowServerConnect function just looks for notifications in the data connection however control connection should also be observed to get errors like the ones described above.

Server log:

(192.168.0.90)> STOR cmd_input.txt
(192.168.0.90)> 150 Opening data channel for file transfer.
(192.168.0.90)> 425 Can't open data connection.
(192.168.0.90)> 421 Connection timed out.

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

>Comment By: Daniel Stenberg (bagder)
Date: 2011-10-27 23:27

Message:
Your test code works fine for me, doing the 3 consecutive transfers from my
local ftp server. Repeatedly. on Linux...

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

Comment By: Gokhan Sengun (gseng)
Date: 2011-10-27 21:50

Message:
Hi Daniel,

Test case could be easily written. When an active FTP connection is made,
Server side socket stays in TIME_WAIT state for the remote port X which is
used in the previous data connection between the client and the server. If
another FTP data connection is to be established before Server socket times
out (default to 2 minutes), server fails to connect to the port opened by
FTP client.

So repeating triggering two active FTP downloads/uploads, the second
connection should exhibit the behaviour.

Attaching the test code.

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

Comment By: Daniel Stenberg (bagder)
Date: 2011-10-27 18:19

Message:
Hm, this does indeed warrant some kind of fix.

Have you looked into producing a test case that repeats this case?

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

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3429299&group_id=976
Received on 2011-10-27

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET