]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9534,#9324 fix refresh startup
authorHoward Chu <hyc@openldap.org>
Thu, 13 May 2021 17:29:22 +0000 (18:29 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 13 May 2021 17:29:22 +0000 (18:29 +0100)
Partially revert 5aa7e0f69b0f1ef9aff5016fa6b40c2a2dd7d38d
Use an explicit timeout for Refresh response. Need to give time
for the provider to reply.

servers/slapd/syncrepl.c

index 88fe16fdffa2493fbe860cc1018ede7f7810c155..59f49d3e88e0f5fbfa9028fd2162a850f8980d8a 100644 (file)
@@ -1247,6 +1247,13 @@ do_syncrep2(
 
        slap_dup_sync_cookie( &syncCookie_req, &si->si_syncCookie );
 
+       if ( abs(si->si_type) == LDAP_SYNC_REFRESH_AND_PERSIST && si->si_refreshDone ) {
+               tout.tv_sec = 0;
+       } else {
+               /* Give some time for refresh response to arrive */
+               tout.tv_sec = si->si_bindconf.sb_timeout_api;
+       }
+
        while ( ( rc = ldap_result( si->si_ld, si->si_msgid, LDAP_MSG_ONE,
                &tout, &msg ) ) > 0 )
        {