* New state callback signature (ca_statedata2)

* The new callback contains parameters for paging
   * Goal is to replace ca_statedata callback
* New plugin callback when lock/unlock occurs
  * Add `ca_lockdb` tro plugin init to use it.
* Fixed: Typing 'q' in CLI more paging did not properly quit output
  * Output continued but was not shown, for a very large file this could cause considerable delay
* Fixed: Lock was broken in first get get access
  * if the first netconf operation to a backend was lock;get;unlock, the lock was broken in the first get access.
This commit is contained in:
Olof hagsand 2021-09-04 11:35:27 +02:00
parent aaf9a89183
commit caabfd464e
15 changed files with 487 additions and 233 deletions

View file

@ -1043,6 +1043,8 @@ cli_notification_cb(int s,
default:
break;
}
if (cli_output_status() < 0)
break;
}
}
retval = 0;

View file

@ -950,6 +950,8 @@ cli_pagination(clicon_handle h,
}
if ((nsc = xml_nsctx_init(prefix, namespace)) == NULL)
goto done;
if (clicon_rpc_lock(h, "running") < 0)
goto done;
for (i = 0;; i++){
if (clicon_rpc_get_pageable_list(h, "running", xpath, nsc,
CONTENT_ALL,
@ -984,7 +986,11 @@ cli_pagination(clicon_handle h,
default:
break;
}
if (cli_output_status() < 0)
break;
}
if (cli_output_status() < 0)
break;
if (xlen != window) /* Break if fewer elements than requested */
break;
if (xret){
@ -995,7 +1001,9 @@ cli_pagination(clicon_handle h,
free(xvec);
xvec = NULL;
}
}
} /* for */
if (clicon_rpc_unlock(h, "running") < 0)
goto done;
retval = 0;
done:
if (xvec)