More for prev commit

This commit is contained in:
Howard Chu 2009-03-13 00:26:24 +00:00
parent 011d1ca8bc
commit d03e5ad14e

View File

@ -783,7 +783,7 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so,
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 );
@ -982,7 +982,7 @@ syncprov_qresp( opcookie *opc, syncops *so, int mode )
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 +
@ -1176,14 +1176,14 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit )
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;
@ -1596,7 +1596,7 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl,
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 );
}
@ -2164,7 +2164,7 @@ syncprov_search_response( Operation *op, SlapReply *rs )
/* 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 {
@ -2176,7 +2176,7 @@ syncprov_search_response( Operation *op, SlapReply *rs )
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 );
}