mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 15:49:34 -05:00
tolerate more error conditions
This commit is contained in:
parent
d08257407d
commit
203525a64b
3 changed files with 36 additions and 6 deletions
|
|
@ -329,6 +329,12 @@ retry:;
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
ldap_perror( ld, "ldap_add" );
|
ldap_perror( ld, "ldap_add" );
|
||||||
switch ( rc ) {
|
switch ( rc ) {
|
||||||
|
case LDAP_ALREADY_EXISTS:
|
||||||
|
/* NOTE: this likely means
|
||||||
|
* the delete failed
|
||||||
|
* during the previous round... */
|
||||||
|
break;
|
||||||
|
|
||||||
case LDAP_BUSY:
|
case LDAP_BUSY:
|
||||||
case LDAP_UNAVAILABLE:
|
case LDAP_UNAVAILABLE:
|
||||||
if ( do_retry > 0 ) {
|
if ( do_retry > 0 ) {
|
||||||
|
|
@ -353,6 +359,12 @@ retry:;
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
ldap_perror( ld, "ldap_delete" );
|
ldap_perror( ld, "ldap_delete" );
|
||||||
switch ( rc ) {
|
switch ( rc ) {
|
||||||
|
case LDAP_NO_SUCH_OBJECT:
|
||||||
|
/* NOTE: this likely means
|
||||||
|
* the add failed
|
||||||
|
* during the previous round... */
|
||||||
|
break;
|
||||||
|
|
||||||
case LDAP_BUSY:
|
case LDAP_BUSY:
|
||||||
case LDAP_UNAVAILABLE:
|
case LDAP_UNAVAILABLE:
|
||||||
if ( do_retry > 0 ) {
|
if ( do_retry > 0 ) {
|
||||||
|
|
|
||||||
|
|
@ -220,12 +220,24 @@ retry:;
|
||||||
rc = ldap_modify_s( ld, entry, mods );
|
rc = ldap_modify_s( ld, entry, mods );
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
ldap_perror( ld, "ldap_modify" );
|
ldap_perror( ld, "ldap_modify" );
|
||||||
if ( rc == LDAP_BUSY && do_retry > 0 ) {
|
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--;
|
do_retry--;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
if ( rc != LDAP_NO_SUCH_OBJECT ) break;
|
/* fall thru */
|
||||||
continue;
|
|
||||||
|
default:
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod.mod_op = LDAP_MOD_DELETE;
|
mod.mod_op = LDAP_MOD_DELETE;
|
||||||
|
|
@ -233,7 +245,10 @@ retry:;
|
||||||
if ( rc != LDAP_SUCCESS ) {
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
ldap_perror( ld, "ldap_modify" );
|
ldap_perror( ld, "ldap_modify" );
|
||||||
switch ( rc ) {
|
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;
|
break;
|
||||||
|
|
||||||
case LDAP_BUSY:
|
case LDAP_BUSY:
|
||||||
|
|
|
||||||
|
|
@ -235,6 +235,9 @@ retry:;
|
||||||
ldap_perror( ld, "ldap_modrdn" );
|
ldap_perror( ld, "ldap_modrdn" );
|
||||||
switch ( rc ) {
|
switch ( rc ) {
|
||||||
case LDAP_NO_SUCH_OBJECT:
|
case LDAP_NO_SUCH_OBJECT:
|
||||||
|
/* NOTE: this likely means
|
||||||
|
* the first modrdn failed
|
||||||
|
* during the previous round... */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LDAP_BUSY:
|
case LDAP_BUSY:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue