From 3fa3e6ac17cbab8003ce3b3ae87928de5f5eaaf4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 3 Jun 2024 07:34:56 +0200 Subject: Adding upstream version 2.6.8+dfsg. Signed-off-by: Daniel Baumann --- servers/slapd/back-meta/add.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'servers/slapd/back-meta/add.c') diff --git a/servers/slapd/back-meta/add.c b/servers/slapd/back-meta/add.c index ec75db1..10adcd7 100644 --- a/servers/slapd/back-meta/add.c +++ b/servers/slapd/back-meta/add.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1999-2022 The OpenLDAP Foundation. + * Copyright 1999-2024 The OpenLDAP Foundation. * Portions Copyright 2001-2003 Pierangelo Masarati. * Portions Copyright 1999-2003 Howard Chu. * All rights reserved. @@ -47,15 +47,17 @@ meta_back_add( Operation *op, SlapReply *rs ) int msgid; ldap_back_send_t retrying = LDAP_BACK_RETRYING; LDAPControl **ctrls = NULL; - + SlapReply *candidates = NULL; Debug(LDAP_DEBUG_ARGS, "==> meta_back_add: %s\n", op->o_req_dn.bv_val ); /* * get the current connection */ - mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR ); - if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR ) ) { + candidates = meta_back_candidates_get( op ); + mc = meta_back_getconn( op, rs, &candidate, LDAP_BACK_SENDERR, candidates ); + if ( !mc || !meta_back_dobind( op, rs, mc, LDAP_BACK_SENDERR, candidates ) ) { + op->o_tmpfree( candidates, op->o_tmpmemctx ); return rs->sr_err; } @@ -181,7 +183,7 @@ retry:; mt->mt_timeout[ SLAP_OP_ADD ], ( LDAP_BACK_SENDRESULT | retrying ) ); if ( rs->sr_err == LDAP_UNAVAILABLE && retrying ) { retrying &= ~LDAP_BACK_RETRYING; - if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR ) ) { + if ( meta_back_retry( op, rs, &mc, candidate, LDAP_BACK_SENDERR, candidates ) ) { /* if the identity changed, there might be need to re-authz */ (void)mi->mi_ldap_extra->controls_free( op, rs, &ctrls ); goto retry; @@ -205,7 +207,7 @@ done:; if ( mc ) { meta_back_release_conn( mi, mc ); } - + op->o_tmpfree( candidates, op->o_tmpmemctx ); return rs->sr_err; } -- cgit v1.2.3