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

Re: Fw:ld_errno field & ldap_perror



At 05:22 AM 2002-06-07, samuel.osouf wrote:
>Hi
>
>I MUST develop an LDAP client
>i MAY get no answer, but OpenLDAP developpers
>SHOULD be able to answer these
>3 questions :
>
>---1---
>why is ldap_perror() deprecated ?

I cannot speak for why the authors of the IETF LDAP C API
I-D choose to deprecate this routine, but I agree that it
should be because its use often leads to printing of
misleading messages.  This is because of ambiguities in
the handling of the session error code field.

>I noticed that it takes an LDAP structure 
>parameter, while
>ldap_err2string() only takes an error code param...

Yes.  ldap_err2string() assumes one has obtained the
API error code or a protocol result code using one of
the other API routines.

>---2---
>What is the difference between the result of a 
>function (eg ldap_search_ext_s())
>and the ld_errno field of the LDAP structure ?

Well, depends on the function.  If you want consistent
error handling, I suggest you stick to the extended
(_ext) async interface (no _s).

>---3---
>(Related to first one)
>Why does ldapsearch.c use BOTH ldap_err2string & 
>ldap_perror,
>while C API's draft claim ldap_perror() is 
>deprecated and recommend to use ONLY 
>ldap_err2string ??
>this seems a bit "hybrid"...

Because nobody has taken the time to update the old code.

Kurt