summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 793c204)
raw | patch | inline | side by side (parent: 793c204)
author | Jeremy Katz <jeremy@katzbox.net> | |
Mon, 27 Jan 2014 01:43:19 +0000 (20:43 -0500) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Sat, 29 Mar 2014 12:27:04 +0000 (13:27 +0100) |
Need to call curl_global_init() or curl_easy_init() during init
for plugins when we're still running single threaded. This
updates the remaining ones
for plugins when we're still running single threaded. This
updates the remaining ones
src/curl.c | patch | blob | history | |
src/curl_json.c | patch | blob | history | |
src/curl_xml.c | patch | blob | history | |
src/write_http.c | patch | blob | history |
diff --git a/src/curl.c b/src/curl.c
index 3899aaabc0f2545d775f83b93f7342de845cda52..8d2893f0781f96118ba204279f6120252bb0600f 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
INFO ("curl plugin: No pages have been defined.");
return (-1);
}
+ curl_global_init (CURL_GLOBAL_SSL);
return (0);
} /* }}} int cc_init */
diff --git a/src/curl_json.c b/src/curl_json.c
index 24e1df1e9b016d5086b6efdae445fdc6e9e6b625..0948962614d99e214adf5d66dbfdaf29da2ccec6 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
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 : */
diff --git a/src/curl_xml.c b/src/curl_xml.c
index b941f02a2942a0d07907d1d6169407cbc49de0d6..e31e73d284f06d1a078d00211ef9f9a41b3698ef 100644 (file)
--- a/src/curl_xml.c
+++ b/src/curl_xml.c
return (0);
} /* }}} int cx_config */
+static int cx_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 cx_init */
+
void module_register (void)
{
plugin_register_complex_config ("curl_xml", cx_config);
+ plugin_register_init ("curl_xml", cx_init);
} /* void module_register */
/* vim: set sw=2 sts=2 et fdm=marker : */
diff --git a/src/write_http.c b/src/write_http.c
index 62c73b09835ab6be43c1d6c20d6e25835cb23c4d..04c637b24607eac2810b20bcc7bbd091b915f085 100644 (file)
--- a/src/write_http.c
+++ b/src/write_http.c
return (0);
} /* }}} int wh_config */
+static int wh_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 wh_init */
+
void module_register (void) /* {{{ */
{
plugin_register_complex_config ("write_http", wh_config);
+ plugin_register_init ("write_http", wh_init);
} /* }}} void module_register */
/* vim: set fdm=marker sw=8 ts=8 tw=78 et : */