From 2e5fb908d19657704dcced1407b014d6167ab44c Mon Sep 17 00:00:00 2001 From: Jong Hyuk Choi Date: Fri, 23 May 2003 13:32:13 +0000 Subject: [PATCH] - glue entry management change - op->o_tmpmfunc setup --- servers/slapd/syncrepl.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 2547179e4c..4c0629a9a9 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -325,6 +325,7 @@ do_syncrepl( si->ctx = ctx; op.o_tmpmemctx = NULL; /* FIXME : to use per-thread mem context */ + op.o_tmpmfuncs = &ch_mfuncs; op.o_tag = LDAP_REQ_SEARCH; op.o_dn = si->updatedn; op.o_ndn = si->updatedn; @@ -974,22 +975,20 @@ syncrepl_entry( if ( !attr_find( e->e_attrs, slap_schema.si_ad_entryUUID )) { attr_merge_one( e, slap_schema.si_ad_entryUUID, syncUUID, syncUUID ); } + op->o_tag = LDAP_REQ_ADD; op->ora_e = e; op->o_req_dn = e->e_name; op->o_req_ndn = e->e_nname; rc = be->be_add( op, &rs ); + if ( rc != LDAP_SUCCESS ) { - if ( rc == LDAP_ALREADY_EXISTS ) { -#ifdef NEW_LOGGING - LDAP_LOG( OPERATION, ERR, - "be_add failed : already exists (%d)\n", - rc, 0, 0 ); -#else - Debug( LDAP_DEBUG_ANY, - "be_add failed : already exists (%d)\n", - rc, 0, 0 ); -#endif + if ( rc == LDAP_ALREADY_EXISTS ) { + op->o_tag = LDAP_REQ_MODIFY; + op->orm_modlist = modlist; + op->o_req_dn = e->e_name; + op->o_req_ndn = e->e_nname; + rc = be->be_modify( op, &rs ); } else if ( rc == LDAP_REFERRAL || rc == LDAP_NO_SUCH_OBJECT || rc == DB_NOTFOUND ) { @@ -999,11 +998,11 @@ syncrepl_entry( } else { #ifdef NEW_LOGGING LDAP_LOG( OPERATION, ERR, - "be_add failed (%d)\n", + "be_modify failed (%d)\n", rc, 0, 0 ); #else Debug( LDAP_DEBUG_ANY, - "be_add failed (%d)\n", + "be_modify failed (%d)\n", rc, 0, 0 ); #endif } -- 2.39.2