Code

write_http plugin: Don't register a flush callback unconditionally.
authorFlorian Forster <octo@collectd.org>
Wed, 28 Sep 2016 15:53:34 +0000 (17:53 +0200)
committerFlorian Forster <octo@collectd.org>
Wed, 28 Sep 2016 15:53:34 +0000 (17:53 +0200)
Fixes: #1955
src/write_http.c

index 41615d3f0ccbd0be9c1cefba46708a4ace10e680..4a5818c76bc13f824cb8270b169bcedf75cbc27b 100644 (file)
@@ -817,13 +817,10 @@ static int wh_config_node (oconfig_item_t *ci) /* {{{ */
                         callback_name, cb->location);
 
         user_data_t user_data = {
-                .data = cb
+                .data = cb,
+                .free_func = wh_callback_free,
         };
 
-        plugin_register_flush (callback_name, wh_flush, &user_data);
-
-        user_data.free_func = wh_callback_free;
-
         if (cb->send_metrics)
         {
                 plugin_register_write (callback_name, wh_write, &user_data);