summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b622ba0)
raw | patch | inline | side by side (parent: b622ba0)
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 253ca27d9fda5ffafdfdd9f059b600b7b3be2b10..87907c030d989de5fc5b6164ecb27ff90bdbdbba 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
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);
{
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)
{
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)
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;