* connection with identity assertion */
/* NOTE: use with care */
if ( li->li_idassert_flags & LDAP_BACK_AUTH_OVERRIDE ) {
- assert( lc->lc_binding == 1 );
- lc->lc_binding = 0;
ldap_back_release_conn( op, rs, lc );
return( rc );
}
}
}
- assert( lc->lc_binding == 1 );
- lc->lc_binding = 0;
-
/* must re-insert if local DN changed as result of bind */
if ( !LDAP_BACK_CONN_ISBOUND( lc )
|| ( !dn_match( &op->o_req_ndn, &lc->lc_local_ndn )
}
#ifdef HAVE_TLS
- if ( LDAP_BACK_CONN_ISPRIV( lc ))
+ if ( LDAP_BACK_CONN_ISPRIV( lc ) ) {
sb = &li->li_acl;
- else if ( LDAP_BACK_CONN_ISIDASSERT( lc ))
+
+ } else if ( LDAP_BACK_CONN_ISIDASSERT( lc ) ) {
sb = &li->li_idassert.si_bc;
- else
+
+ } else {
sb = &li->li_tls;
+ }
if ( sb->sb_tls_do_init ) {
bindconf_tls_set( sb, ld );
lc->lc_ld = ld;
lc->lc_refcnt = 1;
- lc->lc_binding = 1;
#ifdef HAVE_TLS
if ( is_tls ) {
LDAP_BACK_CONN_ISTLS_SET( lc );
ldapconn_t *lc = NULL,
lc_curr = { 0 };
int refcnt = 1,
- binding = 1,
lookupconn = !( sendok & LDAP_BACK_BINDING );
/* if the server is quarantined, and
}
refcnt = ++lc->lc_refcnt;
- binding = ++lc->lc_binding;
}
}
ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
if ( tmplc != NULL ) {
refcnt = ++tmplc->lc_refcnt;
- binding = ++tmplc->lc_binding;
ldap_back_conn_free( lc );
lc = tmplc;
}
LDAP_BACK_CONN_ISBOUND_CLEAR( lc );
assert( lc->lc_refcnt == 1 );
- assert( lc->lc_binding == 1 );
#if LDAP_BACK_PRINT_CONNTREE > 0
ldap_back_print_conntree( li, ">>> ldap_back_getconn(insert)" );
char buf[ SLAP_TEXT_BUFLEN ];
snprintf( buf, sizeof( buf ),
- "lc=%p inserted refcnt=%u binding=%u rc=%d",
- (void *)lc, refcnt, binding, rs->sr_err );
+ "lc=%p inserted refcnt=%u rc=%d",
+ (void *)lc, refcnt, rs->sr_err );
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_getconn: %s: %s\n",
char buf[ SLAP_TEXT_BUFLEN ];
snprintf( buf, sizeof( buf ),
- "conn %p fetched refcnt=%u binding=%u%s",
- (void *)lc, refcnt, binding, expiring ? " expiring" : "" );
+ "conn %p fetched refcnt=%u %s",
+ (void *)lc, refcnt, expiring ? " expiring" : "" );
Debug( LDAP_DEBUG_TRACE,
"=>ldap_back_getconn: %s.\n", buf, 0, 0 );
}
/* check if already bound */
rc = isbound = LDAP_BACK_CONN_ISBOUND( lc );
if ( isbound ) {
- lc->lc_binding--;
if ( dolock ) {
ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
}
}
}
- /* wait for pending operations to finish */
- /* FIXME: may become a bottleneck! */
- if ( lc->lc_refcnt != lc->lc_binding ) {
- if ( dolock ) {
- ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
- }
- ldap_pvt_thread_yield();
- goto retry_lock;
- }
-
if ( dolock ) {
ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
}
lc->lc_ld = NULL;
/* lc here must be the regular lc, reset and ready for init */
- rs->sr_err = ldap_back_prepare_conn( &lc, op, rs, sendok );
+ rs->sr_err = ldap_back_prepare_conn( lc, op, rs, sendok );
if ( rs->sr_err != LDAP_SUCCESS ) {
- lc->lc_binding--;
lc->lc_refcnt = 0;
}
}
if ( dolock ) {
ldap_pvt_thread_mutex_lock( &li->li_conninfo.lai_mutex );
}
- lc->lc_binding--;
if ( dolock ) {
ldap_pvt_thread_mutex_unlock( &li->li_conninfo.lai_mutex );
}
}
- /* FIXME: one binding-- too many? */
- lc->lc_binding--;
assert( lc->lc_refcnt == 1 );
lc->lc_refcnt = 0;
ldap_back_freeconn( op, lc, dolock );
}
done:;
- lc->lc_binding--;
LDAP_BACK_CONN_BINDING_CLEAR( lc );
rc = LDAP_BACK_CONN_ISBOUND( lc );
if ( !rc ) {
LDAP_BACK_CONN_ISBOUND_CLEAR( (*lcp) );
/* lc here must be the regular lc, reset and ready for init */
- rc = ldap_back_prepare_conn( lcp, op, rs, sendok );
+ rc = ldap_back_prepare_conn( *lcp, op, rs, sendok );
if ( rc != LDAP_SUCCESS ) {
/* freeit, because lc_refcnt == 1 */
(*lcp)->lc_refcnt = 0;