From: Howard Chu Date: Wed, 4 Aug 2010 08:50:29 +0000 (+0000) Subject: Better fix - avoid allocating callback for non-logged mod ops X-Git-Tag: MIGRATION_CVS2GIT~533 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a8ffb6333110cec9c5f594752ca756099fd2b82e;p=openldap Better fix - avoid allocating callback for non-logged mod ops --- diff --git a/servers/slapd/overlays/accesslog.c b/servers/slapd/overlays/accesslog.c index a32b763207..4f4bbafafa 100644 --- a/servers/slapd/overlays/accesslog.c +++ b/servers/slapd/overlays/accesslog.c @@ -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;