summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dce4923)
raw | patch | inline | side by side (parent: dce4923)
author | Fabien Wernli <cpan@faxm0dem.org> | |
Mon, 28 Nov 2011 09:46:18 +0000 (10:46 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 13 Sep 2012 08:48:44 +0000 (10:48 +0200) |
Change-Id: I8a109818d8a821e2f3e0660fbb6ba1843279fcc2
Signed-off-by: Florian Forster <octo@collectd.org>
Signed-off-by: Florian Forster <octo@collectd.org>
src/curl_xml.c | patch | blob | history |
diff --git a/src/curl_xml.c b/src/curl_xml.c
index 052ea1e61244d92d509501ea0daf800f19f454f3..599e18f7153948c51c8042393a4157b1ba5f6211 100644 (file)
--- a/src/curl_xml.c
+++ b/src/curl_xml.c
return (0);
} /* }}} int cx_handle_instance_xpath */
-static int cx_handle_base_xpath (char *plugin_instance, /* {{{ */
+static int cx_handle_base_xpath (char *plugin_instance, char *host, /* {{{ */
xmlXPathContextPtr xpath_ctx, const data_set_t *ds,
char *base_xpath, cx_xpath_t *xpath)
{
vl.values_len = ds->ds_num;
sstrncpy (vl.type, xpath->type, sizeof (vl.type));
sstrncpy (vl.plugin, "curl_xml", sizeof (vl.plugin));
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+ sstrncpy (vl.host, (host == NULL) ? hostname_g : host, sizeof (vl.host));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
ds = plugin_get_ds (xpath->type);
if ( (cx_check_type(ds, xpath) == 0) &&
- (cx_handle_base_xpath(db->instance, xpath_ctx, ds, le->key, xpath) == 0) )
+ (cx_handle_base_xpath(db->instance, db->host, xpath_ctx, ds, le->key, xpath) == 0) )
status = 0; /* we got atleast one success */
le = le->next;