ITS#5376 must abandon current session before starting new refresh

This commit is contained in:
Howard Chu 2008-02-13 07:37:29 +00:00
parent 509620e90a
commit ec5a7a9576

View File

@ -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 )