Fixed empty restconf data segv; error restconf quit; etc

This commit is contained in:
Olof hagsand 2018-01-16 22:25:55 +01:00
parent 4a57b60935
commit cd33380368
7 changed files with 90 additions and 43 deletions

View file

@ -134,6 +134,18 @@ fib_route(clicon_handle h, /* Clicon handle */
return 0;
}
/*! Smallest possible RPC declaration for test */
static int
empty(clicon_handle h, /* Clicon handle */
cxobj *xe, /* Request: <rpc><xn></rpc> */
struct client_entry *ce, /* Client session */
cbuf *cbret, /* Reply eg <rpc-reply>... */
void *arg) /* Argument given at register */
{
cprintf(cbret, "<rpc-reply/>");
return 0;
}
/*! IETF Routing route-count rpc */
static int
route_count(clicon_handle h,
@ -201,6 +213,11 @@ plugin_init(clicon_handle h)
"route-count"/* Xml tag when callback is made */
) < 0)
goto done;
if (backend_rpc_cb_register(h, empty,
NULL,
"empty"/* Xml tag when callback is made */
) < 0)
goto done;
retval = 0;
done:
return retval;