mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
Avoid gratuitous reindexing of cn and objectclass in syncrepl_updateCookie
This commit is contained in:
parent
5c1c0902b4
commit
559b746437
@ -1762,6 +1762,17 @@ syncrepl_updateCookie(
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
|
||||
mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ));
|
||||
mod->sml_op = LDAP_MOD_REPLACE;
|
||||
mod->sml_desc = slap_schema.si_ad_subtreeSpecification;
|
||||
mod->sml_type = mod->sml_desc->ad_cname;
|
||||
mod->sml_values = ssbva;
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
|
||||
/* Keep this last, so we can avoid touching the previous
|
||||
* attributes unnecessarily.
|
||||
*/
|
||||
if ( scbva[0].bv_val ) ch_free( scbva[0].bv_val );
|
||||
ber_dupbv( &scbva[0], &si->si_syncCookie.octet_str[0] );
|
||||
mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ));
|
||||
@ -1772,14 +1783,6 @@ syncrepl_updateCookie(
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
|
||||
mod = (Modifications *) ch_calloc( 1, sizeof( Modifications ));
|
||||
mod->sml_op = LDAP_MOD_REPLACE;
|
||||
mod->sml_desc = slap_schema.si_ad_subtreeSpecification;
|
||||
mod->sml_type = mod->sml_desc->ad_cname;
|
||||
mod->sml_values = ssbva;
|
||||
*modtail = mod;
|
||||
modtail = &mod->sml_next;
|
||||
|
||||
mlnext = mod;
|
||||
|
||||
op->o_tag = LDAP_REQ_ADD;
|
||||
@ -1841,7 +1844,8 @@ syncrepl_updateCookie(
|
||||
/* update persistent cookie */
|
||||
update_cookie_retry:
|
||||
op->o_tag = LDAP_REQ_MODIFY;
|
||||
op->orm_modlist = modlist;
|
||||
/* Just modify the cookie value, not the entire entry */
|
||||
op->orm_modlist = mod;
|
||||
rc = be->be_modify( op, &rs_modify );
|
||||
|
||||
if ( rs_modify.sr_err != LDAP_SUCCESS ) {
|
||||
|
Loading…
Reference in New Issue
Block a user