From 916c1aabd710bf9ce7b494513d99d8db1a2e768f Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Thu, 26 Mar 2020 20:42:42 +0100 Subject: [PATCH] NULL->/ for state callbacks. Clarified socket close error --- apps/backend/backend_client.c | 4 ++-- lib/src/clixon_proto.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/backend/backend_client.c b/apps/backend/backend_client.c index a9311c0c..f882fccf 100644 --- a/apps/backend/backend_client.c +++ b/apps/backend/backend_client.c @@ -336,7 +336,7 @@ clixon_stats_get(clicon_handle h, /*! Get system state-data, including streams and plugins * @param[in] h Clicon handle - * @param[in] xpath Xpath selection, not used but may be to filter early + * @param[in] xpath XPath selection, may be used to filter early * @param[in] nsc XML Namespace context for xpath * @param[in] content config/state or both * @param[in,out] xret Existing XML tree, merge x into this @@ -1095,7 +1095,7 @@ from_client_get(clicon_handle h, * get state data from plugins as defined by plugin_statedata(), if any */ clicon_err_reset(); - if ((ret = client_statedata(h, xpath, nsc, content, &xret)) < 0) + if ((ret = client_statedata(h, xpath?xpath:"/", nsc, content, &xret)) < 0) goto done; if (ret == 0){ /* Error from callback (error in xret) */ if (clicon_xml2cbuf(cbret, xret, 0, 0, -1) < 0) diff --git a/lib/src/clixon_proto.c b/lib/src/clixon_proto.c index edc3a52f..f85e1d9d 100644 --- a/lib/src/clixon_proto.c +++ b/lib/src/clixon_proto.c @@ -522,7 +522,7 @@ clicon_rpc(int s, if (clicon_msg_rcv(s, &reply, &eof) < 0) goto done; if (eof){ - clicon_err(OE_PROTO, ESHUTDOWN, "Socket unexpected close"); + clicon_err(OE_PROTO, ESHUTDOWN, "Unexpected close of CLICON_SOCK. Clixon backend daemon may have crashed."); close(s); errno = ESHUTDOWN; goto done;