I'm trying to get my code to rebind appropriately when it's automatically chasing referrals, but I'm running into a strange problem.
I bind to server A, which returns me a referral to server B.
My rebind proc is called, which tries to bind to server B. That succeeds, and (accoring to Wireshark) I get a couple referrals. (DomainDnsZones, ForestDnsZones, and server C).
Then my rebind proc is called to bind to server C, but then recursively it is called (on the same thread, says pthread_self) to bind to DomainDnsZones, and then recursively again it is called to bind to ForestDnsZones, which is where my code hangs for at least 5 minutes before I kill it. My rebind proc is calling ldap_sasl_bind_s, which seems to be what is then re-calling my rebind proc in each case.
The problem is that my code hangs in one of the ldap_sasl_bind_s calls, and never returns, but Wireshark shows that it successfully binds to all thee of the referred servers.
I'm using openldap-2.3.24.
My questions are: - Is my rebind proc correct? It seems that calling ldap_sasl_bind_s is correct and allowed. - Was there a bug that has been fixed since 2.3.24 in direct regard to rebinding? - Any tips or hints on what could be hanging up the code?
Thanks, - Jeremiah