From: Howard Chu Date: Wed, 13 Feb 2008 07:37:29 +0000 (+0000) Subject: ITS#5376 must abandon current session before starting new refresh X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~148 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ec5a7a9576f9cacae2f89e3886da0151d358ddfb;p=openldap ITS#5376 must abandon current session before starting new refresh --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 65b86479be..71c88250ca 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -96,6 +96,7 @@ typedef struct syncinfo_s { int si_refreshDone; int si_syncdata; int si_logstate; + ber_int_t si_msgid; Avlnode *si_presentlist; LDAP *si_ld; Connection *si_conn; @@ -342,7 +343,6 @@ ldap_sync_search( BerElementBuffer berbuf; BerElement *ber = (BerElement *)&berbuf; LDAPControl c[2], *ctrls[3]; - ber_int_t msgid; int rc; int rhint; char *base; @@ -427,7 +427,7 @@ ldap_sync_search( } rc = ldap_search_ext( si->si_ld, base, scope, filter, attrs, attrsonly, - ctrls, NULL, NULL, si->si_slimit, &msgid ); + ctrls, NULL, NULL, si->si_slimit, &si->si_msgid ); ber_free_buf( ber ); return rc; } @@ -743,7 +743,7 @@ do_syncrep2( tout_p = NULL; } - while ( ( rc = ldap_result( si->si_ld, LDAP_RES_ANY, LDAP_MSG_ONE, + while ( ( rc = ldap_result( si->si_ld, si->si_msgid, LDAP_MSG_ONE, tout_p, &res ) ) > 0 ) { if ( slapd_shutdown ) { @@ -836,6 +836,7 @@ do_syncrep2( } else if ( rc == LDAP_NO_SUCH_OBJECT ) { rc = LDAP_SYNC_REFRESH_REQUIRED; si->si_logstate = SYNCLOG_FALLBACK; + ldap_abandon_ext( si->si_ld, si->si_msgid, NULL, NULL ); } } else if ( ( rc = syncrepl_message_to_entry( si, op, msg, &modlist, &entry, syncstate ) ) == LDAP_SUCCESS )