[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap_result returns 0

"Kurt D. Zeilenga" wrote:
> man ldap_result
>  ldap_result() returns -1 if something bad happens,
>  and zero if the timeout specified was exceeded.

Thanks, Kurt. I missed it in the man page and this is exactly
what is happening. Still, I am getting some strange results.

I am using ldap_result with timeval initialized to 0, i.e. it
just polls. My search test is supposed to return 12 entries.
Just for the sake of exploring I am doing

	while ((rc = ldap_result(ld, -1, 1, &tv, &result)) == 0)

Then I look at the actual return code and if it is LDAP_RES_SEARCH_RESULT
I process and print the results, otherwise I just print the return
code. Most of the time the results are printed correctly but once
in a while I am getting just a subset of the attributes (my search
request asked for everything including all attributes). As this is
the same code working against the same server, I am
wondering what might be the reason of this behavior? Is polling
inherently problematic and I should always use a non-0 timeout?

[My LDAP client is actually a server serving my test client, so
all these repeated queries are going through one established
connection with enabled cache].