Re: Crash in NSPR from within LDAP C-SDK - Bad MDOverlapped struct from GetQueuedCompletionStatus?

"Matthew M. DeLoera" <[email protected]> Mon, 08 Feb 2010 17:13:10 -0500
Newsgroups gmane.comp.mozilla.devel.directory
Message-ID <[email protected]>
Hello,

In investigating further, I see the calls in ldapssl_basic_init to 
PR_Init and PR_SetConcurrency. explaining the extra NSPR threads when 
running in SSL mode. From further reading about NSPR, I'm starting to 
get the impression that there's a "proper" usage model for the LDAP SDK. 
I'd never noticed anything about this in the docs, but if any of you can 
point me to a relevant section, I'd appreciate it.

Can any of you confirm whether the following usage is ok:

MAIN APP START
     - ldapssl_advclientauth_init()

START THREAD X
     - either call ldapssl_init or ldap_init
     - ldap_simple_bind
     - exit thread X

START THREAD Y
     - execute LDAP queries
     - exit thread Y

START THREAD Z
     - ldap_unbind
     - ldapssl_shutdown (only if I was using SSL)

MAIN APP EXIT
     - do nothing

I guess I'm just asking whether ldapssl_advclientauth_init should always 
be called during my main app startup in the main thread, regardless of 
whether I'm planning to use SSL or not? Then, as my app runs and I 
periodically connect or disconnect from the LDAP server, does the 
sequence between threads X, Y, and Z make sense? And lastly, I can't 
find any sort of special cleanup in the LDAP SDK to do on app exit. Is 
there something recommended that I do?

I appreciate the guidance!

- Matthew