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

Re: (ITS#4783) ldap_sasl_bind() is not asynchronous



On December 20, 2006 9:18:18 AM +0100 Pierangelo Masarati <ando@sys-net.it> 
wrote:
> fcusack@fcusack.com wrote:
>> On December 19, 2006 7:04:15 PM -0800 "Kurt D. Zeilenga"
>> <Kurt@OpenLDAP.org> wrote:
>>
>>> At 05:32 PM 12/19/2006, fcusack@fcusack.com wrote:
>>>
>>>> Full_Name: Frank Cusack
>>>> Version: 2.3.27
>>>> OS: any
>>>> URL: ftp://ftp.openldap.org/incoming/
>>>> Submission from: (NULL) (209.76.127.62)
>>>>
>>>> connect() is always done synchronously.  Any idea when this will be
>>>> fixed?
>>>>
>>> It's actually not considered a bug.  ldap_sasl_bind(3) is async
>>> in doesn't wait for the LDAP response.  There is no LDAP restart
>>> API, as would be needed if the API didn't block on various
>>> system calls.
>>>
>>
>> Why is that required here?
>>
>>   ldap_sasl_bind()
>>   ldap_result()
>>   if (timeout) {
>>     ldap_abandon()
>>     if (just_return_on_error) {
>>       return error
>>     } else {
>>       do_something_else
>>     }
>>   }
>>
>> To restart a bind, just abandon and bind again.
>>
> There was a discussion recently on the subject (look in hte ITS).  A bind
> cannot be abandoned as per RFC 4511-19; you need to ldap_unbind_ext and
> recreate a fresh connection.

OK, I see that abandon isn't really the right thing here.

But still you can do the bind async, and just close the fd on the client
side on timeout.  I don't see why connect() timeout can't be handled
the same way.  (ignoring the problem that there is no API call AFAICT
to just drop the connection)

-frank