[LEDE-DEV] [PATCH] Pass method paraneter to Lua notifications.
Iain Fraser
iainf at netduma.com
Sat Jun 11 06:54:32 PDT 2016
---
lua/ubus.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lua/ubus.c b/lua/ubus.c
index f59af90..be54d8d 100644
--- a/lua/ubus.c
+++ b/lua/ubus.c
@@ -770,11 +770,12 @@ ubus_sub_notify_handler(struct ubus_context *ctx, struct ubus_object *obj,
lua_remove(state, -2);
if (lua_isfunction(state, -1)) {
+ lua_pushstring(state, method);
if( msg ){
ubus_lua_parse_blob_array(state, blob_data(msg), blob_len(msg), true);
- lua_call(state, 1, 0);
+ lua_call(state, 2, 0);
} else {
- lua_call(state, 0, 0);
+ lua_call(state, 1, 0);
}
} else {
lua_pop(state, 1);
--
1.7.9.5
More information about the Lede-dev
mailing list