mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-04 14:10:39 -05:00
Bug fix for new sockbuf code under NT. Added mutex protection against
deadlock in connection_resched.
This commit is contained in:
parent
c5765e3827
commit
bac87c2562
1 changed files with 7 additions and 3 deletions
|
|
@ -327,16 +327,18 @@ long connection_init(
|
|||
c = NULL;
|
||||
|
||||
for( i=0; i < dtblsize; i++) {
|
||||
ber_socket_t sd;
|
||||
ber_socket_t sd;
|
||||
|
||||
ber_sockbuf_ctrl( connections[i].c_sb, LBER_SB_OPT_GET_FD, &sd );
|
||||
|
||||
if( connections[i].c_struct_state == SLAP_C_UNINITIALIZED ) {
|
||||
assert( connections[i].c_sb == 0 );
|
||||
c = &connections[i];
|
||||
break;
|
||||
}
|
||||
|
||||
sd = AC_SOCKET_INVALID;
|
||||
if (connections[i].c_sb != NULL)
|
||||
ber_sockbuf_ctrl( connections[i].c_sb, LBER_SB_OPT_GET_FD, &sd );
|
||||
|
||||
if( connections[i].c_struct_state == SLAP_C_UNUSED ) {
|
||||
assert( sd == AC_SOCKET_INVALID );
|
||||
c = &connections[i];
|
||||
|
|
@ -1064,7 +1066,9 @@ connection_resched( Connection *conn )
|
|||
"connection_resched: attempting closing conn=%ld sd=%d\n",
|
||||
conn->c_connid, sd, 0 );
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &connections_mutex );
|
||||
connection_close( conn );
|
||||
ldap_pvt_thread_mutex_unlock( &connections_mutex );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue