From b8c6727dc9596def476fe96a6f7ed4ed341aa041 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 8 Dec 2004 02:05:50 +0000 Subject: [PATCH] Fix playlog search --- servers/slapd/overlays/syncprov.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index a751f477a2..9c44dc66a8 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -1144,6 +1144,11 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl, int i, j, ndel, num, nmods, mmods; BerVarray uuids; + if ( !sl->sl_num ) { + ldap_pvt_thread_mutex_unlock( &sl->sl_mutex ); + return; + } + num = sl->sl_num; i = 0; nmods = 0; @@ -1211,7 +1216,6 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl, fop.o_sync_mode = 0; fop.o_callback = &cb; fop.ors_limit = NULL; - fop.ors_slimit = 1; fop.ors_tlimit = SLAP_NO_LIMIT; fop.ors_attrs = slap_anlist_all_attributes; fop.ors_attrsonly = 0; @@ -1228,23 +1232,22 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl, fop.ors_filter = ⁡ cb.sc_response = playlog_cb; + fop.o_bd->bd_info = on->on_info->oi_orig; - for ( i=0; ibd_info = on->on_info->oi_orig; + mf.f_av_value = uuids[i]; cb.sc_private = NULL; + fop.ors_slimit = 1; rc = fop.o_bd->be_search( &fop, &frs ); - fop.o_bd->bd_info = (BackendInfo *)on; - op->o_tmpfree( fop.ors_filterstr.bv_val, op->o_tmpmemctx ); /* If entry was not found, add to delete list */ if ( !cb.sc_private ) { - uuids[ndel++] = uuids[num - 1 - i]; + uuids[ndel++] = uuids[i]; } } + fop.o_bd->bd_info = (BackendInfo *)on; } if ( ndel ) { uuids[ndel].bv_val = NULL; -- 2.39.5