ctrls[1] = NULL;
csns[0] = opc->sctxcsn;
BER_BVZERO( &csns[1] );
- slap_compose_sync_cookie( op, &cookie, csns, so->s_rid, slap_serverID );
+ slap_compose_sync_cookie( op, &cookie, csns, so->s_rid, slap_serverID ? slap_serverID : -1 );
Debug( LDAP_DEBUG_SYNC, "syncprov_sendresp: cookie=%s\n", cookie.bv_val, 0, 0 );
syncprov_info_t *si = opc->son->on_bi.bi_private;
slap_compose_sync_cookie( NULL, &cookie, si->si_ctxcsn,
- so->s_rid, slap_serverID);
+ so->s_rid, slap_serverID ? slap_serverID : -1);
}
srsize = sizeof(syncres) + opc->suuid.bv_len + 1 +
continue;
/* Don't send ops back to the originator */
- if ( opc->ssid && opc->ssid == ss->s_sid ) {
+ if ( opc->ssid > 0 && opc->ssid == ss->s_sid ) {
Debug( LDAP_DEBUG_SYNC, "syncprov_matchops: skipping original sid %03x\n",
opc->ssid, 0, 0 );
continue;
}
/* Don't send ops back to the messenger */
- if ( scook && scook->sid && scook->sid == ss->s_sid ) {
+ if ( scook && scook->sid > 0 && scook->sid == ss->s_sid ) {
Debug( LDAP_DEBUG_SYNC, "syncprov_matchops: skipping relayed sid %03x\n",
scook->sid, 0, 0 );
continue;
if ( delcsn[0].bv_len ) {
slap_compose_sync_cookie( op, &cookie, delcsn, srs->sr_state.rid,
- slap_serverID );
+ slap_serverID ? slap_serverID : -1 );
Debug( LDAP_DEBUG_SYNC, "syncprov_playlog: cookie=%s\n", cookie.bv_val, 0, 0 );
}
/* If we're in delta-sync mode, always send a cookie */
if ( si->si_nopres && si->si_usehint && a ) {
struct berval cookie;
- slap_compose_sync_cookie( op, &cookie, a->a_nvals, srs->sr_state.rid, slap_serverID );
+ slap_compose_sync_cookie( op, &cookie, a->a_nvals, srs->sr_state.rid, slap_serverID ? slap_serverID : -1 );
rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
LDAP_SYNC_ADD, rs->sr_ctrls, 0, 1, &cookie );
} else {
if ( ss->ss_flags & SS_CHANGED ) {
slap_compose_sync_cookie( op, &cookie, ss->ss_ctxcsn,
- srs->sr_state.rid, slap_serverID );
+ srs->sr_state.rid, slap_serverID ? slap_serverID : -1 );
Debug( LDAP_DEBUG_SYNC, "syncprov_search_response: cookie=%s\n", cookie.bv_val, 0, 0 );
}