mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
in updateCookie, no-op if nothing changed
This commit is contained in:
parent
9992d5c43a
commit
75d1e515ee
@ -3025,7 +3025,7 @@ syncrepl_updateCookie(
|
||||
Syntax *syn = slap_schema.si_ad_contextCSN->ad_type->sat_syntax;
|
||||
#endif
|
||||
|
||||
int rc, i, j;
|
||||
int rc, i, j, changed = 0;
|
||||
ber_len_t len;
|
||||
|
||||
slap_callback cb = { NULL };
|
||||
@ -3067,6 +3067,7 @@ syncrepl_updateCookie(
|
||||
if ( memcmp( syncCookie->ctxcsn[i].bv_val,
|
||||
si->si_cookieState->cs_vals[j].bv_val, len ) > 0 ) {
|
||||
mod.sml_values[j] = syncCookie->ctxcsn[i];
|
||||
changed = 1;
|
||||
if ( BER_BVISNULL( &first ) ) {
|
||||
first = syncCookie->ctxcsn[i];
|
||||
|
||||
@ -3089,10 +3090,11 @@ syncrepl_updateCookie(
|
||||
{
|
||||
first = syncCookie->ctxcsn[i];
|
||||
}
|
||||
changed = 1;
|
||||
}
|
||||
}
|
||||
/* Should never happen, ITS#5065 */
|
||||
if ( BER_BVISNULL( &first )) {
|
||||
if ( BER_BVISNULL( &first ) || !changed ) {
|
||||
ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
|
||||
op->o_tmpfree( mod.sml_values, op->o_tmpmemctx );
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user