Skip to content
Snippets Groups Projects
Commit 0d35dcf8 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

better handling of bind retry

parent ecd99b83
Branches
Tags
No related merge requests found
......@@ -291,9 +291,17 @@ retry:;
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 );
}
......
......@@ -185,9 +185,17 @@ retry:;
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 );
}
......
......@@ -177,9 +177,17 @@ retry:;
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 );
}
......
......@@ -140,9 +140,17 @@ retry:;
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 );
}
......
......@@ -157,11 +157,19 @@ retry:;
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 );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment