From: Pierangelo Masarati Date: Mon, 22 Aug 2005 18:14:41 +0000 (+0000) Subject: need some minimal timeout otherwise strange issues occur X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~608 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=075220dd7ed6e2f0cd6599f518fd86c5c2dc892a;p=openldap need some minimal timeout otherwise strange issues occur --- diff --git a/servers/slapd/back-ldap/bind.c b/servers/slapd/back-ldap/bind.c index 7ce02eda4c..5f6960abed 100644 --- a/servers/slapd/back-ldap/bind.c +++ b/servers/slapd/back-ldap/bind.c @@ -286,7 +286,7 @@ ldap_back_start_tls( if ( rc == LDAP_SUCCESS ) { LDAPMessage *res = NULL; int retries = 1; - struct timeval tv = { 0, 0 }; + struct timeval tv = { 0, 100000 }; retry:; rc = ldap_result( ld, msgid, LDAP_MSG_ALL, &tv, &res ); @@ -811,7 +811,7 @@ ldap_back_op_result( * remote server response */ if ( ERR_OK( rs->sr_err ) ) { int rc; - struct timeval tv = { 0, 0 }; + struct timeval tv = { 0, 100000 }; retry:; /* if result parsing fails, note the failure reason */ diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index e06cb8bb42..09ad79807e 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -179,6 +179,7 @@ ldap_back_search( } else { tv.tv_sec = 0; + tv.tv_usec = 100000; } if ( op->ors_attrs ) { diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index e211f63631..4ec1e28536 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -211,7 +211,7 @@ rebind:; op->o_ctrls, NULL, &msgid ); if ( rs->sr_err == LDAP_SUCCESS ) { LDAPMessage *res; - struct timeval tv; + struct timeval tv = { 0, 100000 }; int rc; int nretries = mt->mt_nretries; @@ -234,6 +234,8 @@ retry:; if ( nretries > 0 ) { nretries--; } + tv.tv_sec = 0; + tv.tv_usec = 100000; goto retry; } rs->sr_err = LDAP_BUSY; @@ -380,7 +382,7 @@ rebind:; NULL, NULL, &msgid ); if ( rc == LDAP_SUCCESS ) { LDAPMessage *res; - struct timeval tv; + struct timeval tv = { 0, 100000 }; /* * handle response!!! @@ -401,6 +403,8 @@ retry:; if ( nretries > 0 ) { nretries--; } + tv.tv_sec = 0; + tv.tv_usec = 100000; goto retry; }