projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Auto-Merge pull request #2826 from rpv-tomsk/collectd-master
[collectd.git]
/
src
/
bind.c
diff --git
a/src/bind.c
b/src/bind.c
index
ab501de
..
3a5e3c3
100644
(file)
--- a/
src/bind.c
+++ b/
src/bind.c
@@
-104,25
+104,25
@@
typedef struct list_info_ptr_s list_info_ptr_t;
/* FIXME: Enabled by default for backwards compatibility. */
/* TODO: Remove time parsing code. */
/* FIXME: Enabled by default for backwards compatibility. */
/* TODO: Remove time parsing code. */
-static
_Bool config_parse_time = 1
;
+static
bool config_parse_time = true
;
-static char *url
= NULL
;
+static char *url;
static int global_opcodes = 1;
static int global_qtypes = 1;
static int global_server_stats = 1;
static int global_zone_maint_stats = 1;
static int global_opcodes = 1;
static int global_qtypes = 1;
static int global_server_stats = 1;
static int global_zone_maint_stats = 1;
-static int global_resolver_stats
= 0
;
+static int global_resolver_stats;
static int global_memory_stats = 1;
static int timeout = -1;
static int global_memory_stats = 1;
static int timeout = -1;
-static cb_view_t *views
= NULL
;
-static size_t views_num
= 0
;
+static cb_view_t *views;
+static size_t views_num;
-static CURL *curl
= NULL
;
+static CURL *curl;
-static char *bind_buffer
= NULL
;
-static size_t bind_buffer_size
= 0
;
-static size_t bind_buffer_fill
= 0
;
+static char *bind_buffer;
+static size_t bind_buffer_size;
+static size_t bind_buffer_fill;
static char bind_curl_error[CURL_ERROR_SIZE];
/* Translation table for the `nsstats' values. */
static char bind_curl_error[CURL_ERROR_SIZE];
/* Translation table for the `nsstats' values. */
@@
-908,7
+908,6
@@
static int bind_xml_stats_handle_view(int version, xmlDoc *doc, /* {{{ */
static int bind_xml_stats_search_views(int version, xmlDoc *doc, /* {{{ */
xmlXPathContext *xpathCtx,
static int bind_xml_stats_search_views(int version, xmlDoc *doc, /* {{{ */
xmlXPathContext *xpathCtx,
- xmlNode *statsnode,
time_t current_time) {
xmlXPathContext *view_path_context = xmlXPathNewContext(doc);
if (view_path_context == NULL) {
time_t current_time) {
xmlXPathContext *view_path_context = xmlXPathNewContext(doc);
if (view_path_context == NULL) {
@@
-940,8
+939,7
@@
static int bind_xml_stats_search_views(int version, xmlDoc *doc, /* {{{ */
} /* }}} int bind_xml_stats_search_views */
static void bind_xml_stats_v3(xmlDoc *doc, /* {{{ */
} /* }}} int bind_xml_stats_search_views */
static void bind_xml_stats_v3(xmlDoc *doc, /* {{{ */
- xmlXPathContext *xpathCtx, xmlNode *statsnode,
- time_t current_time) {
+ xmlXPathContext *xpathCtx, time_t current_time) {
/* XPath: server/counters[@type='opcode']
* Variables: QUERY, IQUERY, NOTIFY, UPDATE, ...
* Layout v3:
/* XPath: server/counters[@type='opcode']
* Variables: QUERY, IQUERY, NOTIFY, UPDATE, ...
* Layout v3:
@@
-1059,7
+1057,7
@@
static void bind_xml_stats_v3(xmlDoc *doc, /* {{{ */
} /* }}} bind_xml_stats_v3 */
static void bind_xml_stats_v1_v2(int version, xmlDoc *doc, /* {{{ */
} /* }}} bind_xml_stats_v3 */
static void bind_xml_stats_v1_v2(int version, xmlDoc *doc, /* {{{ */
- xmlXPathContext *xpathCtx,
xmlNode *statsnode,
+ xmlXPathContext *xpathCtx,
time_t current_time) {
/* XPath: server/requests/opcode, server/counters[@type='opcode']
* Variables: QUERY, IQUERY, NOTIFY, UPDATE, ...
time_t current_time) {
/* XPath: server/requests/opcode, server/counters[@type='opcode']
* Variables: QUERY, IQUERY, NOTIFY, UPDATE, ...
@@
-1243,9
+1241,9
@@
static int bind_xml_stats(int version, xmlDoc *doc, /* {{{ */
DEBUG("bind plugin: Current server time is %i.", (int)current_time);
if (version == 3) {
DEBUG("bind plugin: Current server time is %i.", (int)current_time);
if (version == 3) {
- bind_xml_stats_v3(doc, xpathCtx,
statsnode,
current_time);
+ bind_xml_stats_v3(doc, xpathCtx, current_time);
} else {
} else {
- bind_xml_stats_v1_v2(version, doc, xpathCtx,
statsnode,
current_time);
+ bind_xml_stats_v1_v2(version, doc, xpathCtx, current_time);
}
/* XPath: memory/summary
}
/* XPath: memory/summary
@@
-1271,8
+1269,7
@@
static int bind_xml_stats(int version, xmlDoc *doc, /* {{{ */
}
if (views_num > 0)
}
if (views_num > 0)
- bind_xml_stats_search_views(version, doc, xpathCtx, statsnode,
- current_time);
+ bind_xml_stats_search_views(version, doc, xpathCtx, current_time);
return 0;
} /* }}} int bind_xml_stats */
return 0;
} /* }}} int bind_xml_stats */
@@
-1567,9
+1564,8
@@
static int bind_init(void) /* {{{ */
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
#ifdef HAVE_CURLOPT_TIMEOUT_MS
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS,
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
#ifdef HAVE_CURLOPT_TIMEOUT_MS
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS,
- (timeout >= 0)
- ? (long)timeout
- : (long)CDTIME_T_TO_MS(plugin_get_interval()));
+ (timeout >= 0) ? (long)timeout : (long)CDTIME_T_TO_MS(
+ plugin_get_interval()));
#endif
return 0;
#endif
return 0;