BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_backend_init,
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
NULL /* modify */
BER_BVNULL },
MONITOR_F_VOLATILE_CH,
monitor_subsys_conn_init,
- monitor_subsys_conn_update,
- monitor_subsys_conn_create,
+ NULL, /* destroy */
+ NULL, /* update */
+ NULL, /* create */
NULL /* modify */
}, {
SLAPD_MONITOR_DATABASE_NAME,
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_database_init,
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
- monitor_subsys_database_modify
+ NULL /* modify */
}, {
SLAPD_MONITOR_LISTENER_NAME,
BER_BVNULL, BER_BVNULL, BER_BVNULL,
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_listener_init,
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
NULL /* modify */
BER_BVNULL },
MONITOR_F_NONE,
monitor_subsys_log_init,
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
- monitor_subsys_log_modify
+ NULL, /* modify */
}, {
SLAPD_MONITOR_OPS_NAME,
BER_BVNULL, BER_BVNULL, BER_BVNULL,
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_ops_init,
- monitor_subsys_ops_update,
+ NULL, /* destroy */
+ NULL, /* update */
NULL, /* create */
NULL, /* modify */
}, {
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_overlay_init,
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
NULL, /* modify */
BER_BVNULL },
MONITOR_F_NONE,
NULL, /* init */
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
NULL /* modify */
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_sent_init,
- monitor_subsys_sent_update,
+ NULL, /* destroy */
+ NULL, /* update */
NULL, /* create */
NULL, /* modify */
}, {
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_thread_init,
- monitor_subsys_thread_update,
+ NULL, /* destroy */
+ NULL, /* update */
NULL, /* create */
NULL /* modify */
}, {
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_time_init,
- monitor_subsys_time_update,
+ NULL, /* destroy */
+ NULL, /* update */
NULL, /* create */
NULL, /* modify */
}, {
BER_BVNULL },
MONITOR_F_NONE,
NULL, /* init */
+ NULL, /* destroy */
NULL, /* update */
NULL, /* create */
NULL /* modify */
BER_BVNULL },
MONITOR_F_PERSISTENT_CH,
monitor_subsys_rww_init,
- monitor_subsys_rww_update,
+ NULL, /* destroy */
+ NULL, /* update */
NULL, /* create */
NULL /* modify */
}, { NULL }
monitor_back_db_init(
BackendDB *be )
{
- monitor_info_t *mi;
int rc;
struct berval dn, ndn;
struct berval bv;
rc = dnNormalize( 0, NULL, NULL, &dn, &ndn, NULL );
if( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY,
- "unable to normalize monitor DN \"%s\"\n",
- SLAPD_MONITOR_DN, 0, 0 );
+ "unable to normalize monitor DN \"%s\" (%d)\n",
+ dn.bv_val, rc, 0 );
return -1;
}
/* NOTE: only one monitor database is allowed,
* so we use static storage */
- mi = &monitor_info;
+ ldap_pvt_thread_mutex_init( &monitor_info.mi_cache_mutex );
- ldap_pvt_thread_mutex_init( &mi->mi_cache_mutex );
-
- be->be_private = mi;
+ be->be_private = &monitor_info;
return 0;
}
{
monitor_info_t *mi = ( monitor_info_t * )be->be_private;
+ if ( mi == NULL ) {
+ return -1;
+ }
+
/*
* FIXME: destroys all the data
*/
(void)monitor_cache_destroy( mi );
if ( monitor_subsys ) {
+ int i;
+
+ for ( i = 0; monitor_subsys[ i ] != NULL; i++ ) {
+ if ( monitor_subsys[ i ]->mss_destroy ) {
+ monitor_subsys[ i ]->mss_destroy( be, monitor_subsys[ i ] );
+ }
+
+ if ( !BER_BVISNULL( &monitor_subsys[ i ]->mss_rdn ) ) {
+ ch_free( monitor_subsys[ i ]->mss_rdn.bv_val );
+ }
+ }
+
ch_free( monitor_subsys );
}
+ ldap_pvt_thread_mutex_destroy( &monitor_info.mi_cache_mutex );
+
+ be->be_private = NULL;
+
return 0;
}