]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/overlays/accesslog.c
ITS#8100 fixes for delta-syncrepl with empty accesslog
[openldap] / servers / slapd / overlays / accesslog.c
index 53369b32c54c1553f92419319907783450d49e54..faa94d49693eff2a8d1d1b23024300e8c7ec2fdd 100644 (file)
@@ -1943,7 +1943,7 @@ accesslog_mod_cleanup( Operation *op, SlapReply *rs )
 
        op->o_tmpfree( sc, op->o_tmpmemctx );
 
-       if ( on ) {
+       if ( on && rs->sr_err != LDAP_SUCCESS ) {
                BackendInfo *bi = op->o_bd->bd_info;
                op->o_bd->bd_info = (BackendInfo *)on;
                accesslog_response( op, rs );
@@ -1994,11 +1994,11 @@ accesslog_op_mod( Operation *op, SlapReply *rs )
        }
                        
        if ( doit ) {
-               slap_callback *cb = op->o_tmpcalloc( 1, sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
+               slap_callback *cb = op->o_tmpcalloc( 1, sizeof( slap_callback ), op->o_tmpmemctx );
                cb->sc_cleanup = accesslog_mod_cleanup;
                cb->sc_private = on;
-               for ( cb2 = op->o_callback; cb2->sc_next; cb2 = cb2->sc_next );
-               cb2->sc_next = cb;
+               cb->sc_next = op->o_callback;
+               op->o_callback = cb;
 
 #ifdef RMUTEX_DEBUG
                Debug( LDAP_DEBUG_SYNC,
@@ -2298,6 +2298,7 @@ accesslog_db_root(
                db = *li->li_db;
                op->o_bd = &db;
 
+               op->o_tag = LDAP_REQ_ADD;
                op->ora_e = e;
                op->o_req_dn = e->e_name;
                op->o_req_ndn = e->e_nname;