summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 67e5482)
raw | patch | inline | side by side (parent: 67e5482)
author | Marc Fournier <marc.fournier@camptocamp.com> | |
Wed, 20 Aug 2014 10:13:31 +0000 (12:13 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 29 Aug 2014 13:09:55 +0000 (15:09 +0200) |
src/collectd.conf.pod | patch | blob | history | |
src/openldap.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index a296170253f75629b9b0baf2ad5ba0dc3812f105..74fb19fee78ac558f2459cacbace211e832ebd0a 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
@@ -4278,6 +4278,11 @@ File that holds one or more SSL certificates. If you want to use TLS/SSL you may
possibly need this option. What CA certificates come bundled with C<libldap>
and are checked by default depends on the distribution you use.
+=item B<Timeout> I<Seconds>
+
+Set the timeout value for ldap operations. Defaults to B<-1> which results in
+an infinite timeout.
+
=back
=head2 Plugin C<openvpn>
diff --git a/src/openldap.c b/src/openldap.c
index 9763a06c59865af94ffbcf38e0f878f041ea3330..08c65033e07f9906c865bc65110e1a24f7ecbb26 100644 (file)
--- a/src/openldap.c
+++ b/src/openldap.c
ldap_set_option (st->ld, LDAP_OPT_PROTOCOL_VERSION, &st->version);
+ ldap_set_option (st->ld, LDAP_OPT_TIMEOUT,
+ &(const struct timeval){st->timeout, 0});
+
if(st->cacert != NULL)
ldap_set_option (st->ld, LDAP_OPT_X_TLS_CACERTFILE, st->cacert);
return (status);
}
+ st->timeout = -1;
st->verifyhost = 1;
st->version = LDAP_VERSION3;