fix ITS#4686 (retry with idassert)

This commit is contained in:
Pierangelo Masarati 2006-09-26 15:12:07 +00:00
parent 0e9983ff2b
commit b769f44619
5 changed files with 15 additions and 5 deletions

View File

@ -167,6 +167,7 @@ meta_back_add( Operation *op, SlapReply *rs )
}
attrs[ i ] = NULL;
retry:;
ctrls = op->o_ctrls;
if ( ldap_back_proxy_authz_ctrl( &mc->mc_conns[ candidate ].msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, op, rs, &ctrls ) != LDAP_SUCCESS )
@ -175,7 +176,6 @@ meta_back_add( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
rs->sr_err = ldap_add_ext( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
attrs, ctrls, NULL, &msgid );
rs->sr_err = meta_back_op_result( mc, op, rs, candidate, msgid,
@ -183,6 +183,8 @@ retry:;
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
do_retry = 0;
if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) {
/* if the identity changed, there might be need to re-authz */
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
goto retry;
}
}

View File

@ -65,6 +65,7 @@ meta_back_delete( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
ctrls = op->o_ctrls;
if ( ldap_back_proxy_authz_ctrl( &mc->mc_conns[ candidate ].msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, op, rs, &ctrls ) != LDAP_SUCCESS )
@ -73,7 +74,6 @@ meta_back_delete( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
rs->sr_err = ldap_delete_ext( mc->mc_conns[ candidate ].msc_ld,
mdn.bv_val, ctrls, NULL, &msgid );
rs->sr_err = meta_back_op_result( mc, op, rs, candidate, msgid,
@ -81,6 +81,8 @@ retry:;
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
do_retry = 0;
if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) {
/* if the identity changed, there might be need to re-authz */
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
goto retry;
}
}

View File

@ -176,6 +176,7 @@ meta_back_modify( Operation *op, SlapReply *rs )
}
modv[ i ] = 0;
retry:;
ctrls = op->o_ctrls;
rc = ldap_back_proxy_authz_ctrl( &mc->mc_conns[ candidate ].msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, op, rs, &ctrls );
@ -184,7 +185,6 @@ meta_back_modify( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
rs->sr_err = ldap_modify_ext( mc->mc_conns[ candidate ].msc_ld, mdn.bv_val,
modv, ctrls, NULL, &msgid );
rs->sr_err = meta_back_op_result( mc, op, rs, candidate, msgid,
@ -192,6 +192,8 @@ retry:;
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
do_retry = 0;
if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) {
/* if the identity changed, there might be need to re-authz */
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
goto retry;
}
}

View File

@ -118,6 +118,7 @@ meta_back_modrdn( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
ctrls = op->o_ctrls;
if ( ldap_back_proxy_authz_ctrl( &mc->mc_conns[ candidate ].msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, op, rs, &ctrls ) != LDAP_SUCCESS )
@ -126,7 +127,6 @@ meta_back_modrdn( Operation *op, SlapReply *rs )
goto cleanup;
}
retry:;
rs->sr_err = ldap_rename( mc->mc_conns[ candidate ].msc_ld,
mdn.bv_val, op->orr_newrdn.bv_val,
mnewSuperior.bv_val, op->orr_deleteoldrdn,
@ -136,6 +136,8 @@ retry:;
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
do_retry = 0;
if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) {
/* if the identity changed, there might be need to re-authz */
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
goto retry;
}
}

View File

@ -454,6 +454,7 @@ meta_back_search_start(
tvp = &tv;
}
retry:;
ctrls = op->o_ctrls;
if ( ldap_back_proxy_authz_ctrl( &msc->msc_bound_ndn,
mt->mt_version, &mt->mt_idassert, op, rs, &ctrls )
@ -467,7 +468,6 @@ meta_back_search_start(
/*
* Starts the search
*/
retry:;
assert( msc->msc_ld != NULL );
rc = ldap_search_ext( msc->msc_ld,
mbase.bv_val, realscope, mfilter.bv_val,
@ -482,6 +482,8 @@ retry:;
case LDAP_SERVER_DOWN:
if ( nretries && meta_back_retry( op, rs, mcp, candidate, LDAP_BACK_DONTSEND ) ) {
nretries = 0;
/* if the identity changed, there might be need to re-authz */
(void)ldap_back_proxy_authz_ctrl_free( op, &ctrls );
goto retry;
}