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