X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fsyncrepl.c;h=836adf1ed65fc9e0a9d422bd5ded595a92c4fec0;hb=3b07d4144dc4581f27fd55e413ca479a854cae9b;hp=5fe320d99e33a660817dc14f0a22cc37f820d691;hpb=5249a1ed7ab917bac05fbae3982eba4903385d7b;p=openldap diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 5fe320d99e..836adf1ed6 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2013 The OpenLDAP Foundation. + * Copyright 2003-2014 The OpenLDAP Foundation. * Portions Copyright 2003 by IBM Corporation. * Portions Copyright 2003-2008 by Howard Chu, Symas Corporation. * All rights reserved. @@ -590,7 +590,8 @@ check_syncprov( slap_compose_sync_cookie( NULL, &si->si_syncCookie.octet_str, si->si_syncCookie.ctxcsn, si->si_syncCookie.rid, si->si_syncCookie.sid ); - slap_parse_sync_cookie( &si->si_syncCookie, NULL ); + ch_free( si->si_syncCookie.sids ); + slap_reparse_sync_cookie( &si->si_syncCookie, op->o_tmpmemctx ); } ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex ); return changed; @@ -1537,6 +1538,10 @@ reload: op->o_ndn = op->o_bd->be_rootndn; rc = do_syncrep2( op, si ); if ( rc == LDAP_SYNC_REFRESH_REQUIRED ) { + if ( BER_BVISNULL( &si->si_syncCookie.octet_str )) + slap_compose_sync_cookie( NULL, &si->si_syncCookie.octet_str, + si->si_syncCookie.ctxcsn, si->si_syncCookie.rid, + si->si_syncCookie.sid ); rc = ldap_sync_search( si, op->o_tmpmemctx ); goto reload; }