mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-09 02:52:04 +08:00
getbyname/getbyaddr should share mutex per ITS#563.
Patch provided by Steve @ Novell, thanks!
This commit is contained in:
parent
1af849c720
commit
7573a81efe
@ -58,11 +58,8 @@
|
||||
# ifndef USE_CTIME_R
|
||||
static ldap_pvt_thread_mutex_t ldap_int_ctime_mutex;
|
||||
# endif
|
||||
# ifndef HAVE_GETHOSTBYNAME_R
|
||||
static ldap_pvt_thread_mutex_t ldap_int_gethostbyname_mutex;
|
||||
# endif
|
||||
# ifndef HAVE_GETHOSTBYADDR_R
|
||||
static ldap_pvt_thread_mutex_t ldap_int_gethostbyaddr_mutex;
|
||||
# if !defined( HAVE_GETHOSTBYNAME_R ) || !defined( HAVE_GETHOSTBYADDR_R )
|
||||
static ldap_pvt_thread_mutex_t ldap_int_gethostby_mutex;
|
||||
# endif
|
||||
# ifdef HAVE_RES_QUERY
|
||||
ldap_pvt_thread_mutex_t ldap_int_resolv_mutex;
|
||||
@ -146,7 +143,7 @@ int ldap_pvt_gethostbyname_a(
|
||||
struct hostent *he;
|
||||
int retval;
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &ldap_int_gethostbyname_mutex );
|
||||
ldap_pvt_thread_mutex_lock( &ldap_int_gethostby_mutex );
|
||||
|
||||
he = gethostbyname( name );
|
||||
|
||||
@ -161,7 +158,7 @@ int ldap_pvt_gethostbyname_a(
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
ldap_pvt_thread_mutex_unlock( &ldap_int_gethostbyname_mutex );
|
||||
ldap_pvt_thread_mutex_unlock( &ldap_int_gethostby_mutex );
|
||||
|
||||
return retval;
|
||||
#else
|
||||
@ -225,7 +222,7 @@ int ldap_pvt_gethostbyaddr_a(
|
||||
struct hostent *he;
|
||||
int retval;
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &ldap_int_gethostbyaddr_mutex );
|
||||
ldap_pvt_thread_mutex_lock( &ldap_int_gethostby_mutex );
|
||||
|
||||
he = gethostbyaddr( addr, len, type );
|
||||
|
||||
@ -240,7 +237,7 @@ int ldap_pvt_gethostbyaddr_a(
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
ldap_pvt_thread_mutex_unlock( &ldap_int_gethostbyaddr_mutex );
|
||||
ldap_pvt_thread_mutex_unlock( &ldap_int_gethostby_mutex );
|
||||
|
||||
return retval;
|
||||
#else /* gethostbyaddr() */
|
||||
@ -269,12 +266,8 @@ void ldap_int_utils_init( void )
|
||||
ldap_pvt_thread_mutex_init( &ldap_int_ctime_mutex );
|
||||
#endif
|
||||
|
||||
#if !defined( HAVE_GETHOSTBYNAME_R )
|
||||
ldap_pvt_thread_mutex_init( &ldap_int_gethostbyname_mutex );
|
||||
#endif
|
||||
|
||||
#if !defined( HAVE_GETHOSTBYADDR_R )
|
||||
ldap_pvt_thread_mutex_init( &ldap_int_gethostbyaddr_mutex );
|
||||
#if !defined( HAVE_GETHOSTBYNAME_R ) || !defined( HAVE_GETHOSTBYADDR_R )
|
||||
ldap_pvt_thread_mutex_init( &ldap_int_gethostby_mutex );
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RES_QUERY
|
||||
|
Loading…
Reference in New Issue
Block a user