Calling OpenSSL_thread_stop() multiple times
deepak.redmi2 at gmail.com
Tue Aug 22 18:40:48 UTC 2023
On Tue, Aug 22, 2023, 9:24 PM Matt Caswell <matt at openssl.org> wrote:
> On 22/08/2023 15:43, Dipak B wrote:
> > Is it okay to call openssl_stop_thread() on a thread and then again use
> > that thread for TLS communication ? In effect end up calling
> > open_ssl_thread() multiple times on same thread.
> No. Don't do that. Some things get initialised on first use in a thread.
> The initialisation never gets run again, so if they get deinitialised
> they remain deinitialised forever on that thread.
Not calling Openssl_stop_thread() leads to memory leaks inside
ERR_get_error() for me.
So, can following be supported?
Communicate.DLL statically linked to ossl 3.x & libcurl 8.x exporting 3
SSL_library_init(); or openssl_int_ssl(load no err strings)
curl_easy_init(); // multiple times generating curl handles to be stored in
array of say 16
curl_easy_cleanup(); // multiples times for each handle inside array
Openssl_stop_thread(); // once for each curl handle; so 16 times
// openssl_stop_thread(); // having this here solves the memory leak for me
TalkToWeb() is called by new threads (each invocation is with new thread)
created by an executable which loads communicate.DLL
Execution of above code leads to accumulation of memory until Shutdown() is
Libcurl encourages handle re-use.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openssl-users