need some minimal timeout otherwise strange issues occur

This commit is contained in:
Pierangelo Masarati 2005-08-22 18:14:41 +00:00
parent 3cb9d64de3
commit 075220dd7e
3 changed files with 9 additions and 4 deletions

View File

@ -286,7 +286,7 @@ ldap_back_start_tls(
if ( rc == LDAP_SUCCESS ) { if ( rc == LDAP_SUCCESS ) {
LDAPMessage *res = NULL; LDAPMessage *res = NULL;
int retries = 1; int retries = 1;
struct timeval tv = { 0, 0 }; struct timeval tv = { 0, 100000 };
retry:; retry:;
rc = ldap_result( ld, msgid, LDAP_MSG_ALL, &tv, &res ); rc = ldap_result( ld, msgid, LDAP_MSG_ALL, &tv, &res );
@ -811,7 +811,7 @@ ldap_back_op_result(
* remote server response */ * remote server response */
if ( ERR_OK( rs->sr_err ) ) { if ( ERR_OK( rs->sr_err ) ) {
int rc; int rc;
struct timeval tv = { 0, 0 }; struct timeval tv = { 0, 100000 };
retry:; retry:;
/* if result parsing fails, note the failure reason */ /* if result parsing fails, note the failure reason */

View File

@ -179,6 +179,7 @@ ldap_back_search(
} else { } else {
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 100000;
} }
if ( op->ors_attrs ) { if ( op->ors_attrs ) {

View File

@ -211,7 +211,7 @@ rebind:;
op->o_ctrls, NULL, &msgid ); op->o_ctrls, NULL, &msgid );
if ( rs->sr_err == LDAP_SUCCESS ) { if ( rs->sr_err == LDAP_SUCCESS ) {
LDAPMessage *res; LDAPMessage *res;
struct timeval tv; struct timeval tv = { 0, 100000 };
int rc; int rc;
int nretries = mt->mt_nretries; int nretries = mt->mt_nretries;
@ -234,6 +234,8 @@ retry:;
if ( nretries > 0 ) { if ( nretries > 0 ) {
nretries--; nretries--;
} }
tv.tv_sec = 0;
tv.tv_usec = 100000;
goto retry; goto retry;
} }
rs->sr_err = LDAP_BUSY; rs->sr_err = LDAP_BUSY;
@ -380,7 +382,7 @@ rebind:;
NULL, NULL, &msgid ); NULL, NULL, &msgid );
if ( rc == LDAP_SUCCESS ) { if ( rc == LDAP_SUCCESS ) {
LDAPMessage *res; LDAPMessage *res;
struct timeval tv; struct timeval tv = { 0, 100000 };
/* /*
* handle response!!! * handle response!!!
@ -401,6 +403,8 @@ retry:;
if ( nretries > 0 ) { if ( nretries > 0 ) {
nretries--; nretries--;
} }
tv.tv_sec = 0;
tv.tv_usec = 100000;
goto retry; goto retry;
} }