Lines Matching refs:mi
201 meta_back_print_conntree( metainfo_t *mi, char *msg ) in meta_back_print_conntree() argument
211 fprintf( stderr, " %s[%d]\n", priv2str[ c ], mi->mi_conn_priv[ c ].mic_num ); in meta_back_print_conntree()
213 LDAP_TAILQ_FOREACH( mc, &mi->mi_conn_priv[ c ].mic_priv, mc_q ) in meta_back_print_conntree()
221 if ( mi->mi_conninfo.lai_tree == NULL ) { in meta_back_print_conntree()
225 meta_back_ravl_print( mi->mi_conninfo.lai_tree, 0 ); in meta_back_print_conntree()
244 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in metaconn_alloc() local
246 int ntargets = mi->mi_ntargets; in metaconn_alloc()
257 mc->mc_info = mi; in metaconn_alloc()
280 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in meta_back_init_one_conn() local
281 metatarget_t *mt = mi->mi_targets[ candidate ]; in meta_back_init_one_conn()
332 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_init_one_conn()
348 if ( !LDAP_BACK_USE_TEMPORARIES( mi ) ) { in meta_back_init_one_conn()
350 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_init_one_conn()
375 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_init_one_conn()
493 if ( mi->mi_idle_timeout != 0 && msc->msc_time < op->o_time ) { in meta_back_init_one_conn()
666 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_init_one_conn()
677 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_init_one_conn()
709 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in meta_back_retry() local
710 metatarget_t *mt = mi->mi_targets[ candidate ]; in meta_back_retry()
717 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_retry()
820 if ( META_BACK_ONERR_STOP( mi ) ) { in meta_back_retry()
821 meta_back_release_conn_lock( mi, mc, 0 ); in meta_back_retry()
826 meta_back_print_conntree( mi, ">>> meta_back_retry" ); in meta_back_retry()
833 assert( mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num > 0 ); in meta_back_retry()
834 LDAP_TAILQ_REMOVE( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, in meta_back_retry()
836 mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num--; in meta_back_retry()
845 (void)ldap_tavl_delete( &mi->mi_conninfo.lai_tree, in meta_back_retry()
851 meta_back_print_conntree( mi, "<<< meta_back_retry" ); in meta_back_retry()
867 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_retry()
903 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in meta_back_get_candidate() local
910 candidate = meta_back_select_unique_candidate( mi, ndn ); in meta_back_get_candidate()
957 if ( mi->mi_defaulttarget != META_DEFAULT_TARGET_NONE in meta_back_get_candidate()
958 && meta_back_is_candidate( mi->mi_targets[ mi->mi_defaulttarget ], in meta_back_get_candidate()
961 candidate = mi->mi_defaulttarget; in meta_back_get_candidate()
995 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in meta_back_candidates_get() local
1006 mc = mi->mi_candidates; in meta_back_candidates_get()
1011 mc->mc_ntargets = mi->mi_ntargets; in meta_back_candidates_get()
1023 mi->mi_candidates = mc; in meta_back_candidates_get()
1026 } else if ( mc->mc_ntargets < mi->mi_ntargets ) { in meta_back_candidates_get()
1030 sizeof( SlapReply ) * mi->mi_ntargets ); in meta_back_candidates_get()
1032 sizeof( SlapReply ) * ( mi->mi_ntargets - mc->mc_ntargets ) ); in meta_back_candidates_get()
1033 mc->mc_ntargets = mi->mi_ntargets; in meta_back_candidates_get()
1079 metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private; in meta_back_getconn() local
1101 if ( ( !BER_BVISEMPTY( &op->o_ndn ) && META_BACK_PROXYAUTHZ_ALWAYS( mi ) ) in meta_back_getconn()
1102 || ( BER_BVISEMPTY( &op->o_ndn ) && META_BACK_PROXYAUTHZ_ANON( mi ) ) in meta_back_getconn()
1109 } else if ( BER_BVISEMPTY( &op->o_ndn ) && META_BACK_PROXYAUTHZ_NOANON( mi ) ) in meta_back_getconn()
1138 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1142 &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( &mc_curr ) ].mic_priv, in meta_back_getconn()
1152 if ( mc != LDAP_TAILQ_LAST( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, in meta_back_getconn()
1155 LDAP_TAILQ_REMOVE( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, in meta_back_getconn()
1158 LDAP_TAILQ_INSERT_TAIL( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, in meta_back_getconn()
1162 } else if ( !LDAP_BACK_USE_TEMPORARIES( mi ) in meta_back_getconn()
1163 && mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( &mc_curr ) ].mic_num == mi->mi_conn_priv_max ) in meta_back_getconn()
1165 mc = LDAP_TAILQ_FIRST( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( &mc_curr ) ].mic_priv ); in meta_back_getconn()
1170 mc = (metaconn_t *)ldap_tavl_find( mi->mi_conninfo.lai_tree, in meta_back_getconn()
1181 if ( !LDAP_BACK_USE_TEMPORARIES( mi ) ) { in meta_back_getconn()
1182 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1192 …if ( mc->mc_refcnt == 0 && (( mi->mi_conn_ttl != 0 && op->o_time > mc->mc_create_time + mi->mi_con… in meta_back_getconn()
1193 || ( mi->mi_idle_timeout != 0 && op->o_time > mc->mc_time + mi->mi_idle_timeout )) ) in meta_back_getconn()
1196 meta_back_print_conntree( mi, in meta_back_getconn()
1204 assert( mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num > 0 ); in meta_back_getconn()
1205 LDAP_TAILQ_REMOVE( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, in meta_back_getconn()
1207 mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num--; in meta_back_getconn()
1215 (void)ldap_tavl_delete( &mi->mi_conninfo.lai_tree, in meta_back_getconn()
1220 meta_back_print_conntree( mi, in meta_back_getconn()
1228 mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) ); in meta_back_getconn()
1239 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1310 for ( i = 0; i < mi->mi_ntargets; i++ ) { in meta_back_getconn()
1344 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1367 if ( mi->mi_cache.ttl != META_DNCACHE_DISABLED ) { in meta_back_getconn()
1368 cached = i = meta_dncache_get_target( &mi->mi_cache, &op->o_req_ndn ); in meta_back_getconn()
1377 for ( j = 0; j < mi->mi_ntargets; j++ ) { in meta_back_getconn()
1394 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1412 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1434 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1435 mc = (metaconn_t *)ldap_tavl_find( mi->mi_conninfo.lai_tree, in meta_back_getconn()
1445 if ( !LDAP_BACK_USE_TEMPORARIES( mi ) ) { in meta_back_getconn()
1446 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1457 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1484 mt = mi->mi_targets[ i ]; in meta_back_getconn()
1506 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1543 for ( i = 0; i < mi->mi_ntargets; i++ ) { in meta_back_getconn()
1544 metatarget_t *mt = mi->mi_targets[ i ]; in meta_back_getconn()
1568 } else if ( lerr == LDAP_UNAVAILABLE && !META_BACK_ONERR_STOP( mi ) ) { in meta_back_getconn()
1597 if ( META_BACK_ONERR_STOP( mi ) ) { in meta_back_getconn()
1606 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1628 meta_back_release_conn( mi, mc ); in meta_back_getconn()
1654 if ( mi->mi_idle_timeout != 0 ) { in meta_back_getconn()
1659 if ( mi->mi_conn_ttl ) { in meta_back_getconn()
1666 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1668 meta_back_print_conntree( mi, ">>> meta_back_getconn" ); in meta_back_getconn()
1673 if ( mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num < mi->mi_conn_priv_max ) { in meta_back_getconn()
1674 LDAP_TAILQ_INSERT_TAIL( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, mc, mc_q ); in meta_back_getconn()
1675 mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num++; in meta_back_getconn()
1684 err = ldap_tavl_insert( &mi->mi_conninfo.lai_tree, ( caddr_t )mc, in meta_back_getconn()
1690 meta_back_print_conntree( mi, "<<< meta_back_getconn" ); in meta_back_getconn()
1692 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_getconn()
1705 if ( !( sendok & LDAP_BACK_BINDING ) && !LDAP_BACK_USE_TEMPORARIES( mi ) ) { in meta_back_getconn()
1720 mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) ); in meta_back_getconn()
1741 mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) ); in meta_back_getconn()
1751 mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) ); in meta_back_getconn()
1764 metainfo_t *mi, in meta_back_release_conn_lock() argument
1771 ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex ); in meta_back_release_conn_lock()
1783 meta_back_print_conntree( mi, ">>> meta_back_release_conn" ); in meta_back_release_conn_lock()
1789 assert( mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num > 0 ); in meta_back_release_conn_lock()
1790 LDAP_TAILQ_REMOVE( &mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_priv, mc, mc_q ); in meta_back_release_conn_lock()
1791 mi->mi_conn_priv[ LDAP_BACK_CONN2PRIV( mc ) ].mic_num--; in meta_back_release_conn_lock()
1801 tmpmc = ldap_tavl_delete( &mi->mi_conninfo.lai_tree, in meta_back_release_conn_lock()
1811 meta_back_print_conntree( mi, "<<< meta_back_release_conn" ); in meta_back_release_conn_lock()
1825 ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex ); in meta_back_release_conn_lock()
1835 metainfo_t *mi = (metainfo_t *)op->o_bd->be_private; in meta_back_quarantine() local
1836 metatarget_t *mt = mi->mi_targets[ candidate ]; in meta_back_quarantine()
1886 if ( mi->mi_quarantine_f ) { in meta_back_quarantine()
1887 (void)mi->mi_quarantine_f( mi, candidate, in meta_back_quarantine()
1888 mi->mi_quarantine_p ); in meta_back_quarantine()