cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Curl from multiple threads and callback functions

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 1 Jan 2008 15:25:05 -0800

On Tue, Jan 01, 2008 at 11:29:43PM +0100, Andreas Volz wrote:
> In my application I generate a dynamic number of download threads. My
> problem is the static writer callback. For each CURL handle I would
> need a new callback function at compile time. But I know the number of
> CURL handles only at runtime. Do you understand my problem? Any ideas
> how to solve it?

I'm afraid I don't understand the problem. You can set a new callback
function for each handle if you want to, but why do you need to?
You can pass in a unique datum into the static callback using the
CURLOPT_WRITEDATA option, and use that to perform different behaviour
in the callback on a per-handle basis.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-01-02