Fix ITS#1655, don't retrieve sd until we've checked for valid c_sb.

This commit is contained in:
Howard Chu 2002-03-20 23:47:08 +00:00
parent 6b0fb09e0d
commit f181388a5e

View file

@ -234,15 +234,15 @@ static Connection* connection_get( ber_socket_t s )
ber_socket_t i, sd;
for(i=0; i<dtblsize; i++) {
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_conn_state == SLAP_C_INVALID );
assert( connections[i].c_sb == 0 );
break;
}
ber_sockbuf_ctrl( connections[i].c_sb,
LBER_SB_OPT_GET_FD, &sd );
if( connections[i].c_struct_state == SLAP_C_UNUSED ) {
assert( connections[i].c_conn_state == SLAP_C_INVALID );
assert( sd == AC_SOCKET_INVALID );