mt, mc, candidate,
LDAP_BACK_CONN_ISPRIV( mc ),
LDAP_BACK_DONTSEND );
+ LDAP_BACK_CONN_BINDING_SET( msc );
} else {
/* can't do anything about it */
done:;
rs->sr_err = rc;
if ( rc != LDAP_SUCCESS && META_BACK_ONERR_STOP( mi ) ) {
+ LDAP_BACK_CONN_BINDING_CLEAR( msc );
meta_back_release_conn_lock( op, mc, 1, dolock );
*mcp = NULL;
goto send_err;
}
+
if ( rc == LDAP_UNAVAILABLE && do_retry ) {
do_retry = 0;
if ( meta_back_retry( op, rs, &mc, i, sendok ) ) {
goto retry;
}
+ ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
+ LDAP_BACK_CONN_BINDING_CLEAR( msc );
+ ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
+
return 0;
}
+ ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
+ LDAP_BACK_CONN_BINDING_CLEAR( msc );
+ ldap_pvt_thread_mutex_unlock( &mi->mi_conninfo.lai_mutex );
+
snprintf( buf, sizeof( buf ),
"meta_back_dobind[%d]: (%s) err=%d (%s).",
i, rootdn ? rootdn : "anonymous",
{
metainfo_t *mi = ( metainfo_t * )op->o_bd->be_private;
metatarget_t *mt = &mi->mi_targets[ candidate ];
- int rc = LDAP_UNAVAILABLE;
metaconn_t *mc = *mcp;
metasingleconn_t *msc = &mc->mc_conns[ candidate ];
+ int rc = LDAP_UNAVAILABLE,
+ binding = LDAP_BACK_CONN_BINDING( msc );
ldap_pvt_thread_mutex_lock( &mi->mi_conninfo.lai_mutex );
/* mc here must be the regular mc, reset and ready for init */
rc = meta_back_init_one_conn( op, rs, mt, mc, candidate,
LDAP_BACK_CONN_ISPRIV( mc ), sendok );
+ if ( binding ) {
+ LDAP_BACK_CONN_BINDING_SET( msc );
+ }
if ( rc == LDAP_SUCCESS ) {
rc = meta_back_single_dobind( op, rs, mcp, candidate,
if ( rc != LDAP_SUCCESS ) {
if ( *mcp != NULL ) {
+ if ( binding ) {
+ LDAP_BACK_CONN_BINDING_CLEAR( msc );
+ }
meta_back_release_conn_lock( op, mc, 1, 0 );
*mcp = NULL;
}