]> git.sur5r.net Git - openldap/commitdiff
ITS#5231
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 15 Nov 2007 01:45:15 +0000 (01:45 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 15 Nov 2007 01:45:15 +0000 (01:45 +0000)
CHANGES
servers/slapd/syncrepl.c

diff --git a/CHANGES b/CHANGES
index bd6790295ad88805d1e453c61ca06d84df7b2c6c..67fb971ed6e4c0081b8588a9ff44b1814ccaa8a2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,7 @@ OpenLDAP 2.4.7 Engineering
        Fixed slapd multiple sufix checking (ITS#5186)
        Fixed slapd contextCSN updating from old releases (ITS#5225)
        Fixed slapd paged results handling when using rootdn (ITS#5230)
+       Fixed slapd syncrepl presentlist handling (ITS#5231)
        Fixed slapo-ppolicy single password check on modify (ITS#5146)
        Fixed slapo-syncprov refresh and persist cookie sending (ITS#5210)
        Fixed slapo-syncprov ignore invalid cookies (ITS#5211)
index 4f0d7cfca35a2f13ed85e86284d52607ee989462..085e59f12d6d891ffa534f75a2891b2ff4ce3006 100644 (file)
@@ -93,6 +93,7 @@ typedef struct syncinfo_s {
        int                     si_tlimit;
        int                     si_refreshDelete;
        int                     si_refreshPresent;
+       int                     si_refreshDone;
        int                     si_syncdata;
        int                     si_logstate;
        int                     si_conn_setup;
@@ -628,6 +629,8 @@ do_syncrep1(
                ldap_pvt_thread_mutex_unlock( &si->si_cookieState->cs_mutex );
        }
 
+       si->si_refreshDone = 0;
+
        rc = ldap_sync_search( si, op->o_tmpmemctx );
 
        if( rc != LDAP_SUCCESS ) {
@@ -716,7 +719,6 @@ do_syncrep2(
        struct timeval tout = { 0, 0 };
 
        int             refreshDeletes = 0;
-       int             refreshDone = 1;
        BerVarray syncUUIDs = NULL;
        ber_tag_t si_tag;
 
@@ -973,10 +975,14 @@ do_syncrep2(
                                                                slap_parse_sync_cookie( &syncCookie, NULL );
                                                        }
                                                }
+                                               /* Defaults to TRUE */
                                                if ( ber_peek_tag( ber, &len ) ==
                                                        LDAP_TAG_REFRESHDONE )
                                                {
-                                                       ber_scanf( ber, "b", &refreshDone );
+                                                       ber_scanf( ber, "b", &si->si_refreshDone );
+                                               } else
+                                               {
+                                                       si->si_refreshDone = 1;
                                                }
                                                ber_scanf( ber, /*"{"*/ "}" );
                                                break;
@@ -1888,7 +1894,7 @@ syncrepl_entry(
                si->si_ridtxt, syncrepl_state2str( syncstate ), 0 );
 
        if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD ) ) {
-               if ( !si->si_refreshPresent ) {
+               if ( !si->si_refreshPresent && !si->si_refreshDone ) {
                        syncuuid_inserted = avl_presentlist_insert( si, syncUUID );
                }
        }