Added cache for modules-state RFC7895 to avoid building new XML every get call

This commit is contained in:
Olof hagsand 2019-02-21 15:06:20 +01:00
parent a20865846e
commit 3c332b689f
8 changed files with 193 additions and 76 deletions

View file

@ -335,7 +335,7 @@ client_statedata(clicon_handle h,
if ((retval = client_get_streams(h, yspec, xpath, "ietf-restconf-monitoring", "restconf-state", xret)) != 0)
goto done;
if (clicon_option_bool(h, "CLICON_MODULE_LIBRARY_RFC7895"))
if ((retval = yang_modules_state_get(h, yspec, xret)) != 0)
if ((retval = yang_modules_state_get(h, yspec, xpath, xret)) != 0)
goto done;
if ((retval = clixon_plugin_statedata(h, yspec, xpath, xret)) != 0)
goto done;

View file

@ -95,6 +95,7 @@ backend_terminate(clicon_handle h)
clicon_debug(1, "%s", __FUNCTION__);
if ((ss = clicon_socket_get(h)) != -1)
close(ss);
modules_state_cache_set(h, NULL);
if ((yspec = clicon_dbspec_yang(h)) != NULL)
yspec_free(yspec);
if ((yspec = clicon_config_yang(h)) != NULL)