projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
curl_json.c
diff --git
a/src/curl_json.c
b/src/curl_json.c
index
2dac747
..
d4e7803
100644
(file)
--- a/
src/curl_json.c
+++ b/
src/curl_json.c
@@
-22,6
+22,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "plugin.h"
#include "configfile.h"
#include "common.h"
#include "plugin.h"
#include "configfile.h"
@@
-470,7
+471,6
@@
static int cj_config_add_key (cj_t *db, /* {{{ */
{
cj_key_t *key;
int status;
{
cj_key_t *key;
int status;
- int i;
if ((ci->values_num != 1)
|| (ci->values[0].type != OCONFIG_TYPE_STRING))
if ((ci->values_num != 1)
|| (ci->values[0].type != OCONFIG_TYPE_STRING))
@@
-506,7
+506,7
@@
static int cj_config_add_key (cj_t *db, /* {{{ */
}
status = 0;
}
status = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
@@
-662,7
+662,6
@@
static int cj_config_add_url (oconfig_item_t *ci) /* {{{ */
{
cj_t *db;
int status = 0;
{
cj_t *db;
int status = 0;
- int i;
if ((ci->values_num != 1)
|| (ci->values[0].type != OCONFIG_TYPE_STRING))
if ((ci->values_num != 1)
|| (ci->values[0].type != OCONFIG_TYPE_STRING))
@@
-699,7
+698,7
@@
static int cj_config_add_url (oconfig_item_t *ci) /* {{{ */
}
/* Fill the `cj_t' structure.. */
}
/* Fill the `cj_t' structure.. */
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
@@
-795,12
+794,11
@@
static int cj_config (oconfig_item_t *ci) /* {{{ */
int success;
int errors;
int status;
int success;
int errors;
int status;
- int i;
success = 0;
errors = 0;
success = 0;
errors = 0;
- for (i = 0; i < ci->children_num; i++)
+ for (i
nt i
= 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
@@
-849,8
+847,8
@@
static void cj_submit (cj_t *db, cj_key_t *key, value_t *value) /* {{{ */
if (key->instance == NULL)
{
if (key->instance == NULL)
{
- int
i,
len = 0;
- for (i = 0; i < db->depth; i++)
+ int len = 0;
+ for (i
nt i
= 0; i < db->depth; i++)
len += ssnprintf(vl.type_instance+len, sizeof(vl.type_instance)-len,
i ? "-%s" : "%s", db->state[i+1].name);
}
len += ssnprintf(vl.type_instance+len, sizeof(vl.type_instance)-len,
i ? "-%s" : "%s", db->state[i+1].name);
}