Thanks for your reply, Hallvard. Do I understand it correctly that I can re-use LDAP structures on which a bind has already been done? Do you know of any other stateful data I would have to look at?
Regards, Khaled
2010/11/12 Hallvard B Furuseth h.b.furuseth@usit.uio.no:
Khaled Blah writes:
My application creates LDAP structures (using ldap_init) and re-uses these structures whenever possible so that the least number of LDAP binds have to done. Is there anything I need to do after an LDAP operation has finished or maybe do I have to unbind at some point to make sure the LDAP structure remains in a valid state? I would be happy to receive any insight into this.
With LDAP *ld, call ldap_unbind(ld) when you are finished with ld, and not before. ldap_unbind() is actually the destructor for an LDAP*, in addition to sending an Unbind message.
-- Hallvard
Khaled Blah writes:
Thanks for your reply, Hallvard. Do I understand it correctly that I can re-use LDAP structures on which a bind has already been done?
Yes, a Bind on an LDAP* remains in force until the next Bind, possibly StartTLS (I don't remember) or Unbind.
Do you know of any other stateful data I would have to look at?
The assertion implies a broken data structure, so my guess is you either reused the LDAP* after Unbind, or you have some data corruption in your program.
I see. I will have to look at it more closley. Thanks for your reply, Hallvard!
Regards, Khaled
2010/11/12 Hallvard B Furuseth h.b.furuseth@usit.uio.no:
Khaled Blah writes:
Thanks for your reply, Hallvard. Do I understand it correctly that I can re-use LDAP structures on which a bind has already been done?
Yes, a Bind on an LDAP* remains in force until the next Bind, possibly StartTLS (I don't remember) or Unbind.
Do you know of any other stateful data I would have to look at?
The assertion implies a broken data structure, so my guess is you either reused the LDAP* after Unbind, or you have some data corruption in your program.
-- Hallvard
openldap-technical@openldap.org