cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: FTP Upload problems with Multi interface

From: Andreas Wurf <awurf_at_adobe.com>
Date: Wed, 12 Nov 2008 09:42:04 +0000

Hi Daniel,

>> 226 Transfer complete.
>> PASV
>> 227 Entering Passive Mode (1.2.3.4,246,176).
>> STOR file22
>> 150 Opening BINARY mode data connection for file22
>> PASV // <-- channel stuck here!
>
>PASV is thus clearly sent away by libcurl. What is the server doing then?
>Since it doesn't respond with anything, it certainly makes it look like a
>server-side problem. Or am I missing something? libcurl should in this
>situation just wait for the 227 response coming from the server - or timeout
>after having waited the maximum amount of time (but I can't remember how long
>that is right now).

What bothers me: Why does libcurl send out the PASV when the "226 Transfer complete" for the previous transfer has not been received yet? A complete sequence looks like:

----------------------------------<snip>----------------------------------
PASV
227 Entering Passive Mode (1.2.3.4,244,77).
STOR file21
150 Opening BINARY mode data connection for file21
226 Transfer complete.
----------------------------------</snip>---------------------------------

Could it be that libcurl somehow skipped or "ate" the "226" Response and instead continues with the next file - which will surely break the protocol's control flow?

>PASV is thus clearly sent away by libcurl. What is the server doing then?
>Since it doesn't respond with anything, it certainly makes it look like a
>server-side problem. Or am I missing something? libcurl should in this

This behavior occurs with ProFTPD (Ubuntu) as well as on Microsoft IIS FTP Server (don't know which version exactly; The one that came with MS-Windows 2000 Pro). So, I don't think it is a server-side problem.

Today I even tried with my external private internet server, and I even got a Hang on this (Linux or BSD based, I don't know exactly). Here's the WireShark log of the hanging channel:

----------------------------------<snip>----------------------------------
220 1.2.3.4 FTP server ready
USER user
331 Password required for user.
PASS password
230 User user logged in.
PWD
257 "/" is current directory.
CWD FtpMultiUpload
250 CWD command successful
PASV
227 Entering Passive Mode (1,2,3,4,196,244).
TYPE I
200 Type set to I
STOR file01
150 Opening BINARY mode data connection for file01
CWD / // <-- stuck here!
----------------------------------</snip>---------------------------------

As you see, the hang is not after a PASV but after a CWD command. But in this case too, the "226 Transfer complete" of the previous transfer is not there. Different Symptoms of the same Problem?

I'm going nuts with this.

-- Andreas
Received on 2008-11-12