New LDAP C API

Howard Chu hyc at highlandsun.com
Wed Feb 14 02:17:54 GMT 2007


simo wrote:
> On Tue, 2007-02-13 at 17:06 -0800, Howard Chu wrote:
>   
>> Love Hörnquist Åstrand wrote:
>>     
>>> I really don't like the name of "struct bervals".
>>>       
>> The struct name and the BerValue typedef have been around forever. I 
>> don't think this is any worse than krb5_data, but would be happy to hear 
>> alternatives. As for data that "in practice always is strings" - that's 
>> the sort of approach that created a big part of the mess in LDAP in the 
>> first place, thinking that everything is just strings.  When "always" 
>> turns out to be just 80-90% of the time, you're left with a real pain 
>> that remaining portion of time.
>>     
>
> howard, reread what Love said, he distinguishes between input and
> output.
> I think he means that what he likes is to have the chance to provide
> input data alternatively as a char * _or_ as a berval struct (I hate the
> name as well, of course samba's data_blob is much better <g>).
>   

I didn't miss his point. But you should realize it's a very weak point - 
in any read-write protocol one function's output may be another's input.

In the current library there are a number of APIs that accept char *s 
and simply wrap them in BerVals and call into the real API. We could 
continue to offer those, that's trivial. But I think we should actively 
discourage their use in any documentation.

>> It's true that using a better malloc library can help (see my malloc 
>> benchmark results http://www.highlandsun.com/hyc/malloc/ ) but it's 
>> better not to use it at all if it can be avoided.
>>     
>
> just do not overreact :)
>   

I'm nothing if not extreme... ;)  Though I usually say "thorough" ...

-- 
  -- Howard Chu
  Chief Architect, Symas Corp.  http://www.symas.com
  Director, Highland Sun        http://highlandsun.com/hyc
  Chief Architect, OpenLDAP     http://www.openldap.org/project/



More information about the samba-technical mailing list