On Mon, Aug 05, 2002 at 11:28:58PM -0400, Sam Varshavchik wrote:
Eric AUGE writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Sam,
I sent you a mail few days ago, about a quick patch i've done
to allow 'hostname' keyword to handle more than one server in the
LDAP part of the code. (i.e. hostname ldapserv1,ldapserv2,ldapserv3,ldapserv4).
This patch adds a fallback on the next server in the list if the previous
one doesn't answer and if timeout elapsed, the code browse the server list
'retry' times before returning 'user unknown' (new keyword in
maildropldap.config -> 'retry').
You are reinventing the wheel.
ldap_init is already capable of using fallback servers if the hostname
parameter contains a whitespace-separated list of hostnames.
So all you need to do is modify ldap_get_config to be a bit smarter about
parsing the config file.
Surely you mean get_ldap_config?
It is not even necessary to modify that if you comma delimit.
According to the OpenLDAP source (I can't speak for other
implementations) the list of hosts can be space or comma delimited.
The only real functionality the patch adds is the option to retry and a
little bit of extra error logging.