From 3b07d4144dc4581f27fd55e413ca479a854cae9b Mon Sep 17 00:00:00 2001
From: Howard Chu <hyc@openldap.org>
Date: Fri, 23 May 2014 06:56:56 -0700
Subject: [PATCH] ITS#7849 make sure to send cookie after fallback

---
 servers/slapd/syncrepl.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c
index 9b5c0f3fa9..836adf1ed6 100644
--- a/servers/slapd/syncrepl.c
+++ b/servers/slapd/syncrepl.c
@@ -1538,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;
 		}
-- 
GitLab