[ 
https://issues.apache.org/jira/browse/MINIFICPP-877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16846764#comment-16846764
 ] 

Mr TheSegfault commented on MINIFICPP-877:
------------------------------------------

We can't assume that TLSSocket initializes first, hence my suggestion to 
initialize via the singleton in a potential chain. TLSSocket may not be used at 
any point, and hence initialization isn't needed. The curl curl initializer 
will come before TLSSocket, so SSL_library_init will be called twice. I have 
read that it is suggested that you init it once, but nothing indicates failure 
otherwise ( even anecdotal tests support that theory ). The singleton idea only 
comes into play with the unknown that SSL_library_init may be called more than 
once. I'm suggesting that with the assumption that documentation is unclear. If 
we can call that more than once than if curl initializes, a later use of 
TLSSocket will be guaranteed to come after curl. 

  

That is not how I read that documentation, It seems that CURL_GLOBAL_WIN32 
instead of DEFAULT or ALL would NOT enable OpenSSL.

I don't quite understand this rationale: "I would prefer to avoid having 
dependencies between initializers: all third party libraries that has these 
kind of global initializers are designed to handle calling their _init and 
_deinit functions more than once (and only deallocate when their refcounter 
reaches 0)"

How does that preclude the capability to chain initializers? This only matters 
if we shouldn't call SSL_library_init twice, and we need to ensure curl doesn't 
call it and we don't call it. 

 

> Create a thread safe way to call thirdparty global initializers
> ---------------------------------------------------------------
>
>                 Key: MINIFICPP-877
>                 URL: https://issues.apache.org/jira/browse/MINIFICPP-877
>             Project: Apache NiFi MiNiFi C++
>          Issue Type: New Feature
>            Reporter: Daniel Bakai
>            Assignee: Daniel Bakai
>            Priority: Major
>             Fix For: 0.7.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to