X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fldapsync.c;h=37b7ebd7f172d204caacb289de4de106fb02ef56;hb=bb62d9cb732c894023c5c9f5893acf40add7376c;hp=2c03ec7cb4a8d94bf705e84b3a980fb032b43462;hpb=2851b22315ee55fe149b39464addf6e24ada1063;p=openldap diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index 2c03ec7cb4..37b7ebd7f1 100644 --- a/servers/slapd/ldapsync.c +++ b/servers/slapd/ldapsync.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2013 The OpenLDAP Foundation. + * Copyright 2003-2017 The OpenLDAP Foundation. * Portions Copyright 2003 IBM Corporation. * All rights reserved. * @@ -370,6 +370,22 @@ slap_parse_sync_cookie( return 0; } +/* count the numcsns and regenerate the list of SIDs in a recomposed cookie */ +void +slap_reparse_sync_cookie( + struct sync_cookie *cookie, + void *memctx ) +{ + if ( cookie->ctxcsn ) { + for (; !BER_BVISNULL( &cookie->ctxcsn[cookie->numcsns] ); cookie->numcsns++); + } + if ( cookie->numcsns ) { + cookie->sids = slap_parse_csn_sids( cookie->ctxcsn, cookie->numcsns, NULL ); + if ( cookie->numcsns > 1 ) + slap_sort_csn_sids( cookie->ctxcsn, cookie->sids, cookie->numcsns, memctx ); + } +} + int slap_init_sync_cookie_ctxcsn( struct sync_cookie *cookie