struct berval mdn = BER_BVNULL;
dncookie dc;
metasingleconn_t *msc = &mc->mc_conns[ candidate ];
- int msgid;
+ int msgid,
+ rebinding = 0;
/*
* Rewrite the bind dn if needed
goto retry;
}
rs->sr_err = LDAP_BUSY;
- break;
+ if ( rebinding ) {
+ ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+ break;
+ }
+
+ /* FIXME: some times the request times out
+ * while the other party is not willing to
+ * send a response any more. Give it a second
+ * chance with a freshly bound connection */
+ rebinding = 1;
+ nretries = mt->mt_nretries;
+ /* fallthru */
case -1:
ldap_get_option( msc->msc_ld, LDAP_OPT_ERROR_NUMBER,
&rs->sr_err );
+ if ( rebinding ) {
+ ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+ }
+
Debug( LDAP_DEBUG_ANY, "### %s meta_back_single_bind: err=%d nretries=%d\n",
op->o_log_prefix, rs->sr_err, nretries );
rc = LDAP_BUSY;
if ( rebinding ) {
+ ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
break;
}
ldap_get_option( msc->msc_ld,
LDAP_OPT_ERROR_NUMBER, &rs->sr_err );
+ if ( rebinding ) {
+ ldap_abandon_ext( msc->msc_ld, msgid, NULL, NULL );
+ }
+
Debug( LDAP_DEBUG_ANY, "### %s meta_back_single_dobind: err=%d nretries=%d\n",
op->o_log_prefix, rs->sr_err, nretries );
gotit = 1;
+#if 0
/*
* If scope is BASE, we need to jump out
* as soon as one entry is found; if
* this should correspond to the sole
* entry that has the base DN
*/
+ /* FIXME: this defeats the purpose of
+ * doing a search with scope == base and
+ * sizelimit = 1 to determine if a
+ * candidate is actually unique */
if ( op->ors_scope == LDAP_SCOPE_BASE
&& rs->sr_nentries > 0 )
{
sres = LDAP_SUCCESS;
break;
}
+#endif
} else if ( rc == LDAP_RES_SEARCH_REFERENCE ) {
char **references = NULL;
}
if ( ber_scanf( &ber, "[W]", &attr->a_vals ) == LBER_ERROR
- || attr->a_vals == NULL ) {
+ || attr->a_vals == NULL )
+ {
attr->a_vals = (struct berval *)&slap_dummy_bv;
} else if ( attr->a_desc == slap_schema.si_ad_objectClass
- || attr->a_desc == slap_schema.si_ad_structuralObjectClass ) {
-
+ || attr->a_desc == slap_schema.si_ad_structuralObjectClass )
+ {
for ( last = 0; !BER_BVISNULL( &attr->a_vals[ last ] ); ++last );
for ( bv = attr->a_vals; !BER_BVISNULL( bv ); bv++ ) {