curl-library
RE: FTP getting empty file.
From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Tue, 17 Aug 2004 16:19:33 +0200 (CEST)
Date: Tue, 17 Aug 2004 16:19:33 +0200 (CEST)
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.htmlReceived on 2004-08-17