Anton Bobrov wrote:

consequences. My main concern is we pass in two LDAP servers when we init the LDAP connection (in ldap_init). During a failover, if I don't re-init the connection object and just re-issue the rebind command, is the code smart enough to try both servers still?

the code will behave exactly as it does on the initial bind. reconnect
option lets you dispose of dead default connection object and open a
new default connection. the hostlist is still effective so if your
hostlist says "host_A host_B" it will try to connect to host_A and if
that fails [ due to connect timeout you set or OS defined timeout ]
then the host_B will be tried next. just remember that the only
request you can issue at this point is bind request.

I also was curious how well this failover method works when using the ssl ldap_init functions. Does it work the same way...I only have to issue my rebind command and not worry about re-initing the connection object? And again, will it still try both hosts I originally passed in during the init?

exactly the same. if there any glitches please file bugs as appropriate.


Hmm, I tried using the RECONNECT option with the ssl calls and none of of my apps would reconnect. The basic structure of the logic is below:

myConnected = false;  // set once during startup

...

private connect() {
  if(!myConnected) {

    ldapssl_clientauth_init();

    ldapssl_init();

    set RECONNECT option;

    set ldap v3 option;

    ldapssl_enable_clientauth();

    myConnected = true;
  }

  ldap_sasl_bind_s();
}

So basically whenever I detect the disconnection, the code will call connect() to rebind. The problem I'm seeing is, after the initial connection, anytime it hits that ldap_sasl_bind_s() call it gives me "Encoding error (83)". I've tried adding in a regular ldap_simple_bind_s(NULL, NULL) before the sasl bind to do an anonymous bind first, but it gives me Cannot connect error. I was under the impression I only needed to do the bind (simple or sasl) after the disconnect to get going again, but this doesn't work.

On an aside, I'm using whichever version of the SDK that ships with iPlanet SDRK 5.2. Perhaps this has been fixed in a later version?

Thanks, Mike
_______________________________________________
dev-tech-ldap mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-ldap

Reply via email to