- cli set debug vars

- fixed: restconf native evhtp appended indata to old data
This commit is contained in:
Olof hagsand 2021-07-25 22:21:37 +02:00 committed by Alan Yaniger
parent 86b64c4dd0
commit 659aaac5c6
2 changed files with 4 additions and 3 deletions

View file

@ -448,7 +448,7 @@ cli_debug_cli(clicon_handle h,
cg_var *cv; cg_var *cv;
int level; int level;
if ((cv = cvec_find(vars, "level")) == NULL){ if ((cv = cvec_find_var(vars, "level")) == NULL){
if (cvec_len(argv) != 1){ if (cvec_len(argv) != 1){
clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1"); clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1");
goto done; goto done;
@ -479,7 +479,7 @@ cli_debug_backend(clicon_handle h,
cg_var *cv; cg_var *cv;
int level; int level;
if ((cv = cvec_find(vars, "level")) == NULL){ if ((cv = cvec_find_var(vars, "level")) == NULL){
if (cvec_len(argv) != 1){ if (cvec_len(argv) != 1){
clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1"); clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1");
goto done; goto done;
@ -513,7 +513,7 @@ cli_debug_restconf(clicon_handle h,
cg_var *cv; cg_var *cv;
int level; int level;
if ((cv = cvec_find(vars, "level")) == NULL){ if ((cv = cvec_find_var(vars, "level")) == NULL){
if (cvec_len(argv) != 1){ if (cvec_len(argv) != 1){
clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1"); clicon_err(OE_PLUGIN, EINVAL, "Requires either label var or single arg: 0|1");
goto done; goto done;

View file

@ -529,6 +529,7 @@ restconf_path_root(evhtp_request_t *req,
clicon_err(OE_CFG, errno, "evbuffer_pullup"); clicon_err(OE_CFG, errno, "evbuffer_pullup");
goto done; goto done;
} }
cbuf_reset(sd->sd_indata);
/* Note the pullup may not be null-terminated */ /* Note the pullup may not be null-terminated */
cbuf_append_buf(sd->sd_indata, buf, len); cbuf_append_buf(sd->sd_indata, buf, len);
} }