cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_global_init/cleanup

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 12 Jun 2002 19:29:55 +0200 (MET DST)

On Wed, 12 Jun 2002, Andreas Bille wrote:

> documentation about these two functions says, that both should be called
> only once for each process, the first prior to any usage, the second after
> any usage.

Correct.

> However, I am interested in using libcurl in an environment where I cannot
> ensure that these conditions are met. There are some hints in the
> documentation mentioning that at least curl_easy_perform checks for
> curl_global_init having appropriatly initialized *whatsoever*, and some
> experiments suggest to me that for instance the library keeps working even
> after a initial callsequence init-init-cleanup, but this experiment I have
> made only for win32. Is it generally save to assume that the library
> behaves well without any calls to 'curl_global_init' and an arbitrary
> number of calls to 'curl_global_cleanup' ?

If the default curl_global_init() actions is fine enough for the application,
and you don't care about closing down nicely with curl_global_cleanup(), the
yes, you can safely assume that libcurl will work fine even without those
calls.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
Received on 2002-06-12