Reviewed-by: Matt Caswell <matt@openssl.org>
static CRYPTO_ONCE zlib = CRYPTO_ONCE_STATIC_INIT;
static CRYPTO_ONCE zlib = CRYPTO_ONCE_STATIC_INIT;
static int zlib_inited = 0;
static void ossl_init_zlib(void)
{
/* Do nothing - we need to know about this for the later cleanup */
zlib_inited = 1;
}
static int zlib_inited = 0;
static void ossl_init_zlib(void)
{
/* Do nothing - we need to know about this for the later cleanup */
zlib_inited = 1;
}
static void ossl_init_thread_stop(struct thread_local_inits_st *locals)
{
static void ossl_init_thread_stop(struct thread_local_inits_st *locals)
{
* conditions for the various "*_inited" vars below.
*/
* conditions for the various "*_inited" vars below.
*/
if (zlib_inited) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
if (zlib_inited) {
#ifdef OPENSSL_INIT_DEBUG
fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
#endif
COMP_zlib_cleanup();
}
#endif
COMP_zlib_cleanup();
}
#ifndef OPENSSL_NO_ASYNC
if (async_inited) {
#ifndef OPENSSL_NO_ASYNC
if (async_inited) {
if ((opts & OPENSSL_INIT_ZLIB)
&& CRYPTO_THREAD_run_once(&zlib, ossl_init_zlib))
return 0;
if ((opts & OPENSSL_INIT_ZLIB)
&& CRYPTO_THREAD_run_once(&zlib, ossl_init_zlib))
return 0;
static STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
static STACK_OF(SSL_COMP) *ssl_comp_methods = NULL;
static CRYPTO_ONCE ssl_load_builtin_comp_once = CRYPTO_ONCE_STATIC_INIT;
static CRYPTO_ONCE ssl_load_builtin_comp_once = CRYPTO_ONCE_STATIC_INIT;
/*
* Constant SSL_MAX_DIGEST equal to size of digests array should be defined
/*
* Constant SSL_MAX_DIGEST equal to size of digests array should be defined
#ifndef OPENSSL_NO_COMP
load_builtin_compressions();
#endif
#ifndef OPENSSL_NO_COMP
load_builtin_compressions();
#endif
*comp = NULL;
ctmp.id = s->compress_meth;
if (ssl_comp_methods != NULL) {
*comp = NULL;
ctmp.id = s->compress_meth;
if (ssl_comp_methods != NULL) {