Commit 54e542ad authored by Howard Chu's avatar Howard Chu
Browse files

ITS#5231 from HEAD

parent 424b85d7
...@@ -80,6 +80,7 @@ typedef struct syncinfo_s { ...@@ -80,6 +80,7 @@ typedef struct syncinfo_s {
int si_tlimit; int si_tlimit;
int si_refreshDelete; int si_refreshDelete;
int si_refreshPresent; int si_refreshPresent;
int si_refreshDone;
int si_syncdata; int si_syncdata;
int si_logstate; int si_logstate;
int si_conn_setup; int si_conn_setup;
...@@ -584,6 +585,8 @@ do_syncrep1( ...@@ -584,6 +585,8 @@ do_syncrep1(
&si->si_syncCookie.ctxcsn, si->si_syncCookie.rid ); &si->si_syncCookie.ctxcsn, si->si_syncCookie.rid );
} }
si->si_refreshDone = 0;
rc = ldap_sync_search( si, op->o_tmpmemctx ); rc = ldap_sync_search( si, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) { if( rc != LDAP_SUCCESS ) {
...@@ -643,7 +646,6 @@ do_syncrep2( ...@@ -643,7 +646,6 @@ do_syncrep2(
struct timeval tout = { 0, 0 }; struct timeval tout = { 0, 0 };
int refreshDeletes = 0; int refreshDeletes = 0;
int refreshDone = 1;
BerVarray syncUUIDs = NULL; BerVarray syncUUIDs = NULL;
ber_tag_t si_tag; ber_tag_t si_tag;
...@@ -874,10 +876,14 @@ do_syncrep2( ...@@ -874,10 +876,14 @@ do_syncrep2(
slap_parse_sync_cookie( &syncCookie, NULL ); slap_parse_sync_cookie( &syncCookie, NULL );
} }
} }
/* Defaults to TRUE */
if ( ber_peek_tag( ber, &len ) == if ( ber_peek_tag( ber, &len ) ==
LDAP_TAG_REFRESHDONE ) LDAP_TAG_REFRESHDONE )
{ {
ber_scanf( ber, "b", &refreshDone ); ber_scanf( ber, "b", &si->si_refreshDone );
} else
{
si->si_refreshDone = 1;
} }
ber_scanf( ber, /*"{"*/ "}" ); ber_scanf( ber, /*"{"*/ "}" );
break; break;
...@@ -1697,7 +1703,7 @@ syncrepl_entry( ...@@ -1697,7 +1703,7 @@ syncrepl_entry(
} }
if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD )) { if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD )) {
if ( !si->si_refreshPresent ) { if ( !si->si_refreshPresent && !si->si_refreshDone ) {
syncuuid_bv = ber_dupbv( NULL, syncUUID ); syncuuid_bv = ber_dupbv( NULL, syncUUID );
avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv, avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv,
syncuuid_cmp, avl_dup_error ); syncuuid_cmp, avl_dup_error );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment