[xml_parse_string() is slow for a long XML string #96](https://github.com/clicon/clixon/issues/96)

This commit is contained in:
Olof hagsand 2019-11-14 20:57:20 +01:00
parent 6b9a9d46f9
commit 039e08f86a
7 changed files with 83 additions and 35 deletions

View file

@ -296,7 +296,11 @@ main(int argc,
if (ret > 0 && (ret = xml_yang_validate_add(h, x1, &xerr)) < 0)
goto done;
if (ret == 0){
if (netconf_err2cb(xerr, &cbret) < 0)
if ((cbret = cbuf_new()) ==NULL){
clicon_err(OE_XML, errno, "cbuf_new");
goto done;
}
if (netconf_err2cb(xerr, cbret) < 0)
goto done;
fprintf(stderr, "xml validation error: %s\n", cbuf_get(cbret));
goto done;