rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- if ( rc == LDAP_BUSY && do_retry > 0 ) {
- do_retry--;
- goto retry;
+ switch ( rc ) {
+ case LDAP_BUSY:
+ case LDAP_UNAVAILABLE:
+ if ( do_retry == 1 ) {
+ do_retry = 0;
+ sleep( 1 );
+ goto retry;
+ }
+ /* fallthru */
+ default:
+ break;
}
exit( EXIT_FAILURE );
}
rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- if ( rc == LDAP_BUSY && do_retry > 0 ) {
- do_retry--;
- goto retry;
+ switch ( rc ) {
+ case LDAP_BUSY:
+ case LDAP_UNAVAILABLE:
+ if ( do_retry == 1 ) {
+ do_retry = 0;
+ sleep( 1 );
+ goto retry;
+ }
+ /* fallthru */
+ default:
+ break;
}
exit( EXIT_FAILURE );
}
rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- if ( rc == LDAP_BUSY && do_retry > 0 ) {
- do_retry--;
- goto retry;
+ switch ( rc ) {
+ case LDAP_BUSY:
+ case LDAP_UNAVAILABLE:
+ if ( do_retry == 1 ) {
+ do_retry = 0;
+ sleep( 1 );
+ goto retry;
+ }
+ /* fallthru */
+ default:
+ break;
}
exit( EXIT_FAILURE );
}
rc = ldap_bind_s( ld, NULL, NULL, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
ldap_perror( ld, "ldap_bind" );
- if ( rc == LDAP_BUSY && do_retry > 0 ) {
- do_retry--;
- goto retry;
+ switch ( rc ) {
+ case LDAP_BUSY:
+ case LDAP_UNAVAILABLE:
+ if ( do_retry == 1 ) {
+ do_retry = 0;
+ sleep( 1 );
+ goto retry;
+ }
+ /* fallthru */
+ default:
+ break;
}
exit( EXIT_FAILURE );
}
rc = ldap_bind_s( ld, manager, passwd, LDAP_AUTH_SIMPLE );
if ( rc != LDAP_SUCCESS ) {
- if ( rc == LDAP_BUSY && do_retry == 1 ) {
- do_retry = 0;
- goto retry;
- }
ldap_perror( ld, "ldap_bind" );
+ switch ( rc ) {
+ case LDAP_BUSY:
+ case LDAP_UNAVAILABLE:
+ if ( do_retry == 1 ) {
+ do_retry = 0;
+ sleep( 1 );
+ goto retry;
+ }
+ /* fallthru */
+ default:
+ break;
+ }
exit( EXIT_FAILURE );
}