From: Pierangelo Masarati Date: Fri, 4 Nov 2005 15:51:19 +0000 (+0000) Subject: tolerate more error conditions X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~99 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=203525a64bb4c507229ddec7df9e1cfaccb879ac;p=openldap tolerate more error conditions --- diff --git a/tests/progs/slapd-addel.c b/tests/progs/slapd-addel.c index 163910bb93..95b4185b90 100644 --- a/tests/progs/slapd-addel.c +++ b/tests/progs/slapd-addel.c @@ -329,6 +329,12 @@ retry:; if ( rc != LDAP_SUCCESS ) { ldap_perror( ld, "ldap_add" ); switch ( rc ) { + case LDAP_ALREADY_EXISTS: + /* NOTE: this likely means + * the delete failed + * during the previous round... */ + break; + case LDAP_BUSY: case LDAP_UNAVAILABLE: if ( do_retry > 0 ) { @@ -353,6 +359,12 @@ retry:; if ( rc != LDAP_SUCCESS ) { ldap_perror( ld, "ldap_delete" ); switch ( rc ) { + case LDAP_NO_SUCH_OBJECT: + /* NOTE: this likely means + * the add failed + * during the previous round... */ + break; + case LDAP_BUSY: case LDAP_UNAVAILABLE: if ( do_retry > 0 ) { diff --git a/tests/progs/slapd-modify.c b/tests/progs/slapd-modify.c index a2f275d9f8..ad5ad6f3b1 100644 --- a/tests/progs/slapd-modify.c +++ b/tests/progs/slapd-modify.c @@ -220,12 +220,24 @@ retry:; rc = ldap_modify_s( ld, entry, mods ); if ( rc != LDAP_SUCCESS ) { ldap_perror( ld, "ldap_modify" ); - if ( rc == LDAP_BUSY && do_retry > 0 ) { - do_retry--; - goto retry; + switch ( rc ) { + case LDAP_TYPE_OR_VALUE_EXISTS: + /* NOTE: this likely means + * the second modify failed + * during the previous round... */ + break; + + case LDAP_BUSY: + case LDAP_UNAVAILABLE: + if ( do_retry > 0 ) { + do_retry--; + goto retry; + } + /* fall thru */ + + default: + goto done; } - if ( rc != LDAP_NO_SUCH_OBJECT ) break; - continue; } mod.mod_op = LDAP_MOD_DELETE; @@ -233,7 +245,10 @@ retry:; if ( rc != LDAP_SUCCESS ) { ldap_perror( ld, "ldap_modify" ); switch ( rc ) { - case LDAP_NO_SUCH_OBJECT: + case LDAP_NO_SUCH_ATTRIBUTE: + /* NOTE: this likely means + * the first modify failed + * during the previous round... */ break; case LDAP_BUSY: diff --git a/tests/progs/slapd-modrdn.c b/tests/progs/slapd-modrdn.c index 4378fe29ed..67f6462cbc 100644 --- a/tests/progs/slapd-modrdn.c +++ b/tests/progs/slapd-modrdn.c @@ -235,6 +235,9 @@ retry:; ldap_perror( ld, "ldap_modrdn" ); switch ( rc ) { case LDAP_NO_SUCH_OBJECT: + /* NOTE: this likely means + * the first modrdn failed + * during the previous round... */ break; case LDAP_BUSY: