assert( ndn != NULL );
assert( ep != NULL );
+ *ep = NULL;
+
tmp_mc.mc_ndn = *ndn;
ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex );
mc = ( monitor_cache_t * )avl_find( mi->mi_cache,
if ( mc != NULL ) {
/* entry is returned with mutex locked */
monitor_cache_lock( mc->mc_e );
- ldap_pvt_thread_mutex_unlock( &mi->mi_cache_mutex );
*ep = mc->mc_e;
-
- return( 0 );
}
-
+
ldap_pvt_thread_mutex_unlock( &mi->mi_cache_mutex );
- *ep = NULL;
- return( -1 );
+ return ( *ep == NULL ? -1 : 0 );
}
/*
mp = ( monitor_entry_t * )mc->mc_e->e_private;
if ( mp->mp_cb ) {
- /* TODO */
+ if ( mp->mp_cb->mc_free ) {
+ mp->mp_cb->mc_free( mc->mc_e,
+ mp->mp_cb->mc_private );
+ }
+ ch_free( mp->mp_cb );
}
ldap_pvt_thread_mutex_destroy( &mp->mp_mutex );