Optimization of PUT

This commit is contained in:
Olof hagsand 2024-02-05 17:14:36 +01:00
parent 4e3bd6fbdd
commit 23dcb58758
15 changed files with 221 additions and 131 deletions

View file

@ -248,7 +248,10 @@ startup_common(clixon_handle h,
else if (xml_sort_recurse(xt) < 0) {
clixon_err(OE_XML, EFAULT, "Yang sort error");
}
if (xmldb_dump(h, stdout, xt) < 0)
/* clear XML tree of defaults */
if (xml_tree_prune_flagged(xt, XML_FLAG_DEFAULT, 1) < 0)
goto done;
if (xmldb_dump(h, stdout, xt, WITHDEFAULTS_REPORT_ALL) < 0)
goto done;
exit(0); /* This is fairly abrupt , but need to avoid side-effects of rewinding
stack. Alternative is to make a separate function stack for this. */
@ -488,6 +491,12 @@ validate_common(clixon_handle h,
clixon_err(OE_FATAL, 0, "No DB_SPEC");
goto done;
}
if (xmldb_cache_get(h, db) != NULL){
if (xmldb_populate(h, db) < 0)
goto done;
if (xmldb_write_cache2file(h, db) < 0)
goto done;
}
/* This is the state we are going to */
if ((ret = xmldb_get0(h, db, YB_MODULE, NULL, "/", 0, 0, &td->td_target, NULL, xret)) < 0)
goto done;

View file

@ -390,6 +390,7 @@ filter_xpath_again(clixon_handle h,
* @param[in] nsc Namespace context of xpath
* @param[in] username User name for NACM access
* @param[in] depth Nr of levels to print, -1 is all, 0 is none
* @param[in] wdef With-defaults parameter
* @param[out] cbret Return xml tree, eg <rpc-reply>..., <rpc-error..
* @retval 0 OK
* @retval -1 Error

View file

@ -325,7 +325,6 @@ clixon_plugin_statedata_one(clixon_plugin_t *cp,
* @param[in] yspec Yang spec
* @param[in] nsc Namespace context
* @param[in] xpath String with XPATH syntax. or NULL for all
* @param[in] wdef With-defaults parameter, see RFC 6243
* @param[in,out] xret State XML tree is merged with existing tree.
* @retval 1 OK
* @retval 0 Statedata callback failed (xret set with netconf-error)