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

RE: LDAP C API draft - LDAPMessage lifetime?



Yes, you should always make a copy. After ldap_unbind() is called, all bets
are off concerning data structures associated with that connection.

-Anoop

> -----Original Message-----
> From:	Mark Smith [SMTP:mcs@netscape.com]
> Sent:	Thursday, April 16, 1998 9:56 AM
> To:	George Powers
> Cc:	ietf-ldapext@netscape.com
> Subject:	Re: LDAP C API draft - LDAPMessage lifetime?
> 
> In my opinion you should make a copy.  An implementation of the LDAP API
> could tie the LDAPMessage object to the LDAP session handle somehow if
> it chose to do so.
> 
> -Mark
> 
> 
> George Powers wrote:
> > 
> > I don't think that the draft states whether it is legitimate to use
> > the results of an LDAP search after calling ldap_unbind().  On the one
> > hand, ldap_unbind() invalidates the session handle, but on the other
> > hand it does not seem to deallocate the LDAPMessage structure or its
> > attached values.  So if I have obtained pointers to the attribute values
> > before calling ldap_ubind(), can I keep using these values by reference
> > and free the LDAPMessage at my convenience, or should I make a copy of
> > the values before calling ldap_unbind()?
> > 
> > My guess is the latter, because calls like ldap_first_entry() require a
> > session handle...