]> git.sur5r.net Git - openldap/commitdiff
ITS#5493
authorQuanah Gibson-Mount <quanah@openldap.org>
Fri, 9 May 2008 21:04:16 +0000 (21:04 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 9 May 2008 21:04:16 +0000 (21:04 +0000)
CHANGES
servers/slapd/overlays/syncprov.c

diff --git a/CHANGES b/CHANGES
index 3d30ef12827e3fdbcf9d16da108005e2f6fa1de0..ffec58a7d0f48d5c0c406b74440633036ed7316d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -8,6 +8,7 @@ OpenLDAP 2.3.42 Engineering
        Fixed slapd pagedresults stale state (ITS#5409)
        Fixed slapd-ldap connection handler (ITS#5404)
        Fixed slapo-accesslog null callback stack crash (ITS#5490)
+       Fixed slapo-syncprov csn update with delta-syncrepl (ITS#5493)
 
 OpenLDAP 2.3.41 Release (2008/02/19)
        Fixed slapd timestamp race condition (ITS#5370)
index ccd8290a2df393672573c7853526bdc5b16a2603..e44b834f5f9787123268ceecb30b9f0165795649 100644 (file)
@@ -1856,6 +1856,7 @@ syncprov_search_response( Operation *op, SlapReply *rs )
 {
        searchstate *ss = op->o_callback->sc_private;
        slap_overinst *on = ss->ss_on;
+       syncprov_info_t *si = (syncprov_info_t *)on->on_bi.bi_private;
        sync_control *srs = op->o_controls[slap_cids.sc_LDAPsync];
 
        if ( rs->sr_type == REP_SEARCH || rs->sr_type == REP_SEARCHREF ) {
@@ -1898,8 +1899,16 @@ syncprov_search_response( Operation *op, SlapReply *rs )
                rs->sr_ctrls = op->o_tmpalloc( sizeof(LDAPControl *)*2,
                        op->o_tmpmemctx );
                rs->sr_ctrls[1] = NULL;
-               rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
-                       LDAP_SYNC_ADD, rs->sr_ctrls, 0, 0, NULL );
+               /* If we're in delta-sync mode, always send a cookie */
+               if ( si->si_nopres && si->si_usehint && a ) {
+                       struct berval cookie;
+                       slap_compose_sync_cookie( op, &cookie, a->a_nvals, srs->sr_state.rid );
+                       rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
+                               LDAP_SYNC_ADD, rs->sr_ctrls, 0, 1, &cookie );
+               } else {
+                       rs->sr_err = syncprov_state_ctrl( op, rs, rs->sr_entry,
+                               LDAP_SYNC_ADD, rs->sr_ctrls, 0, 0, NULL );
+               }
        } else if ( rs->sr_type == REP_RESULT && rs->sr_err == LDAP_SUCCESS ) {
                struct berval cookie;