curl-library
RE: FTP getting empty file.
Date: Wed, 18 Aug 2004 09:30:56 +0300
Attached is corrected code according to your suggestion.
-----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.
- text/plain attachment: diff.txt