[Date Prev][Date Next]
Re: Async problems (ITS#2305)
Your patch is not believed to significantly alter the behavior
of the library. It may have only worked because it changed
the timing of calls. Please test a clean version of OpenLDAP,
preferably HEAD, OPENLDAP_REL_ENG_2_1, or at a minimum, the
current "stable" release (2.1.12). If you get a hang, please
then use a debugger to obtain a stack back trace (gdb bt) so
that we can see exactly where it hanging.
At 10:50 PM 2/7/2003, email@example.com wrote:
>Full_Name: Timo Sirainen
>Submission from: (NULL) (22.214.171.124)
>(Same as my mail to openldap-devel, which seemed to get ignored)
>ldap_result() doesn't seem to behave very nicely when trying to use it
>asynchronously. I call it whenever poll() says there's new data in ldap
>fd, but if timeout is anything less than 1 second, it doesn't work
>right. And 1 second timeout is too much since my process is doing other
>things as well.
>It looks like the problem is that first time when calling it,
>try_read1msg() finds a reply to non-search request and returns -2
>(result.c line 695). So, ldap_request() then checks if it's spent enough
>time, with <1sec timeout it has and doesn't try to read the data until
>later when new data comes. Then it gets a reply to previous request and
>the new one is stuck..
>I guess the real problem is that both of the requests are read into
>buffer, but only one of them is actually handled. So, how about always
>parsing the requests until valid one is found or buffer is empty?
>Included patch seems to work with me.