projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1047e1d
)
curl_xml plugin: Documented the type-instance behavior a bit better.
author
Florian Forster
<octo@huhu.verplant.org>
Mon, 11 Jan 2010 15:52:25 +0000
(16:52 +0100)
committer
Florian Forster
<octo@huhu.verplant.org>
Mon, 11 Jan 2010 15:52:25 +0000
(16:52 +0100)
src/curl_xml.c
patch
|
blob
|
history
diff --git
a/src/curl_xml.c
b/src/curl_xml.c
index
3b0a71a
..
74ef2e8
100644
(file)
--- a/
src/curl_xml.c
+++ b/
src/curl_xml.c
@@
-346,10
+346,14
@@
static int cx_handle_instance_xpath (xmlXPathContextPtr xpath_ctx, /* {{{ */
memset (vl->type_instance, 0, sizeof (vl->type_instance));
memset (vl->type_instance, 0, sizeof (vl->type_instance));
+ /* If the base xpath returns more than one block, the result is assumed to be
+ * a table. The `Instnce' option is not optional in this case. Check for the
+ * condition and inform the user. */
if (is_table && (vl->type_instance == NULL))
{
WARNING ("curl_xml plugin: "
if (is_table && (vl->type_instance == NULL))
{
WARNING ("curl_xml plugin: "
- "Base-XPath %s is a table, but no instance-XPath has been defined.",
+ "Base-XPath %s is a table (more than one result was returned), "
+ "but no instance-XPath has been defined.",
xpath->path);
return (-1);
}
xpath->path);
return (-1);
}
@@
-474,7
+478,7
@@
static int cx_handle_base_xpath (char *plugin_instance, /* {{{ */
xpath_ctx->node = base_nodes->nodeTab[i];
status = cx_handle_instance_xpath (xpath_ctx, xpath, &vl,
xpath_ctx->node = base_nodes->nodeTab[i];
status = cx_handle_instance_xpath (xpath_ctx, xpath, &vl,
- /* is_table = */ (total_nodes > 1));
/* FIXME */
+ /* is_table = */ (total_nodes > 1));
if (status != 0)
continue; /* An error has already been reported. */
if (status != 0)
continue; /* An error has already been reported. */