cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: When to call curl_global_init function

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sat, 15 Jan 2005 23:26:16 +0100 (CET)

On Sat, 15 Jan 2005, Ashish Nigam wrote:

> I have written Windows Services which spawns new processes by executing exe
> files. Windows Services code and exe code make HTTP and FTP calls.

> Now is it enough to call curl global init and curl global cleanup functions
> in Services code or should I call the same in exe code also ?

I don't know enough Windows to tell. Do they share any memory? If so, then
once is enough. If they use their own separate memory and process space, then
each should call curl_global_init() on their own.

However, in most cases libcurl figures it out by itself even if you just call
curl_easy_perform() without using curl_global_init() - but then you'll get the
default global options set of course.

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2005-01-15