projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial support of GPSd in collectd.
[collectd.git]
/
src
/
curl_json.c
diff --git
a/src/curl_json.c
b/src/curl_json.c
index
5128c87
..
3ba5560
100644
(file)
--- a/
src/curl_json.c
+++ b/
src/curl_json.c
@@
-503,6
+503,7
@@
static int cj_config_add_key (cj_t *db, /* {{{ */
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_key_free (key);
return (-1);
}
return (-1);
}
@@
-552,7
+553,6
@@
static int cj_config_add_key (cj_t *db, /* {{{ */
db->tree = cj_avl_create();
tree = db->tree;
db->tree = cj_avl_create();
tree = db->tree;
- name = key->path;
ptr = key->path;
if (*ptr == '/')
++ptr;
ptr = key->path;
if (*ptr == '/')
++ptr;
@@
-651,6
+651,7
@@
static int cj_init_curl (cj_t *db) /* {{{ */
if (db->post_body != NULL)
curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
if (db->post_body != NULL)
curl_easy_setopt (db->curl, CURLOPT_POSTFIELDS, db->post_body);
+#ifdef HAVE_CURLOPT_TIMEOUT_MS
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else if (db->interval > 0)
if (db->timeout >= 0)
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS, (long) db->timeout);
else if (db->interval > 0)
@@
-659,6
+660,7
@@
static int cj_init_curl (cj_t *db) /* {{{ */
else
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
else
curl_easy_setopt (db->curl, CURLOPT_TIMEOUT_MS,
CDTIME_T_TO_MS(plugin_get_interval()));
+#endif
return (0);
} /* }}} int cj_init_curl */
return (0);
} /* }}} int cj_init_curl */
@@
-695,6
+697,7
@@
static int cj_config_add_url (oconfig_item_t *ci) /* {{{ */
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
{
ERROR ("curl_json plugin: cj_config: "
"Invalid key: %s", ci->key);
+ cj_free (db);
return (-1);
}
if (status != 0)
return (-1);
}
if (status != 0)