int option, void *arg ));
LDAP_F (void) ldap_pvt_tls_destroy LDAP_P(( void ));
-LDAP_F (int) ldap_pvt_tls_init LDAP_P(( void ));
+LDAP_F (int) ldap_pvt_tls_init LDAP_P(( int do_threads ));
LDAP_F (int) ldap_pvt_tls_init_def_ctx LDAP_P(( int is_server ));
LDAP_F (int) ldap_pvt_tls_accept LDAP_P(( Sockbuf *sb, void *ctx_arg ));
LDAP_F (int) ldap_pvt_tls_connect LDAP_P(( struct ldap *ld, Sockbuf *sb, const char *host ));
* Called once per implementation.
*/
static int
-tls_init(tls_impl *impl )
+tls_init(tls_impl *impl, int do_threads )
{
static int tls_initialized = 0;
if ( impl->ti_inited++ ) return 0;
+ if ( do_threads ) {
#ifdef LDAP_R_COMPILE
- impl->ti_thr_init();
+ impl->ti_thr_init();
#endif
+ }
+
return impl->ti_tls_init();
}
* Initialize TLS subsystem. Called once per implementation.
*/
int
-ldap_pvt_tls_init( void )
+ldap_pvt_tls_init( int do_threads )
{
- return tls_init( tls_imp );
+ return tls_init( tls_imp, do_threads );
}
/*
if ( lo->ldo_tls_ctx )
return 0;
- tls_init( ti );
+ tls_init( ti, 0 );
if ( is_server && !lts.lt_certfile && !lts.lt_keyfile &&
!lts.lt_cacertfile && !lts.lt_cacertdir &&
host = "localhost";
}
- (void) tls_init( tls_imp );
+ (void) tls_init( tls_imp, 0 );
/*
* Use non-blocking io during SSL Handshake when a timeout is configured
}
#ifdef HAVE_TLS
- rc = ldap_pvt_tls_init();
+ rc = ldap_pvt_tls_init( 1 );
if ( rc != 0 ) {
Debug( LDAP_DEBUG_ANY, "main: "
"TLS init failed: %d\n",
}
#ifdef HAVE_TLS
- rc = ldap_pvt_tls_init();
+ rc = ldap_pvt_tls_init( 1 );
if( rc != 0) {
Debug( LDAP_DEBUG_ANY,
"main: TLS init failed: %d\n",