X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fldapsync.c;h=b1a87f9cc9cc01277c139b406fa42ea77f465645;hb=e162551e0eb67e6d2958874e00564eba31ea5bb2;hp=bf20388477734109169b3484df70db46184dc068;hpb=55339651d6d6e21dc85dca7949cb094e57a1f6b2;p=openldap diff --git a/servers/slapd/ldapsync.c b/servers/slapd/ldapsync.c index bf20388477..b1a87f9cc9 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-2012 The OpenLDAP Foundation. + * Copyright 2003-2014 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