X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Fsyncrepl.c;h=ac1042abd18ead5b9b81c4801875252bc221de56;hb=3861c47316e6d048449f7f0e0af7a748643e99ad;hp=79643c6ee980eb9e57c3162ae395f31ad10c12c9;hpb=3d3ba13f928459a7780790408b0196693e335a70;p=openldap diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 79643c6ee9..ac1042abd1 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2051,8 +2051,12 @@ syncrepl_del_nonpresent( for (i=0; uuids[i].bv_val; i++) { op->ors_slimit = 1; + slap_uuidstr_from_normalized( &uf.f_av_value, &uuids[i], + op->o_tmpmemctx ); + filter2bv_x( op, op->ors_filter, &op->ors_filterstr ); uf.f_av_value = uuids[i]; rc = be->be_search( op, &rs_search ); + op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx ); } si->si_refreshDelete ^= NP_DELETE_ONE; } else { @@ -2090,6 +2094,9 @@ syncrepl_del_nonpresent( op->o_req_dn = *np_prev->npe_name; op->o_req_ndn = *np_prev->npe_nname; rc = op->o_bd->be_delete( op, &rs_delete ); + Debug( LDAP_DEBUG_SYNC, + "syncrepl_del_nonpresent: be_delete %s (%d)\n", + op->o_req_dn.bv_val, rc, 0 ); if ( rs_delete.sr_err == LDAP_NOT_ALLOWED_ON_NONLEAF ) { Modifications mod1, mod2; @@ -2593,6 +2600,16 @@ avl_ber_bvfree( void *v_bv ) void syncinfo_free( syncinfo_t *sie ) { + if ( sie->si_ld ) { + if ( sie->si_conn_setup ) { + ber_socket_t s; + ldap_get_option( sie->si_ld, LDAP_OPT_DESC, &s ); + connection_client_stop( s ); + sie->si_conn_setup = 0; + } + ldap_unbind_ext( sie->si_ld, NULL, NULL ); + } + /* re-fetch it, in case it was already removed */ sie->si_re = ldap_pvt_runqueue_find( &slapd_rq, do_syncrepl, sie ); if ( sie->si_re ) { @@ -2656,9 +2673,6 @@ syncinfo_free( syncinfo_t *sie ) if ( sie->si_presentlist ) { avl_free( sie->si_presentlist, avl_ber_bvfree ); } - if ( sie->si_ld ) { - ldap_unbind_ext( sie->si_ld, NULL, NULL ); - } while ( !LDAP_LIST_EMPTY( &sie->si_nonpresentlist )) { struct nonpresent_entry* npe; npe = LDAP_LIST_FIRST( &sie->si_nonpresentlist );