static int
syncprov_findbase( Operation *op, fbase_cookie *fc )
{
- opcookie *opc = op->o_callback->sc_private;
- slap_overinst *on = opc->son;
-
/* Use basic parameters from syncrepl search, but use
* current op's threadctx / tmpmemctx
*/
cf.f_av_value = si->si_ctxcsn[maxid];
fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
"(entryCSN>=%s)", cf.f_av_value.bv_val );
- if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+ if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
return LDAP_OTHER;
}
fop.ors_attrsonly = 0;
fop.ors_filterstr.bv_len = snprintf( buf, sizeof( buf ),
"(entryCSN<=%s)", cf.f_av_value.bv_val );
}
- if ( fop.ors_filterstr.bv_len < 0 || fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
+ if ( fop.ors_filterstr.bv_len >= sizeof( buf ) ) {
return LDAP_OTHER;
}
fop.ors_attrsonly = 1;
mod.sml_nvalues = NULL;
mod.sml_desc = slap_schema.si_ad_contextCSN;
mod.sml_op = LDAP_MOD_REPLACE;
- mod.sml_flags = 0;
+ mod.sml_flags = SLAP_MOD_INTERNAL;
mod.sml_next = NULL;
cb.sc_response = slap_null_cb;
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 );
+ 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,
delcsn[0].bv_len ? &cookie : NULL, 0, uuids, 1 );
- op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
+ if ( delcsn[0].bv_len ) {
+ op->o_tmpfree( cookie.bv_val, op->o_tmpmemctx );
+ }
}
op->o_tmpfree( uuids, op->o_tmpmemctx );
}
send_ldap_error( op, rs, LDAP_SYNC_REFRESH_REQUIRED, "sync cookie is stale" );
return rs->sr_err;
}
+ if ( srs->sr_state.ctxcsn ) {
+ ber_bvarray_free_x( srs->sr_state.ctxcsn, op->o_tmpmemctx );
+ srs->sr_state.ctxcsn = NULL;
+ }
+ if ( srs->sr_state.sids ) {
+ slap_sl_free( srs->sr_state.sids, op->o_tmpmemctx );
+ srs->sr_state.sids = NULL;
+ }
+ srs->sr_state.numcsns = 0;
} else {
gotstate = 1;
/* If changed and doing Present lookup, send Present UUIDs */
"NAME 'olcSyncProvConfig' "
"DESC 'SyncRepl Provider configuration' "
"SUP olcOverlayConfig "
- "MAY ( olcSpCheckpoint $ olcSpSessionlog $ olcSpNoPresent ) )",
+ "MAY ( olcSpCheckpoint "
+ "$ olcSpSessionlog "
+ "$ olcSpNoPresent "
+ "$ olcSpReloadHint "
+ ") )",
Cft_Overlay, spcfg },
{ NULL, 0, NULL }
};
struct berval bv;
bv.bv_len = snprintf( c->cr_msg, sizeof( c->cr_msg ),
"%d %d", si->si_chkops, si->si_chktime );
- if ( bv.bv_len < 0 || bv.bv_len >= sizeof( c->cr_msg ) ) {
+ if ( bv.bv_len >= sizeof( c->cr_msg ) ) {
rc = 1;
} else {
bv.bv_val = c->cr_msg;