msc->msc_ld = NULL;
msc->msc_bound = 0;
- /* mc here must be the regular mc, reset and ready for init */
- rc = meta_back_init_one_conn( op, rs, mt, msc,
- LDAP_BACK_DONTSEND );
+ /* mc here must be the regular mc,
+ * reset and ready for init */
+ rc = meta_back_init_one_conn( op, rs,
+ mt, msc, LDAP_BACK_DONTSEND );
} else {
/* can't do anything about it */
msc->msc_ld = NULL;
msc->msc_bound = 0;
- /* mc here must be the regular mc, reset and ready for init */
- rc = meta_back_init_one_conn( op, rs, mt, msc, LDAP_BACK_DONTSEND );
+ /* mc here must be the regular mc,
+ * reset and ready for init */
+ rc = meta_back_init_one_conn( op, rs,
+ mt, msc, LDAP_BACK_DONTSEND );
} else {
* Already init'ed
*/
if ( msc->msc_ld != NULL ) {
- rs->sr_err = LDAP_SUCCESS;
- goto error_return;
+ return rs->sr_err = LDAP_SUCCESS;
}
/*
}
#ifdef HAVE_TLS
- /* start TLS ("start-tls"/"try-start-tls" statements) */
+ /* start TLS ("tls [try-]{start|propagate}" statement) */
if ( ( LDAP_BACK_USE_TLS( mi ) || ( op->o_conn->c_is_tls && LDAP_BACK_PROPAGATE_TLS( mi ) ) )
&& !ldap_is_ldaps_url( mt->mt_uri ) )
{
#ifdef SLAP_STARTTLS_ASYNCHRONOUS
/*
- * use asynchronous StartTLS
- * in case, chase referral (not implemented yet)
+ * use asynchronous StartTLS; in case, chase referral
+ * FIXME: OpenLDAP does not return referral on StartTLS yet
*/
int msgid;
(void *)&network_timeout );
}
- /*
- * Sets a cookie for the rewrite session
- */
- ( void )rewrite_session_init( mt->mt_rwmap.rwm_rw, op->o_conn );
-
/*
* If the connection DN is not null, an attempt to rewrite it is made
*/
msc->msc_bound = META_UNBOUND;
error_return:;
- if ( rs->sr_err != LDAP_SUCCESS ) {
+ if ( rs->sr_err == LDAP_SUCCESS ) {
+ /*
+ * Sets a cookie for the rewrite session
+ */
+ ( void )rewrite_session_init( mt->mt_rwmap.rwm_rw, op->o_conn );
+
+ } else {
rs->sr_err = slap_map_api2result( rs );
if ( sendok & LDAP_BACK_SENDERR ) {
send_ldap_result( op, rs );