mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 08:39:37 -05:00
ITS#4583 use mutex around SSL_accept()
This commit is contained in:
parent
5934d696eb
commit
15853f1e74
1 changed files with 8 additions and 0 deletions
|
|
@ -93,6 +93,7 @@ static void tls_locking_cb( int mode, int type, const char *file, int line )
|
|||
*/
|
||||
|
||||
static ldap_pvt_thread_mutex_t tls_def_ctx_mutex;
|
||||
static ldap_pvt_thread_mutex_t tls_connect_mutex;
|
||||
|
||||
static void tls_init_threads( void )
|
||||
{
|
||||
|
|
@ -105,6 +106,7 @@ static void tls_init_threads( void )
|
|||
/* FIXME: the thread id should be added somehow... */
|
||||
|
||||
ldap_pvt_thread_mutex_init( &tls_def_ctx_mutex );
|
||||
ldap_pvt_thread_mutex_init( &tls_connect_mutex );
|
||||
}
|
||||
#endif /* LDAP_R_COMPILE */
|
||||
|
||||
|
|
@ -862,7 +864,13 @@ ldap_pvt_tls_accept( Sockbuf *sb, void *ctx_arg )
|
|||
LBER_SBIOD_LEVEL_TRANSPORT, (void *)ssl );
|
||||
}
|
||||
|
||||
#ifdef LDAP_R_COMPILE
|
||||
ldap_pvt_thread_mutex_lock( &tls_connect_mutex );
|
||||
#endif
|
||||
err = SSL_accept( ssl );
|
||||
#ifdef LDAP_R_COMPILE
|
||||
ldap_pvt_thread_mutex_unlock( &tls_connect_mutex );
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINSOCK
|
||||
errno = WSAGetLastError();
|
||||
|
|
|
|||
Loading…
Reference in a new issue