From 8e4720f3f09d21b7cf46acda5a5295101b2ece41 Mon Sep 17 00:00:00 2001 From: Fabien Wernli Date: Mon, 28 Nov 2011 10:46:18 +0100 Subject: [PATCH] fix Host config being ignored Change-Id: I8a109818d8a821e2f3e0660fbb6ba1843279fcc2 Signed-off-by: Florian Forster --- src/curl_xml.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/curl_xml.c b/src/curl_xml.c index 052ea1e6..599e18f7 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -419,7 +419,7 @@ static int cx_handle_instance_xpath (xmlXPathContextPtr xpath_ctx, /* {{{ */ 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) { @@ -461,7 +461,7 @@ static int cx_handle_base_xpath (char *plugin_instance, /* {{{ */ 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)); @@ -504,7 +504,7 @@ static int cx_handle_parsed_xml(xmlDocPtr doc, /* {{{ */ 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; -- 2.11.0