From: Ruben Kerkhof Date: Fri, 7 Jul 2017 16:43:39 +0000 (+0200) Subject: Merge branch 'collectd-5.7' X-Git-Tag: collectd-5.8.0~126 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9655d4a6d9fa2c4f02032759b831e93933d68bd9;p=collectd.git Merge branch 'collectd-5.7' Fixes #2328 Conflicts: src/curl_json.c src/curl_xml.c --- 9655d4a6d9fa2c4f02032759b831e93933d68bd9 diff --cc src/apache.c index e2f75c18,29c36cc0..92c2c8be --- a/src/apache.c +++ b/src/apache.c @@@ -510,9 -509,12 +509,12 @@@ static int apache_read_host(user_data_ assert(st->curl != NULL); st->apache_buffer_fill = 0; + + curl_easy_setopt(st->curl, CURLOPT_URL, st->url); + if (curl_easy_perform(st->curl) != CURLE_OK) { ERROR("apache: curl_easy_perform failed: %s", st->apache_curl_error); - return (-1); + return -1; } /* fallback - server_type to apache if not set at this time */ diff --cc src/ascent.c index 16f91046,74cef333..40b15369 --- a/src/ascent.c +++ b/src/ascent.c @@@ -554,9 -553,12 +553,12 @@@ static int ascent_read(void) /* {{{ * } ascent_buffer_fill = 0; + + curl_easy_setopt(curl, CURLOPT_URL, url); + if (curl_easy_perform(curl) != CURLE_OK) { ERROR("ascent plugin: curl_easy_perform failed: %s", ascent_curl_error); - return (-1); + return -1; } status = ascent_xml(ascent_buffer); diff --cc src/bind.c index b7308ad8,8a3148cc..824d0447 --- a/src/bind.c +++ b/src/bind.c @@@ -1620,9 -1619,12 +1619,12 @@@ static int bind_read(void) /* {{{ * } bind_buffer_fill = 0; + + curl_easy_setopt(curl, CURLOPT_URL, (url != NULL) ? url : BIND_DEFAULT_URL); + if (curl_easy_perform(curl) != CURLE_OK) { ERROR("bind plugin: curl_easy_perform failed: %s", bind_curl_error); - return (-1); + return -1; } status = bind_xml(bind_buffer); diff --cc src/curl_json.c index 8037742a,8f6382b8..cc5600f3 --- a/src/curl_json.c +++ b/src/curl_json.c @@@ -863,8 -846,8 +863,8 @@@ static int cj_curl_perform(cj_t *db) / status = curl_easy_perform(db->curl); if (status != CURLE_OK) { ERROR("curl_json plugin: curl_easy_perform failed with status %i: %s (%s)", - status, db->curl_errbuf, url); + status, db->curl_errbuf, db->url); - return (-1); + return -1; } if (db->stats != NULL) curl_stats_dispatch(db->stats, db->curl, cj_host(db), "curl_json", diff --cc src/curl_xml.c index a0dca05e,7c422c71..43561a83 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@@ -608,8 -610,8 +610,8 @@@ static int cx_curl_perform(cx_t *db, CU status = curl_easy_perform(curl); if (status != CURLE_OK) { ERROR("curl_xml plugin: curl_easy_perform failed with status %i: %s (%s)", - status, db->curl_errbuf, url); + status, db->curl_errbuf, db->url); - return (-1); + return -1; } if (db->stats != NULL) curl_stats_dispatch(db->stats, db->curl, cx_host(db), "curl_xml", diff --cc src/nginx.c index 0f1da0ae,060eae23..c7e8a08e --- a/src/nginx.c +++ b/src/nginx.c @@@ -202,14 -198,17 +198,17 @@@ static int nginx_read(void) int fields_num; if (curl == NULL) - return (-1); + return -1; if (url == NULL) - return (-1); + return -1; nginx_buffer_len = 0; + + curl_easy_setopt(curl, CURLOPT_URL, url); + if (curl_easy_perform(curl) != CURLE_OK) { WARNING("nginx plugin: curl_easy_perform failed: %s", nginx_curl_error); - return (-1); + return -1; } ptr = nginx_buffer;