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

Re: tcp timeoutcon patch for libldap



At 06:56 PM 7/28/99 +0200, Lars Uffmann wrote:
>This sounds like we should look for an  I/O
>abstraction layer in llber.

Yes, at the base BER level there should be a very
simple abstraction layer.  read/write should be enough...

>For my particular problem,
>the posibility to provide a custom connect() function
>via ldap_set_option, would have solved the problem.

Yes, I believe there should be an additional layer
of hooks at the LDAP API level.

>> >To set/get the timeout, I used
>> >the yet unused LDAP_OPT_TIMEOUT option flag
>> >in ldap.h.
>> 
>> The LDAP_OPT_TIMEOUT was meant to be used as a
>> per LDAP API call timeout versus a per network call
>> timeout.  Implementation of such gets a little
>> tricky.
>
>Per API call timeouts is a differrent story ...
>I think the API specs are quite inconsistent. For example,
>there is no ldap_bind_st() api function.
>But we solved this by writing a custom bind_st() function.

Or use a client control with with ldap_*_ext_s().
The _st() routines, in my option, should be deprecated.

>The only issue left is the bind call when following
>referrals. Do you have any suggestions how to get arround this?

If a API timeout was specified, the time spent obtaining
the referral must be substracted from timeout used
in the chasing request.

>Maybee LDAP_OPT_TIMEOUT could be used here.

Actually, my point about using controls brings up an
another possibility.  A default client control could
(and maybe should) be used instead of LDAP_OPT_TIMEOUT.

>> If you want a per network call timeout, I would
>> suggest introducing another option.
>>         LDAP_OPT_NETWORK_TIMEOUT
>If you are willing to include my patch / provide the
>timeoutconnect feature (either way) I would be happy
>code this.

This, too, could be handled by a client control...
(but an opt is fine for now).

>> Note: The invalue of these options should be
>> "struct timeval *".
>
>I can correct this, if you think it is important.

For now, can you resubmit (as an ITS) using
LDAP_OPT_NETWORK_TIMEOUT and struct timeval *
(be sure duplicate the structure in and out of
ldap_set/get_option).

We'll also should to sort out configure issues
surrounding inet_aton() and O_NDELAY...

Kurt