projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b622ba0
)
curl_json plugin: style cleanups
author
Jim Radford
<radford@galvanix.com>
Thu, 8 Aug 2013 16:33:36 +0000
(09:33 -0700)
committer
Jim Radford
<radford@galvanix.com>
Sat, 10 Aug 2013 19:31:31 +0000
(12:31 -0700)
src/curl_json.c
patch
|
blob
|
history
diff --git
a/src/curl_json.c
b/src/curl_json.c
index
253ca27
..
87907c0
100644
(file)
--- a/
src/curl_json.c
+++ b/
src/curl_json.c
@@
-266,7
+266,8
@@
static int cj_cb_start (void *ctx)
cj_t *db = (cj_t *)ctx;
if (++db->depth >= YAJL_MAX_DEPTH)
{
cj_t *db = (cj_t *)ctx;
if (++db->depth >= YAJL_MAX_DEPTH)
{
- ERROR ("curl_json plugin: %s depth exceeds max, aborting.", db->url ? db->url : db->sock);
+ ERROR ("curl_json plugin: %s depth exceeds max, aborting.",
+ db->url ? db->url : db->sock);
return (CJ_CB_ABORT);
}
return (CJ_CB_CONTINUE);
return (CJ_CB_ABORT);
}
return (CJ_CB_CONTINUE);
@@
-658,8
+659,8
@@
static int cj_config_add_url (oconfig_item_t *ci) /* {{{ */
{
if (db->tree == NULL)
{
{
if (db->tree == NULL)
{
- WARNING ("curl_json plugin: No (valid) `Key' block
"
-
"within `%s' block `%s'.",
db->url ? "URL" : "Sock", db->url ? db->url : db->sock);
+ WARNING ("curl_json plugin: No (valid) `Key' block
within `%s' \"`%s'\".",
+ db->url ? "URL" : "Sock", db->url ? db->url : db->sock);
status = -1;
}
if (status == 0 && db->url)
status = -1;
}
if (status == 0 && db->url)
@@
-712,7
+713,8
@@
static int cj_config (oconfig_item_t *ci) /* {{{ */
{
oconfig_item_t *child = ci->children + i;
{
oconfig_item_t *child = ci->children + i;
- if (strcasecmp ("Sock", child->key) == 0 || strcasecmp ("URL", child->key) == 0)
+ if (strcasecmp ("Sock", child->key) == 0
+ || strcasecmp ("URL", child->key) == 0)
{
status = cj_config_add_url (child);
if (status == 0)
{
status = cj_config_add_url (child);
if (status == 0)
@@
-857,7
+859,11
@@
static int cj_perform (cj_t *db) /* {{{ */
return (-1);
}
return (-1);
}
- if (db->url ? cj_curl_perform (db) < 0 : cj_sock_perform (db) < 0)
+ if (db->url)
+ status = cj_curl_perform (db);
+ else
+ status = cj_sock_perform (db);
+ if (status < 0)
{
yajl_free (db->yajl);
db->yajl = yprev;
{
yajl_free (db->yajl);
db->yajl = yprev;