From 5f2f969335757f31f42cd8bb7e38eb8c5fe5e56e Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 15 Jan 2014 23:47:33 +0100 Subject: [PATCH] apache plugin: Call curl_global_init() from the init function. This is a shot in the dark in trying to address #513. By calling this from an init() callback, I hope to be initializing the curl and gcrypt libraries before collectd becomes multi-threaded, avoiding the problems described in the issue. --- src/apache.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/apache.c b/src/apache.c index 899c21ee..23bba3ea 100644 --- a/src/apache.c +++ b/src/apache.c @@ -702,9 +702,18 @@ static int apache_read_host (user_data_t *user_data) /* {{{ */ return (0); } /* }}} int apache_read_host */ +static int apache_init (void) /* {{{ */ +{ + /* Call this while collectd is still single-threaded to avoid + * initialization issues in libgcrypt. */ + curl_global_init (CURL_GLOBAL_SSL); + return (0); +} /* }}} int apache_init */ + void module_register (void) { plugin_register_complex_config ("apache", config); + plugin_register_init ("apache", apache_init); } /* void module_register */ /* vim: set sw=8 noet fdm=marker : */ -- 2.11.0