cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: question regarding CURLOPT_WRITEFUNCTION & CURLOPT_WRITEDATA

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 20 Oct 2008 16:10:35 +0200 (CEST)

On Mon, 20 Oct 2008, Jan wrote:

>> WRITEFUNCTION is an option you use to set the write callback function with.
>> The callback function gets called numerous times for each download. It does
>> not create any large chunk.
>
> mh, now im getting confused. as far as i understood
> WriteMemoryCallback<http://curl.haxx.se/lxr/ident?i=WriteMemoryCallback>it
> keeps adding the chunks to the memory struct.. so after all the chunks are
> processed, they should be stored in the memory struct? anyway i will try the
> sample and see how it goes.

The function 'WriteMemoryCallback' in that example is exactly such a callback.
It gets called by libcurl when data is downloaded. And yes it stores all
downloaded data in a single memory chunk.

-- 
  / daniel.haxx.se
Received on 2008-10-20