From af88f9a006b23f3ec0e559b1192570930ec648b5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 3 Nov 2019 19:53:05 +0100 Subject: rpcd-mod-luci: properly deal with failing ubus requests Signed-off-by: Jo-Philipp Wich --- libs/rpcd-mod-luci/src/luci.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/rpcd-mod-luci/src/luci.c') diff --git a/libs/rpcd-mod-luci/src/luci.c b/libs/rpcd-mod-luci/src/luci.c index 91f6798d79..12a22c8891 100644 --- a/libs/rpcd-mod-luci/src/luci.c +++ b/libs/rpcd-mod-luci/src/luci.c @@ -83,6 +83,8 @@ invoke_data_cb(struct ubus_request *req, int type, struct blob_attr *msg) if (ictx->cb != NULL) ictx->cb(req, type, msg); + + ictx->cb = NULL; } static void @@ -91,6 +93,9 @@ invoke_done_cb(struct ubus_request *req, int ret) struct invoke_context *ictx = container_of(req, struct invoke_context, request); + if (ictx->cb != NULL) + ictx->cb(req, -1, NULL); + uloop_timeout_cancel(&ictx->timeout); free(ictx); } -- cgit v1.2.3