X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl_json.c;h=a4afa02e4c70da022e4ad8487d6208f9205a9fff;hb=96e0f2341bace029acefe0a88bab96ae326c0ff5;hp=89fce164e02b0bdd96855a6a670ffa7d5dd810b5;hpb=d130204df3256c39e104aa9a4346d116458c745e;p=collectd.git diff --git a/src/curl_json.c b/src/curl_json.c index 89fce164..a4afa02e 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -48,10 +48,10 @@ struct cj_key_s; typedef struct cj_key_s cj_key_t; struct cj_key_s /* {{{ */ { + unsigned long magic; char *path; char *type; char *instance; - unsigned long magic; }; /* }}} */ @@ -857,9 +857,18 @@ static int cj_read (user_data_t *ud) /* {{{ */ return cj_curl_perform (db, db->curl); } /* }}} int cj_read */ +static int cj_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 cj_init */ + void module_register (void) { plugin_register_complex_config ("curl_json", cj_config); + plugin_register_init ("curl_json", cj_init); } /* void module_register */ /* vim: set sw=2 sts=2 et fdm=marker : */