]> git.sur5r.net Git - openldap/commitdiff
Better fix - avoid allocating callback for non-logged mod ops
authorHoward Chu <hyc@openldap.org>
Wed, 4 Aug 2010 08:50:29 +0000 (08:50 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 4 Aug 2010 08:50:29 +0000 (08:50 +0000)
servers/slapd/overlays/accesslog.c

index a32b763207082f16f401ccda7b21035e93e55f83..4f4bbafafa9341e7daa34299098d4616508d1462 100644 (file)
@@ -1377,6 +1377,11 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
 
        if ( lo->mask & LOG_OP_WRITES ) {
                slap_callback *cb;
+
+               /* These internal ops are not logged */
+               if ( op->o_dont_replicate && op->orm_no_opattrs )
+                       return SLAP_CB_CONTINUE;
+
                ldap_pvt_thread_mutex_lock( &li->li_log_mutex );
                old = li->li_old;
                li->li_old = NULL;
@@ -1388,8 +1393,6 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
                        }
                }
                ldap_pvt_thread_rmutex_unlock( &li->li_op_rmutex, op->o_tid );
-               if ( op->o_dont_replicate && op->orm_no_opattrs )
-                       goto done;
        }
 
        if ( li->li_success && rs->sr_err != LDAP_SUCCESS )
@@ -1760,6 +1763,10 @@ accesslog_op_mod( Operation *op, SlapReply *rs )
        slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
        log_info *li = on->on_bi.bi_private;
 
+       /* These internal ops are not logged */
+       if ( op->o_dont_replicate && op->orm_no_opattrs )
+               return SLAP_CB_CONTINUE;
+
        if ( li->li_ops & LOG_OP_WRITES ) {
                slap_callback *cb = op->o_tmpalloc( sizeof( slap_callback ), op->o_tmpmemctx ), *cb2;
                cb->sc_cleanup = accesslog_mod_cleanup;