From 3ea3b96ec7fe3e2f907bfe6e471d1eaf35b49eee Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 29 Aug 2010 09:50:59 +0200 Subject: [PATCH] perl plugin: Remove deprecated compatibility code from "Collectd_plugin_dispatch_values". --- src/collectd-perl.pod | 5 ----- src/perl.c | 21 +++++---------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/collectd-perl.pod b/src/collectd-perl.pod index 5c11b652..bacf8850 100644 --- a/src/collectd-perl.pod +++ b/src/collectd-perl.pod @@ -376,11 +376,6 @@ is found (and the number of values matches the number of data-sources) then the type, data-set and value-list is passed to all write-callbacks that are registered with the daemon. -B: Prior to version 4.4 of collectd, the data-set type used to be passed -as the first argument to B. This syntax is still supported -for backwards compatibility but has been deprecated and will be removed in -some future version of collectd. - =item B ([B => I<...>][, B => I<...>], B => I<...>) diff --git a/src/perl.c b/src/perl.c index a2f5da29..afb3ba7e 100644 --- a/src/perl.c +++ b/src/perl.c @@ -1610,40 +1610,29 @@ static XS (Collectd_plugin_unregister_ds) static XS (Collectd_plugin_dispatch_values) { SV *values = NULL; - int values_idx = 0; int ret = 0; dXSARGS; - if (2 == items) { - log_warn ("Collectd::plugin_dispatch_values with two arguments " - "is deprecated - pass the type through values->{type}."); - values_idx = 1; - } - else if (1 != items) { + if (1 != items) { log_err ("Usage: Collectd::plugin_dispatch_values(values)"); XSRETURN_EMPTY; } log_debug ("Collectd::plugin_dispatch_values: values=\"%s\"", - SvPV_nolen (ST (values_idx))); + SvPV_nolen (ST (/* stack index = */ 0))); - values = ST (values_idx); + values = ST (/* stack index = */ 0); + /* Make sure the argument is a hash reference. */ if (! (SvROK (values) && (SVt_PVHV == SvTYPE (SvRV (values))))) { log_err ("Collectd::plugin_dispatch_values: Invalid values."); XSRETURN_EMPTY; } - if (((2 == items) && (NULL == ST (0))) || (NULL == values)) - XSRETURN_EMPTY; - - if ((2 == items) && (NULL == hv_store ((HV *)SvRV (values), "type", 4, - newSVsv (ST (0)), 0))) { - log_err ("Collectd::plugin_dispatch_values: Could not store type."); + if (NULL == values) XSRETURN_EMPTY; - } ret = pplugin_dispatch_values (aTHX_ (HV *)SvRV (values)); -- 2.11.0