X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcurl.c;h=ae2383459db9f54ae78383cf21cdf2f0f9e8c37f;hb=23e91d536b2f50d09c1361c697a6db371efcc6c3;hp=280e61c8649ae70a0f2bc99658aeed5659e71e5a;hpb=38d06a8f868293466f4eee943555c65457a5e560;p=collectd.git diff --git a/src/curl.c b/src/curl.c index 280e61c8..ae238345 100644 --- a/src/curl.c +++ b/src/curl.c @@ -364,8 +364,7 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */ curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1L); curl_easy_setopt (wp->curl, CURLOPT_WRITEFUNCTION, cc_curl_callback); curl_easy_setopt (wp->curl, CURLOPT_WRITEDATA, wp); - curl_easy_setopt (wp->curl, CURLOPT_USERAGENT, - PACKAGE_NAME"/"PACKAGE_VERSION); + curl_easy_setopt (wp->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT); curl_easy_setopt (wp->curl, CURLOPT_ERRORBUFFER, wp->curl_errbuf); curl_easy_setopt (wp->curl, CURLOPT_URL, wp->url); curl_easy_setopt (wp->curl, CURLOPT_FOLLOWLOCATION, 1L); @@ -586,7 +585,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 */