~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to servers/slapd/back-meta/conn.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/conn.c,v 1.86.2.17 2009/01/22 00:01:07 kurt Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/servers/slapd/back-meta/conn.c,v 1.86.2.19 2009/08/26 00:50:20 quanah Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
4
 * Copyright 1999-2009 The OpenLDAP Foundation.
418
418
 
419
419
        /* automatically chase referrals ("chase-referrals [{yes|no}]" statement) */
420
420
        ldap_set_option( msc->msc_ld, LDAP_OPT_REFERRALS,
421
 
                LDAP_BACK_CHASE_REFERRALS( mi ) ? LDAP_OPT_ON : LDAP_OPT_OFF );
 
421
                META_BACK_TGT_CHASE_REFERRALS( mt ) ? LDAP_OPT_ON : LDAP_OPT_OFF );
422
422
 
423
423
#ifdef HAVE_TLS
424
424
        /* start TLS ("tls [try-]{start|propagate}" statement) */
425
 
        if ( ( LDAP_BACK_USE_TLS( mi )
 
425
        if ( ( META_BACK_TGT_USE_TLS( mt )
426
426
                || ( op->o_conn->c_is_tls
427
 
                        && LDAP_BACK_PROPAGATE_TLS( mi ) ) )
 
427
                        && META_BACK_TGT_PROPAGATE_TLS( mt ) ) )
428
428
                && !is_ldaps )
429
429
        {
430
430
#ifdef SLAP_STARTTLS_ASYNCHRONOUS
526
526
                 * overlay, where the "uri" can be parsed out of a referral */
527
527
                if ( rs->sr_err == LDAP_SERVER_DOWN
528
528
                        || ( rs->sr_err != LDAP_SUCCESS
529
 
                                && LDAP_BACK_TLS_CRITICAL( mi ) ) )
 
529
                                && META_BACK_TGT_TLS_CRITICAL( mt ) ) )
530
530
                {
531
531
 
532
532
#ifdef DEBUG_205
1024
1024
{
1025
1025
        metainfo_t      *mi = ( metainfo_t * )op->o_bd->be_private;
1026
1026
        metaconn_t      *mc = NULL,
1027
 
                        mc_curr = { 0 };
 
1027
                        mc_curr = {{ 0 }};
1028
1028
        int             cached = META_TARGET_NONE,
1029
1029
                        i = META_TARGET_NONE,
1030
1030
                        err = LDAP_SUCCESS,
1168
1168
                                        LDAP_BACK_CONN_TAINTED_SET( mc );
1169
1169
                                        LDAP_BACK_CONN_CACHED_CLEAR( mc );
1170
1170
 
1171
 
                                        Debug( LDAP_DEBUG_TRACE, "%s meta_back_getconn: mc=%p conn=%ld expired (tainted).\n",
1172
 
                                                op->o_log_prefix, (void *)mc, LDAP_BACK_PCONN_ID( mc ) );
 
1171
                                        if ( LogTest( LDAP_DEBUG_TRACE ) ) {
 
1172
                                                char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
1173
                                                mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
1174
 
 
1175
                                                Debug( LDAP_DEBUG_TRACE,
 
1176
                                                        "%s meta_back_getconn: mc=%p conn=%s expired (tainted).\n",
 
1177
                                                        op->o_log_prefix, (void *)mc, buf );
 
1178
                                        }
1173
1179
                                }
1174
1180
 
1175
1181
                                mc->mc_refcnt++;
1654
1660
 
1655
1661
                        default:
1656
1662
                                LDAP_BACK_CONN_CACHED_CLEAR( mc );
1657
 
                                Debug( LDAP_DEBUG_ANY,
1658
 
                                        "%s meta_back_getconn: candidates=%d conn=%ld insert failed\n",
1659
 
                                        op->o_log_prefix, ncandidates,
1660
 
                                        LDAP_BACK_PCONN_ID( mc ) );
 
1663
                                if ( LogTest( LDAP_DEBUG_ANY ) ) {
 
1664
                                        char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
1665
                                        mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
1666
 
 
1667
                                        Debug( LDAP_DEBUG_ANY,
 
1668
                                                "%s meta_back_getconn: candidates=%d conn=%s insert failed\n",
 
1669
                                                op->o_log_prefix, ncandidates, buf );
 
1670
                                }
1661
1671
        
1662
1672
                                mc->mc_refcnt = 0;      
1663
1673
                                meta_back_conn_free( mc );
1671
1681
                        }
1672
1682
                }
1673
1683
 
1674
 
                Debug( LDAP_DEBUG_TRACE,
1675
 
                        "%s meta_back_getconn: candidates=%d conn=%ld inserted\n",
1676
 
                        op->o_log_prefix, ncandidates,
1677
 
                        LDAP_BACK_PCONN_ID( mc ) );
 
1684
                if ( LogTest( LDAP_DEBUG_TRACE ) ) {
 
1685
                        char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
1686
                        mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
1687
 
 
1688
                        Debug( LDAP_DEBUG_TRACE,
 
1689
                                "%s meta_back_getconn: candidates=%d conn=%s inserted\n",
 
1690
                                op->o_log_prefix, ncandidates, buf );
 
1691
                }
1678
1692
 
1679
1693
        } else {
1680
 
                Debug( LDAP_DEBUG_TRACE,
1681
 
                        "%s meta_back_getconn: candidates=%d conn=%ld fetched\n",
1682
 
                        op->o_log_prefix, ncandidates,
1683
 
                        LDAP_BACK_PCONN_ID( mc ) );
 
1694
                if ( LogTest( LDAP_DEBUG_TRACE ) ) {
 
1695
                        char buf[STRLENOF("4294967295U") + 1] = { 0 };
 
1696
                        mi->mi_ldap_extra->connid2str( &mc->mc_base, buf, sizeof(buf) );
 
1697
 
 
1698
                        Debug( LDAP_DEBUG_TRACE,
 
1699
                                "%s meta_back_getconn: candidates=%d conn=%s fetched\n",
 
1700
                                op->o_log_prefix, ncandidates, buf );
 
1701
                }
1684
1702
        }
1685
1703
 
1686
1704
        return mc;