https://bugs.openldap.org/show_bug.cgi?id=8545
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Howard Chu hyc@openldap.org --- (In reply to shalopo@gmail.com from comment #0)
Full_Name: Shahar Lupu Version: 2.4.44 OS: Ubuntu URL: ftp://ftp.openldap.org/incoming/ Submission from: (NULL) (81.218.29.26)
When calling ldap_result with a timeout={0,0} (polling), it returns LDAP_TIMEOUT even though there are available messages in the socket. This occurs when calling ldap_results with all=true and a multi-message response has arrived. In this case, if the client has already received on the socket every message for the response, it is desirable that all the messages are collected within this ldap_result call. Instead of only polling for the specified timeout, ldap_result applies the timeout (zero when polling) on the wait4msg loop. Consequently, ldap_result returns LDAP_TIMEOUT after the first message if the response is composed of more than one message. While it may be a good idea to apply a timeout for the wai4msg loop (rather than only the polling on the socket), it is undesirable in some cases and should at least be configurable. Or perhaps timeout=polling should never be applied on the wait4msg loop.
None of this will make any difference. In try_read1msg, there is a check to see if the socket is still readable at the end, in which case it will loop back and read the next message. As such, when it returns to wait4msg, all readable messages have already been processed. So even if it returns LDAP_TIMEOUT, it returns all available messages. If it only returns one message, that means no others were available.