[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
ldap_search_s(t) and time-outs
- To: OpenLDAP-software@OpenLDAP.org
- Subject: ldap_search_s(t) and time-outs
- From: "Greg B" <ldapn00b@gmail.com>
- Date: Thu, 31 Aug 2006 10:39:03 +1000
- Content-disposition: inline
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=HPfHZcY54cqAnB5RAjStn3uB8xGDnLgpUE7CPDuBTQBIx6JZJkpvbNQjwbKpxloAD/pfrLByXpz/NDByoUQ36hpU7jsBMMgJUwMFBv236L1N+v/SUp2psqX2W1d0LRoR7gyUv9b57XaDiEcxJTGGBzPzkdtwaxcPbRXlV6Erpns=
hi,
I'm using OpenLDAP version 2.1.2 and am having troubles enforcing a
time-out on a search operation. I wanted to clarify whether I was
missing some obvious step, whether some steps on the LDAP server side
are required, or whether its a known issue that has been resolved
or is yet in the process of being resolved.
Before I perform initial bind (using ldap_sasl_bind and SSL context),
I set LDAP_OPT_NETWORK_TIMEOUT to 5 seconds... this seems to work a
treat on the bind time-out. The problem occurs after I unplug the
network cable on the LDAP server machine and try to perform a
search using the LDAP session handle I obtained earlier.
char* attrs[] = {LDAP_NO_ATTRS, NULL};
LDAPMessage* res = NULL;
ldapRc = ldap_search_st(ld, baseDnUtf8.c_str(), scope,
filterUtf8.c_str(), attrs, FALSE, NULL, &res);
The ldap_search_st function call doesn't seem to return for at least
40-120 seconds. Before making this post I've tried everything I can
think of, including 1) setting LDAP_OPT_TIMELIMIT to 5 seconds... this
is supposedly setting the server-side limit, 2) initializing timeval
struct, setting tv_sec member to 5 and passing in an address of the
struct as the second-last parameter to ldap_search_st... this is
supposedly setting the client-side time-out, 3) calling ldap_search_s,
4) using Simple (username/password) authentication, instead of SSL. I
guess next thing on my TO-TRY list is doing a debug build of all
components and trying to track down in which OpenLDAP function the
wait occurs. I noticed (by looking in CVSWeb) that there was some fix
to wait4msg routine made post-version-2.1.2, wonder if that has any
bearing on my scenario.
any tips/suggestions/enlightenments would be appreciated