mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-31 12:09:35 -05:00
ITS#5988 don't respond if consumer's state is newer than ours
This commit is contained in:
parent
43b23ce31c
commit
2f14098a9b
1 changed files with 11 additions and 2 deletions
|
|
@ -2377,13 +2377,22 @@ syncprov_op_search( Operation *op, SlapReply *rs )
|
|||
|
||||
/* If nothing has changed, shortcut it */
|
||||
if ( srs->sr_state.numcsns == numcsns ) {
|
||||
int i, j;
|
||||
int i, j, newer;
|
||||
for ( i=0; i<srs->sr_state.numcsns; i++ ) {
|
||||
for ( j=0; j<numcsns; j++ ) {
|
||||
if ( srs->sr_state.sids[i] != sids[j] )
|
||||
continue;
|
||||
if ( !bvmatch( &srs->sr_state.ctxcsn[i], &ctxcsn[j] ))
|
||||
newer = ber_bvcmp( &srs->sr_state.ctxcsn[i], &ctxcsn[j] );
|
||||
/* If our state is newer, tell consumer about changes */
|
||||
if ( newer < 0 )
|
||||
changed = SS_CHANGED;
|
||||
else if ( newer > 0 ) {
|
||||
/* our state is older, tell consumer nothing */
|
||||
rs->sr_err = LDAP_SUCCESS;
|
||||
rs->sr_ctrls = NULL;
|
||||
send_ldap_result( op, rs );
|
||||
return rs->sr_err;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if ( changed )
|
||||
|
|
|
|||
Loading…
Reference in a new issue