cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: libcurl problem (ftp download).

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 12 Aug 2003 19:50:23 +0200 (CEST)

On Tue, 12 Aug 2003, Marc R. Wetzel wrote:

> I've a problem using ftp with libcurl 7.10.2 (active and passive mode).
>
> I use ftp over a "slow" gsm link where somewhere in the middle of the
> network sits a transparent ftp-proxy.
>
> As far as I can see by using tcpdump and etherreal, the following happens
> (not always, but sometimes)
>
> Control connection is established, user, password, directory is set.
> Data-connection is opened. (IMHO now the proxy receives the file with full
> speed > 2Mbit and after about 3-4 seconds the file transfer is complete) the
> proxy starts to transfer the first 3 to 10 packets, then I reiceive a
> "Transfer complete" message on my control link. (This seems to be correct,
> if we think of the proxy as a big long wire :) But after some seconds curl
> stops receiving the file and I get error-code 18 ( => partial file received
> )
>
> Where can I fix this problem? After digging and reading some RFCs, a socket
> should be read complete until it's empty. So my first assumptions that this
> proxy is not standard conform was wrong.
>
> What do you think?

I think this indicates a problem with that proxy of yours, or possibly the
remote server. I don't think libcurl has any problems with ftp in this aspect.

libcurl will recv() the file until the connection is closed, and if it says
"partial file received" it is because the connection *was* closed and the
received amount of data was not the same amount as was advertised before the
transfer started.

Your ethereal trace should show the file transfer TCP connection being closed
down, before libcurl claims this. Doesn't it?

Of course, we've released no less than 4 updates to libcurl since the version
you're using, but I can't think of any obvious bugs that would explain a
behavior such as this. I truly believe libcurl does the right thing.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Received on 2003-08-12