X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl.c;h=52653fb08153da48af465d304ce9e66c1bc912dc;hb=ecbcaadde7dff838f09dfb04c7eb90f126e35abf;hp=280e61c8649ae70a0f2bc99658aeed5659e71e5a;hpb=c27675331d874c85625d2e64ebcc229db588c5f2;p=collectd.git diff --git a/src/curl.c b/src/curl.c index 280e61c8..52653fb0 100644 --- a/src/curl.c +++ b/src/curl.c @@ -569,6 +569,7 @@ static int cc_init (void) /* {{{ */ INFO ("curl plugin: No pages have been defined."); return (-1); } + curl_global_init (CURL_GLOBAL_SSL); return (0); } /* }}} int cc_init */ @@ -586,7 +587,8 @@ static void cc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */ sstrncpy (vl.plugin, "curl", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance)); sstrncpy (vl.type, wm->type, sizeof (vl.type)); - sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance)); + if (wm->instance != NULL) + sstrncpy (vl.type_instance, wm->instance, sizeof (vl.type_instance)); plugin_dispatch_values (&vl); } /* }}} void cc_submit */ @@ -678,6 +680,7 @@ static int cc_read_page (web_page_t *wp) /* {{{ */ } cc_submit (wp, wm, mv); + match_value_reset (mv); } /* for (wm = wp->matches; wm != NULL; wm = wm->next) */ return (0);