summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-12-04 08:01:11 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-04 08:01:11 -0600
commit9e9dccd293301ff0b26fb1ae0c88f4fa23db41cd (patch)
treed661d14c8ec395428fbd70da925c465b2303be74 /main
parent59bb2c192008016b3b84b54052d10d841fc9a367 (diff)
parent077ceacd48b796933dd22198beefcacfe6f8ff0f (diff)
Merge "config: Speed up ACO & sorcery initialization" into 13
Diffstat (limited to 'main')
-rw-r--r--main/config_options.c6
-rw-r--r--main/xml.c3
2 files changed, 6 insertions, 3 deletions
diff --git a/main/config_options.c b/main/config_options.c
index 484eaf6e4..f52d3c410 100644
--- a/main/config_options.c
+++ b/main/config_options.c
@@ -1000,11 +1000,11 @@ static int xmldoc_update_config_type(const char *module, const char *name, const
/* If we already have a syntax element, bail. This isn't an error, since we may unload a module which
* has updated the docs and then load it again. */
- if ((results = ast_xmldoc_query("//configInfo[@name='%s']/*/configObject[@name='%s']/syntax", module, name))) {
+ if ((results = ast_xmldoc_query("/docs/configInfo[@name='%s']/configFile/configObject[@name='%s']/syntax", module, name))) {
return 0;
}
- if (!(results = ast_xmldoc_query("//configInfo[@name='%s']/*/configObject[@name='%s']", module, name))) {
+ if (!(results = ast_xmldoc_query("/docs/configInfo[@name='%s']/configFile/configObject[@name='%s']", module, name))) {
ast_log(LOG_WARNING, "Cannot update type '%s' in module '%s' because it has no existing documentation!\n", name, module);
return XMLDOC_STRICT ? -1 : 0;
}
@@ -1070,7 +1070,7 @@ static int xmldoc_update_config_option(struct aco_type **types, const char *modu
return XMLDOC_STRICT ? -1 : 0;
}
- if (!(results = ast_xmldoc_query("//configInfo[@name='%s']/*/configObject[@name='%s']/configOption[@name='%s']", module, object_name, name))) {
+ if (!(results = ast_xmldoc_query("/docs/configInfo[@name='%s']/configFile/configObject[@name='%s']/configOption[@name='%s']", module, object_name, name))) {
ast_log(LOG_WARNING, "Could not find option '%s' with type '%s' in module '%s'\n", name, object_name, module);
return XMLDOC_STRICT ? -1 : 0;
}
diff --git a/main/xml.c b/main/xml.c
index dee249711..bd82b5cbf 100644
--- a/main/xml.c
+++ b/main/xml.c
@@ -98,6 +98,9 @@ struct ast_xml_doc *ast_xml_open(char *filename)
ast_log(LOG_NOTICE, "XSLT support not found. XML documentation may be incomplete.\n");
#endif /* HAVE_LIBXSLT */
+ /* Optimize for XPath */
+ xmlXPathOrderDocElems(doc);
+
return (struct ast_xml_doc *) doc;
}