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

Re: ldap_first/next_attribute



At 03:18 PM 9/14/00 +0200, Ralf Haferkamp wrote:
>Hi,
>
>Calls to ldap_first_attribute or ldap_next_attribute result in a decoding
>error if there are no attribute in the LDAPMessage:
>
>example:
>LDAPMessage msg;   // an LDAPMessage that contains an Entry of a
>                   // search result. That doesn't contain any
>                   // of the requested Attributes  
>char* name=ldap_first_attribute(ld, msg, &ptr);
>//name will be NULL here, as msg didn't contain an attribute
>
>additionally the error value of the LDAP struct ld will be set
>to 84 (decoding error). Is this a bug or feature?
>
>The API draft says the following:
>    ldap_first_attribute() and ldap_next_attribute() will return NULL when
>    the end of the attributes is reached, or if there is an error, in which
>    case the error parameters in the session handle ld will be set to indi-
>    cate the error.
>
>If I understand this correctly there error parameter should only be set in
>case of an error, not if the end of attributes is reached.

I concur.

        Kurt