cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: FTP getting empty file.

From: Alexander Krasnostavsky <ALEXANDERKR_at_Amdocs.com>
Date: Thu, 19 Aug 2004 11:31:48 +0300

> Sent: Wednesday, August 18, 2004 09:31
> Attached is corrected code according to your suggestion.

Hi Daniel,
Did you check the changes?

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Tuesday, August 17, 2004 17:20
To: libcurl development
Subject: RE: FTP getting empty file.

On Tue, 17 Aug 2004, Alexander Krasnostavsky wrote:

> I hope it is correct also for other protocols.

I don't think it is correct even for FTP, and I'll explain why:

+ bool is_first_time = TRUE;

This function is called many times during a download so setting
is_first_time

to true every time surely defeats its purpose.

I suggest you instead use the 'k->bodywrites' counter since that is
increased

every time a piece of the "document body" is written/sent to the
callback (and

it is set to zero before a transfer is started). So, when that is zero,

nothing has been sent to the callback yet.

Also, when this is added, it changes the behaviour of the library
slightly and

I would like to have this fact added to the docs.

--
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.
Received on 2004-08-19