remove unnecessary call

This commit is contained in:
Pierangelo Masarati 2005-04-22 12:59:30 +00:00
parent 2a159cef0e
commit eda6c5abcb
7 changed files with 16 additions and 57 deletions

View File

@ -56,11 +56,7 @@ meta_back_add( Operation *op, SlapReply *rs )
return rs->sr_err;
}
if ( !meta_back_is_valid( mc, candidate ) ) {
rs->sr_err = LDAP_UNAVAILABLE;
send_ldap_result( op, rs );
return rs->sr_err;
}
assert( mc->mc_conns[ candidate ].msc_ld != NULL );
/*
* Rewrite the add dn, if needed

View File

@ -264,11 +264,6 @@ meta_back_single_dobind(
ldap_back_send_t sendok,
int retries );
extern int
meta_back_is_valid(
struct metaconn *lc,
int candidate );
extern int
meta_back_op_result(
struct metaconn *lc,

View File

@ -423,31 +423,6 @@ done:;
return( bound > 0 );
}
/*
*
*/
int
meta_back_is_valid( struct metaconn *mc, int candidate )
{
struct metasingleconn *msc;
int i;
assert( mc );
if ( candidate < 0 ) {
return 0;
}
for ( i = 0, msc = &mc->mc_conns[ 0 ]; !META_LAST( msc ) && i < candidate;
++i, ++msc );
if ( !META_LAST( msc ) ) {
return ( msc->msc_ld != NULL );
}
return 0;
}
/*
* meta_back_rebind
*

View File

@ -847,14 +847,19 @@ done:;
ldap_pvt_thread_mutex_unlock( &mi->mi_conn_mutex );
Debug( LDAP_DEBUG_TRACE,
"=>meta_back_getconn: conn %ld inserted\n",
mc->mc_conn->c_connid, 0, 0 );
/*
* Err could be -1 in case a duplicate metaconn is inserted
*/
if ( err != 0 ) {
if ( err == 0 ) {
Debug( LDAP_DEBUG_TRACE,
"%s meta_back_getconn: conn %ld inserted\n",
op->o_log_prefix, mc->mc_conn->c_connid, 0 );
} else {
Debug( LDAP_DEBUG_TRACE,
"%s meta_back_getconn: conn %ld insert failed\n",
op->o_log_prefix, mc->mc_conn->c_connid, 0 );
rs->sr_err = LDAP_OTHER;
rs->sr_text = "Internal server error";
meta_back_conn_free( mc );

View File

@ -46,11 +46,7 @@ meta_back_delete( Operation *op, SlapReply *rs )
return rs->sr_err;
}
if ( !meta_back_is_valid( lc, candidate ) ) {
rs->sr_err = LDAP_OTHER;
send_ldap_result( op, rs );
return rs->sr_err;
}
assert( lc->mc_conns[ candidate ].msc_ld != NULL );
/*
* Rewrite the compare dn, if needed

View File

@ -51,12 +51,8 @@ meta_back_modify( Operation *op, SlapReply *rs )
if ( !lc || !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
return rs->sr_err;
}
if ( !meta_back_is_valid( lc, candidate ) ) {
rs->sr_err = LDAP_OTHER;
send_ldap_result( op, rs );
return rs->sr_err;
}
assert( lc->mc_conns[ candidate ].msc_ld != NULL );
/*
* Rewrite the modify dn, if needed

View File

@ -52,13 +52,9 @@ meta_back_modrdn( Operation *op, SlapReply *rs )
if ( !meta_back_dobind( lc, op, LDAP_BACK_SENDERR ) ) {
return rs->sr_err;
}
if ( !meta_back_is_valid( lc, candidate ) ) {
rs->sr_err = LDAP_OTHER;
send_ldap_result( op, rs );
return rs->sr_err;
}
assert( lc->mc_conns[ candidate ].msc_ld != NULL );
dc.conn = op->o_conn;
dc.rs = rs;