From: Howard Chu Date: Thu, 7 Oct 2004 02:55:51 +0000 (+0000) Subject: Add a retry for entry_get too. (oops) X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~451 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=374cd32eb6b8c01fd41a11b1f949025fa863a5b6;p=openldap Add a retry for entry_get too. (oops) --- diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index b978982f25..b071217c0d 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -614,6 +614,7 @@ ldap_back_entry_get( Connection *oconn; SlapReply rs; dncookie dc; + int do_retry = 1; /* Tell getconn this is a privileged op */ is_oc = op->o_do_not_cache; @@ -674,10 +675,17 @@ ldap_back_entry_get( *ptr++ = '\0'; } - if ( ldap_search_ext_s( lc->ld, mdn.bv_val, LDAP_SCOPE_BASE, filter, +retry: + rc = ldap_search_ext_s( lc->ld, mdn.bv_val, LDAP_SCOPE_BASE, filter, gattr, 0, NULL, NULL, LDAP_NO_LIMIT, - LDAP_NO_LIMIT, &result) != LDAP_SUCCESS ) + LDAP_NO_LIMIT, &result); + if ( rc != LDAP_SUCCESS ) { + if ( rc == LDAP_SERVER_DOWN && do_retry ) { + do_retry = 0; + if ( ldap_back_retry( lc, op, &rs )) + goto retry; + } goto cleanup; }