SPEC (redirect_time, "RedirectTime", dispatch_gauge, "duration", CURLINFO_REDIRECT_TIME),
SPEC (redirect_count, "RedirectCount", dispatch_size, "count", CURLINFO_REDIRECT_COUNT),
SPEC (num_connects, "NumConnects", dispatch_size, "count", CURLINFO_NUM_CONNECTS),
SPEC (redirect_time, "RedirectTime", dispatch_gauge, "duration", CURLINFO_REDIRECT_TIME),
SPEC (redirect_count, "RedirectCount", dispatch_size, "count", CURLINFO_REDIRECT_COUNT),
SPEC (num_connects, "NumConnects", dispatch_size, "count", CURLINFO_NUM_CONNECTS),
SPEC (appconnect_time, "AppconnectTime", dispatch_gauge, "duration", CURLINFO_APPCONNECT_TIME),
SPEC (appconnect_time, "AppconnectTime", dispatch_gauge, "duration", CURLINFO_APPCONNECT_TIME),
for (field = 0; field < STATIC_ARRAY_SIZE (field_specs); ++field) {
if (! strcasecmp (c->key, field_specs[field].config_key))
break;
for (field = 0; field < STATIC_ARRAY_SIZE (field_specs); ++field) {
if (! strcasecmp (c->key, field_specs[field].config_key))
break;
- if ((c->values_num != 1)
- || ((c->values[0].type != OCONFIG_TYPE_STRING)
- && (c->values[0].type != OCONFIG_TYPE_BOOLEAN))) {
- ERROR ("curl stats: `%s' expects a single boolean argument", c->key);
+
+ if (cf_util_get_boolean (c, &enabled) != 0) {
} /* curl_stats_destroy */
int curl_stats_dispatch (curl_stats_t *s, CURL *curl,
} /* curl_stats_destroy */
int curl_stats_dispatch (curl_stats_t *s, CURL *curl,
- const char *hostname, const char *plugin, const char *plugin_instance,
- const char *instance_prefix)
+ const char *hostname, const char *plugin, const char *plugin_instance)
+ if ((curl == NULL) || (hostname == NULL) || (plugin == NULL))
+ {
+ ERROR ("curl stats: dispatch() called with missing arguments "
+ "(curl=%p; hostname=%s; plugin=%s)", curl,
+ hostname == NULL ? "<NULL>" : hostname,
+ plugin == NULL ? "<NULL>" : plugin);
- if (hostname != NULL)
- sstrncpy (vl.host, hostname, sizeof (vl.host));
- if (plugin != NULL)
- sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
+ sstrncpy (vl.host, hostname, sizeof (vl.host));
+ sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
- ssnprintf (vl.type_instance, sizeof (vl.type_instance), "%s%s",
- instance_prefix ? instance_prefix : "", field_specs[field].name);
+ sstrncpy (vl.type_instance, field_specs[field].name, sizeof (vl.type_instance));