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

Re: Why is do_ldap_select in wait4msg called twice for a ldap_search_s?

>We are searching for an exact match entry and we are
>not clear how the search process work.

I'm not sure if digging through the API implementation is the
best way of learning how the search process works.  I would
recommend reviewing protocol documentation such as RFC1777

> Why is do_ldap_select in wait4msg called twice for a ldap_search_s? 

This question may be more appropriate for our developer list
and this gets into implementation details.  I will, however,
attempt to answer it within the context of this forum.

A search operation may return multiple protocol data units (PDU)
or messages.  ldap_search_s() must gather all PDUs that are in
response to the request and, as such, may have to wait for
multiple PDUs.  The PDUs may come from multiple connections
(in the face of referrals) and as such, the implementation uses
I/O multiplexing to avoid blocking on one connection.  As common
with select based multiplexing, the reader needs to loop until
the desired information is read.  That is, select() indicates
the availability of data, not the quanity.  (Also, select()
may return on other conditions).  You will note that wait4msg
is implemented with a select(), called by do_ldap_select(),
loop.  The loop exits when the desired the read of the PDU
is complete or an error occurs.

If you have questions that require more detailed explanation,
I suggest taking them developer's list.


Kurt D. Zeilenga		<kurt@boolean.net>
Net Boolean Incorporated	<http://www.boolean.net/>