]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/collectd/0007-apache-plugin-Call-curl_global_init-from-the-init-fu.patch
pakfire: use correct tree on x86_64.
[ipfire-2.x.git] / src / patches / collectd / 0007-apache-plugin-Call-curl_global_init-from-the-init-fu.patch
CommitLineData
2056dd30
AM
1From 5f2f969335757f31f42cd8bb7e38eb8c5fe5e56e Mon Sep 17 00:00:00 2001
2From: Florian Forster <octo@collectd.org>
3Date: Wed, 15 Jan 2014 23:47:33 +0100
4Subject: [PATCH 07/22] apache plugin: Call curl_global_init() from the init
5 function.
6
7This is a shot in the dark in trying to address #513. By calling this
8from an init() callback, I hope to be initializing the curl and gcrypt
9libraries before collectd becomes multi-threaded, avoiding the problems
10described in the issue.
11---
12 src/apache.c | 9 +++++++++
13 1 file changed, 9 insertions(+)
14
15diff --git a/src/apache.c b/src/apache.c
16index 899c21e..23bba3e 100644
17--- a/src/apache.c
18+++ b/src/apache.c
19@@ -702,9 +702,18 @@ static int apache_read_host (user_data_t *user_data) /* {{{ */
20 return (0);
21 } /* }}} int apache_read_host */
22
23+static int apache_init (void) /* {{{ */
24+{
25+ /* Call this while collectd is still single-threaded to avoid
26+ * initialization issues in libgcrypt. */
27+ curl_global_init (CURL_GLOBAL_SSL);
28+ return (0);
29+} /* }}} int apache_init */
30+
31 void module_register (void)
32 {
33 plugin_register_complex_config ("apache", config);
34+ plugin_register_init ("apache", apache_init);
35 } /* void module_register */
36
37 /* vim: set sw=8 noet fdm=marker : */
38--
391.9.3
40