curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Re: curl_version_info() thread-safety

From: Daniel Stenberg via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 25 Sep 2022 10:30:04 +0200 (CEST)

On Sun, 25 Sep 2022, Patrick Monnerat wrote:

> main()
> {
>   const curl_version_info_data *vid;
>
>   vid = curl_version_info(CURLVERSION_NOW);
>   printf("%08X\n", vid->features);
>   curl_global_sslset(CURLSSLBACKEND_OPENSSL, NULL, NULL);
>   curl_version_info(CURLVERSION_NOW);
>   printf("%08X\n", vid->features);
> }
>
> Result (with a MultiSSL library):
>
> 75DFE7DD
> 75FFE7DD

Right, but I would argue this is not using the API as documented and intended.
The global init call should be called before curl_version_info() if you want
it to return a "stable" value.

-- 
  / daniel.haxx.se
  | Commercial curl support up to 24x7 is available!
  | Private help, bug fixes, support, ports, new features
  | https://curl.se/support.html


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-09-25