Pagination callback modifications: ensure xml is bound to yang, removed

code not used (eg remaining) and avoiding an extra xpath_vec call.
Moved debug prints from plugin-callback-one to plugin-callback-all
Fixed memory error in data-cvec access function
This commit is contained in:
Olof hagsand 2021-10-14 13:14:10 +02:00
parent 2bfb02de64
commit a242cf47bd
7 changed files with 125 additions and 55 deletions

View file

@ -919,6 +919,7 @@ cli_pagination(clicon_handle h,
uint32_t limit = 0;
cxobj **xvec = NULL;
size_t xlen;
int locked = 0;
if (cvec_len(argv) != 5){
clicon_err(OE_PLUGIN, 0, "Expected usage: <xpath> <prefix> <namespace> <format> <limit>");
@ -950,6 +951,7 @@ cli_pagination(clicon_handle h,
goto done;
if (clicon_rpc_lock(h, "running") < 0)
goto done;
locked++;
for (i = 0;; i++){
if (clicon_rpc_get_pageable_list(h, "running", xpath, nsc,
CONTENT_ALL,
@ -1000,10 +1002,10 @@ cli_pagination(clicon_handle h,
xvec = NULL;
}
} /* for i */
if (clicon_rpc_unlock(h, "running") < 0)
goto done;
retval = 0;
done:
if (locked)
clicon_rpc_unlock(h, "running");
if (xvec)
free(xvec);
if (xret)