]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
updates based on review comments 3265/head
authorNelson <nyen@salesforce.com>
Thu, 5 Dec 2019 18:01:22 +0000 (10:01 -0800)
committerNelson <nyen@salesforce.com>
Thu, 5 Dec 2019 18:04:02 +0000 (10:04 -0800)
src/collectd.conf.pod
src/write_http.c

index e51396e0ed3b402d87def0df48ae27a343d745ce..5a4a758cd77425a0d2e5581ad04a8bd3aea6f523 100644 (file)
@@ -10132,17 +10132,18 @@ which means the connection never times out.
 
 Enables printing of HTTP error code to log. Turned off by default.
 
+=item E<lt>B<Statistics> I<Name>E<gt>
+
+One B<Statistics> 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<write_http> 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<BufferSize>. The optimal value to set B<Timeout> to is
 slightly below this interval, which you can estimate by monitoring the network
 traffic between collectd and the HTTP server.
 
-=item B<E<lt>StatisticsE<gt>>
-
-One B<Statistics> 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
 
index 502845b785ca85cb2a76e4b5e921ba01fc6d57fd..89e7f37ab146182d80eabc06634338dffa3a38e3 100644 (file)
@@ -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);