mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
remove unnecessary call
This commit is contained in:
parent
2a159cef0e
commit
eda6c5abcb
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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 );
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user