--- servers/slapd/overlays/syncprov.c 2004/12/07 23:47:25 1.45 +++ servers/slapd/overlays/syncprov.c 2004/12/08 01:05:50 1.46 @@ -1,4 +1,4 @@ -/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.44 2004/12/07 17:52:55 hyc Exp $ */ +/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.45 2004/12/07 23:47:25 hyc Exp $ */ /* syncprov.c - syncrepl provider */ /* This work is part of OpenLDAP Software . * @@ -1144,6 +1144,11 @@ syncprov_playlog( Operation *op, SlapRep 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, SlapRep 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, SlapRep 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;