openldap: tell libldap to automatically restart reconnections
authorMarc Fournier <marc.fournier@camptocamp.com>
Fri, 16 Oct 2015 07:34:14 +0000 (09:34 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 16 Oct 2015 09:53:48 +0000 (11:53 +0200)
src/openldap.c

index dacb719..ebaab13 100644 (file)
@@ -98,6 +98,8 @@ static int cldap_init_host (cldap_t *st) /* {{{ */
        ldap_set_option (st->ld, LDAP_OPT_TIMEOUT,
                &(const struct timeval){st->timeout, 0});
 
+       ldap_set_option (st->ld, LDAP_OPT_RESTART, LDAP_OPT_ON);
+
        if (st->cacert != NULL)
                ldap_set_option (st->ld, LDAP_OPT_X_TLS_CACERTFILE, st->cacert);