mirror of
https://github.com/openwrt/luci.git
synced 2025-12-21 19:14:34 +04:00
rpcd-mod-luci: properly deal with failing ubus requests
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=rpcd-mod-luci
|
PKG_NAME:=rpcd-mod-luci
|
||||||
PKG_VERSION:=20191102
|
PKG_VERSION:=20191103
|
||||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||||
|
|
||||||
PKG_LICENSE:=Apache-2.0
|
PKG_LICENSE:=Apache-2.0
|
||||||
|
|||||||
@@ -83,6 +83,8 @@ invoke_data_cb(struct ubus_request *req, int type, struct blob_attr *msg)
|
|||||||
|
|
||||||
if (ictx->cb != NULL)
|
if (ictx->cb != NULL)
|
||||||
ictx->cb(req, type, msg);
|
ictx->cb(req, type, msg);
|
||||||
|
|
||||||
|
ictx->cb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -91,6 +93,9 @@ invoke_done_cb(struct ubus_request *req, int ret)
|
|||||||
struct invoke_context *ictx =
|
struct invoke_context *ictx =
|
||||||
container_of(req, struct invoke_context, request);
|
container_of(req, struct invoke_context, request);
|
||||||
|
|
||||||
|
if (ictx->cb != NULL)
|
||||||
|
ictx->cb(req, -1, NULL);
|
||||||
|
|
||||||
uloop_timeout_cancel(&ictx->timeout);
|
uloop_timeout_cancel(&ictx->timeout);
|
||||||
free(ictx);
|
free(ictx);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user