X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fback-monitor%2Foperation.c;h=f7aa7c6483309e4ab9773acce631a519a88c3181;hb=63e843d2003ddf20f3725ad439991e769ffc792a;hp=f071bb0d6157b18d821caab0e064057caff3f346;hpb=5fe42e8853873682383ca2fd4a33c2644b8e6597;p=openldap diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index f071bb0d61..f7aa7c6483 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -45,11 +45,21 @@ struct monitor_ops_t { { BER_BVNULL, BER_BVNULL } }; +static int +monitor_subsys_ops_destroy( + BackendDB *be, + monitor_subsys_t *ms ); + +static int +monitor_subsys_ops_update( + Operation *op, + SlapReply *rs, + Entry *e ); + int monitor_subsys_ops_init( BackendDB *be, - monitor_subsys_t *ms -) + monitor_subsys_t *ms ) { monitor_info_t *mi; @@ -61,6 +71,9 @@ monitor_subsys_ops_init( assert( be != NULL ); + ms->mss_destroy = monitor_subsys_ops_destroy; + ms->mss_update = monitor_subsys_ops_update; + mi = ( monitor_info_t * )be->be_private; if ( monitor_cache_get( mi, @@ -152,11 +165,27 @@ monitor_subsys_ops_init( return( 0 ); } -int +static int +monitor_subsys_ops_destroy( + BackendDB *be, + monitor_subsys_t *ms ) +{ + int i; + + for ( i = 0; i < SLAP_OP_LAST; i++ ) { + if ( !BER_BVISNULL( &monitor_op[ i ].nrdn ) ) { + ch_free( monitor_op[ i ].nrdn.bv_val ); + } + } + + return 0; +} + +static int monitor_subsys_ops_update( Operation *op, - Entry *e -) + SlapReply *rs, + Entry *e ) { monitor_info_t *mi = ( monitor_info_t * )op->o_bd->be_private; @@ -167,8 +196,8 @@ monitor_subsys_ops_update( Attribute *a; static struct berval bv_ops = BER_BVC( "cn=operations" ); - assert( mi ); - assert( e ); + assert( mi != NULL ); + assert( e != NULL ); dnRdn( &e->e_nname, &rdn ); @@ -217,6 +246,6 @@ monitor_subsys_ops_update( /* FIXME: touch modifyTimestamp? */ - return( 0 ); + return SLAP_CB_CONTINUE; }