From: Jong Hyuk Choi Date: Thu, 28 Oct 2004 21:40:42 +0000 (+0000) Subject: patch for ITS#3379 X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~385 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=42f8426b5b9766b9cdd7c8e3affef1e9c1940192;p=openldap patch for ITS#3379 --- diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 7e2c36f1ee..bb41efc677 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -1449,6 +1449,8 @@ typedef struct syncinfo_s { int si_slimit; int si_tlimit; struct berval si_syncUUID_ndn; + int si_refreshDelete; + int si_refreshPresent; Avlnode *si_presentlist; LDAP *si_ld; LDAP_LIST_HEAD(np, nonpresent_entry) si_nonpresentlist; diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 92d47240e0..cf11fa07e0 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -48,9 +48,6 @@ static int dn_callback( struct slap_op *, struct slap_rep * ); static int nonpresent_callback( struct slap_op *, struct slap_rep * ); static int null_callback( struct slap_op *, struct slap_rep * ); -static int si_refreshDelete = 0; -static int si_refreshPresent = 0; - static AttributeDescription *sync_descs[4]; struct runqueue_s syncrepl_rq; @@ -724,7 +721,7 @@ do_syncrep2( "do_syncrep2: %s - %s%s\n", "LDAP_RES_INTERMEDIATE", "REFRESH_DELETE\n", "\n" ); - si_refreshDelete = 1; + si->si_refreshDelete = 1; case LDAP_TAG_SYNC_REFRESH_PRESENT: Debug( LDAP_DEBUG_SYNC, "do_syncrep2: %s - %s%s\n", @@ -732,8 +729,8 @@ do_syncrep2( si_tag == LDAP_TAG_SYNC_REFRESH_PRESENT ? "REFRESH_PRESENT" : "REFRESH_DELETE", "\n" ); - si_refreshDelete = 1; - si_refreshPresent = 1; + si->si_refreshDelete = 1; + si->si_refreshPresent = 1; ber_scanf( ber, "t{" /*"}"*/, &tag ); if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) { @@ -824,7 +821,7 @@ do_syncrep2( syncrepl_updateCookie( si, op, psub, &syncCookie); } - if ( si_refreshPresent == 1 ) { + if ( si->si_refreshPresent == 1 ) { if ( match < 0 ) { syncrepl_del_nonpresent( op, si ); } @@ -942,8 +939,8 @@ do_syncrepl( /* Establish session, do search */ if ( !si->si_ld ) { first = 1; - si_refreshDelete = 0; - si_refreshPresent = 0; + si->si_refreshDelete = 0; + si->si_refreshPresent = 0; rc = do_syncrep1( &op, si ); } @@ -1223,7 +1220,7 @@ syncrepl_entry( } if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD )) { - if ( !si_refreshPresent ) { + if ( !si->si_refreshPresent ) { syncuuid_bv = ber_dupbv( NULL, syncUUID ); avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv, syncuuid_cmp, avl_dup_error );