--- servers/slapd/overlays/syncprov.c 2008/03/19 23:31:42 1.223
+++ servers/slapd/overlays/syncprov.c 2008/04/16 22:03:06 1.229
@@ -1,4 +1,4 @@
-/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.222 2008/03/19 23:26:14 hyc Exp $ */
+/* $OpenLDAP: pkg/ldap/servers/slapd/overlays/syncprov.c,v 1.227 2008/04/03 06:43:48 hyc Exp $ */
/* syncprov.c - syncrepl provider */
/* This work is part of OpenLDAP Software .
*
@@ -696,10 +696,7 @@ again:
break;
}
- if ( on->on_next )
- fop.o_bd->bd_info = (BackendInfo *)on->on_next;
- else
- fop.o_bd->bd_info = on->on_info->oi_orig;
+ fop.o_bd->bd_info = (BackendInfo *)on->on_info;
fop.o_bd->be_search( &fop, &frs );
fop.o_bd->bd_info = (BackendInfo *)on;
@@ -1531,10 +1528,7 @@ syncprov_playlog( Operation *op, SlapRep
fop.ors_filter = ⁡
cb.sc_response = playlog_cb;
- if ( on->on_next )
- fop.o_bd->bd_info = (BackendInfo *)on->on_next;
- else
- fop.o_bd->bd_info = on->on_info->oi_orig;
+ fop.o_bd->bd_info = (BackendInfo *)on->on_info;
for ( i=ndel; isr_state.rid,
- srs->sr_state.sid );
+ if ( delcsn[0].bv_len ) {
+ slap_compose_sync_cookie( op, &cookie, delcsn, srs->sr_state.rid,
+ srs->sr_state.sid );
+ }
Debug( LDAP_DEBUG_SYNC, "syncprov_playlog: cookie=%s\n", cookie.bv_val, 0, 0 );
uuids[ndel].bv_val = NULL;
- syncprov_sendinfo( op, rs, LDAP_TAG_SYNC_ID_SET, &cookie, 0, uuids, 1 );
+ syncprov_sendinfo( op, rs, LDAP_TAG_SYNC_ID_SET,
+ delcsn[0].bv_len ? &cookie : NULL, 0, uuids, 1 );
op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
}
op->o_tmpfree( uuids, op->o_tmpmemctx );
@@ -2246,6 +2243,9 @@ no_change: if ( !(op->o_sync_mode & SLA
}
goto shortcut;
}
+ } else {
+ /* consumer doesn't have the right number of CSNs */
+ changed = SS_CHANGED;
}
/* Do we have a sessionlog for this search? */
sl=si->si_logs;
@@ -2388,7 +2388,7 @@ syncprov_operational(
}
if ( !ap ) {
- if ( !rs->sr_flags & REP_ENTRY_MODIFIABLE ) {
+ if ( !(rs->sr_flags & REP_ENTRY_MODIFIABLE) ) {
rs->sr_entry = entry_dup( rs->sr_entry );
rs->sr_flags |=
REP_ENTRY_MODIFIABLE|REP_ENTRY_MUSTBEFREED;