From: Nelson Date: Thu, 5 Dec 2019 18:01:22 +0000 (-0800) Subject: updates based on review comments X-Git-Tag: collectd-5.11.0~46^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F3265%2Fhead;p=thirdparty%2Fcollectd.git updates based on review comments --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index e51396e0e..5a4a758cd 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -10132,17 +10132,18 @@ which means the connection never times out. Enables printing of HTTP error code to log. Turned off by default. +=item EB IE + +One B block can be used to specify cURL statistics to be collected +for each request to the remote URL. See the section "cURL Statistics" above +for details. + The C plugin regularly submits the collected values to the HTTP server. How frequently this happens depends on how much data you are collecting and the size of B. The optimal value to set B to is slightly below this interval, which you can estimate by monitoring the network traffic between collectd and the HTTP server. -=item BStatisticsE> - -One B block can be used to specify cURL statistics to be collected -for each request to the remote URL. See the section "cURL Statistics" above -for details. =back diff --git a/src/write_http.c b/src/write_http.c index 502845b78..89e7f37ab 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -132,8 +132,15 @@ static int wh_post_nolock(wh_callback_t *cb, char const *data) /* {{{ */ wh_log_http_error(cb); - if (cb->curl_stats != NULL) - curl_stats_dispatch(cb->curl_stats, cb->curl, NULL, "write_http", cb->name); + if (cb->curl_stats != NULL) { + int rc = curl_stats_dispatch(cb->curl_stats, cb->curl, NULL, "write_http", + cb->name); + if (rc != 0) { + ERROR("write_http plugin: curl_stats_dispatch failed with " + "status %i", + rc); + } + } if (status != CURLE_OK) { ERROR("write_http plugin: curl_easy_perform failed with " @@ -323,6 +330,7 @@ static void wh_callback_free(void *data) /* {{{ */ } curl_stats_destroy(cb->curl_stats); + cb->curl_stats = NULL; if (cb->headers != NULL) { curl_slist_free_all(cb->headers);