mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-20 22:59:34 -05:00
ITS#6138 let frontend handle all exop responses
This commit is contained in:
parent
66ed15a288
commit
a54f99858c
1 changed files with 24 additions and 48 deletions
|
|
@ -54,18 +54,15 @@ ldap_back_extended_one( Operation *op, SlapReply *rs, ldap_back_exop_f exop )
|
|||
* called twice; maybe we could avoid the
|
||||
* ldap_back_dobind() call inside each extended()
|
||||
* call ... */
|
||||
if ( !ldap_back_dobind( &lc, op, rs, LDAP_BACK_SENDERR ) ) {
|
||||
return -1;
|
||||
if ( !ldap_back_dobind( &lc, op, rs, LDAP_BACK_DONTSEND ) ) {
|
||||
return rs->sr_err;
|
||||
}
|
||||
|
||||
ctrls = oldctrls = op->o_ctrls;
|
||||
if ( ldap_back_controls_add( op, rs, lc, &ctrls ) )
|
||||
{
|
||||
op->o_ctrls = oldctrls;
|
||||
send_ldap_extended( op, rs );
|
||||
rs->sr_text = NULL;
|
||||
/* otherwise frontend resends result */
|
||||
rc = rs->sr_err = SLAPD_ABANDON;
|
||||
rc = rs->sr_err;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
@ -242,11 +239,22 @@ retry:
|
|||
}
|
||||
}
|
||||
|
||||
if ( text ) {
|
||||
/* copy to tmpmem, doesn't need to be freed */
|
||||
rs->sr_text = op->o_tmpalloc( strlen( text ) + 1, op->o_tmpmemctx );
|
||||
strcpy( rs->sr_text, text );
|
||||
ch_free( text );
|
||||
}
|
||||
if ( rs->sr_matched )
|
||||
rs->sr_flags |= REP_MATCHED_MUSTBEFREED;
|
||||
if ( rs->sr_ctrls )
|
||||
rs->sr_flags |= REP_CTRLS_MUSTBEFREED;
|
||||
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
rs->sr_err = slap_map_api2result( rs );
|
||||
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
|
||||
do_retry = 0;
|
||||
if ( ldap_back_retry( &lc, op, rs, LDAP_BACK_SENDERR ) ) {
|
||||
if ( ldap_back_retry( &lc, op, rs, LDAP_BACK_DONTSEND ) ) {
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
|
@ -255,11 +263,6 @@ retry:
|
|||
ldap_back_quarantine( op, rs );
|
||||
}
|
||||
|
||||
if ( text ) rs->sr_text = text;
|
||||
send_ldap_extended( op, rs );
|
||||
/* otherwise frontend resends result */
|
||||
rc = rs->sr_err = SLAPD_ABANDON;
|
||||
|
||||
} else if ( LDAP_BACK_QUARANTINE( li ) ) {
|
||||
ldap_back_quarantine( op, rs );
|
||||
}
|
||||
|
|
@ -273,22 +276,6 @@ retry:
|
|||
op->o_tmpfree( ndn.bv_val, op->o_tmpmemctx );
|
||||
}
|
||||
|
||||
/* these have to be freed anyway... */
|
||||
if ( rs->sr_matched ) {
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
|
||||
if ( rs->sr_ctrls ) {
|
||||
ldap_controls_free( rs->sr_ctrls );
|
||||
rs->sr_ctrls = NULL;
|
||||
}
|
||||
|
||||
if ( text ) {
|
||||
free( text );
|
||||
rs->sr_text = NULL;
|
||||
}
|
||||
|
||||
/* in case, cleanup handler */
|
||||
if ( lc == NULL ) {
|
||||
*lcp = NULL;
|
||||
|
|
@ -363,7 +350,7 @@ retry:
|
|||
rs->sr_err = slap_map_api2result( rs );
|
||||
if ( rs->sr_err == LDAP_UNAVAILABLE && do_retry ) {
|
||||
do_retry = 0;
|
||||
if ( ldap_back_retry( &lc, op, rs, LDAP_BACK_SENDERR ) ) {
|
||||
if ( ldap_back_retry( &lc, op, rs, LDAP_BACK_DONTSEND ) ) {
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
|
@ -371,12 +358,6 @@ retry:
|
|||
if ( LDAP_BACK_QUARANTINE( li ) ) {
|
||||
ldap_back_quarantine( op, rs );
|
||||
}
|
||||
|
||||
if ( text ) rs->sr_text = text;
|
||||
send_ldap_extended( op, rs );
|
||||
/* otherwise frontend resends result */
|
||||
rc = rs->sr_err = SLAPD_ABANDON;
|
||||
|
||||
} else if ( LDAP_BACK_QUARANTINE( li ) ) {
|
||||
ldap_back_quarantine( op, rs );
|
||||
}
|
||||
|
|
@ -385,21 +366,16 @@ retry:
|
|||
ldap_pvt_mp_add( li->li_ops_completed[ SLAP_OP_EXTENDED ], 1 );
|
||||
ldap_pvt_thread_mutex_unlock( &li->li_counter_mutex );
|
||||
|
||||
/* these have to be freed anyway... */
|
||||
if ( rs->sr_matched ) {
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_matched = NULL;
|
||||
}
|
||||
|
||||
if ( rs->sr_ctrls ) {
|
||||
ldap_controls_free( rs->sr_ctrls );
|
||||
rs->sr_ctrls = NULL;
|
||||
}
|
||||
|
||||
if ( text ) {
|
||||
free( text );
|
||||
rs->sr_text = NULL;
|
||||
/* copy to tmpmem, doesn't need to be freed */
|
||||
rs->sr_text = op->o_tmpalloc( strlen( text ) + 1, op->o_tmpmemctx );
|
||||
strcpy( rs->sr_text, text );
|
||||
ch_free( text );
|
||||
}
|
||||
if ( rs->sr_matched )
|
||||
rs->sr_flags |= REP_MATCHED_MUSTBEFREED;
|
||||
if ( rs->sr_ctrls )
|
||||
rs->sr_flags |= REP_CTRLS_MUSTBEFREED;
|
||||
|
||||
/* in case, cleanup handler */
|
||||
if ( lc == NULL ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue