From: Adrian Frances <adrian.fran...@netduma.com> Allows for setting different timeouts per call, using the general timeout for the ubus connection as the fallback.
Signed-off-by: Adrian Frances <adrian.fran...@netduma.com> --- lua/ubus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/ubus.c b/lua/ubus.c index e2bb081..fb75827 100644 --- a/lua/ubus.c +++ b/lua/ubus.c @@ -667,6 +667,7 @@ ubus_lua_call(lua_State *L) struct ubus_lua_connection *c = luaL_checkudata(L, 1, METANAME); const char *path = luaL_checkstring(L, 2); const char *func = luaL_checkstring(L, 3); + int timeout = luaL_optint(L, 5, c->timeout); luaL_checktype(L, 4, LUA_TTABLE); blob_buf_init(&c->buf, 0); @@ -688,7 +689,7 @@ ubus_lua_call(lua_State *L) } top = lua_gettop(L); - rv = ubus_invoke(c->ctx, id, func, c->buf.head, ubus_lua_call_cb, L, c->timeout * 1000); + rv = ubus_invoke(c->ctx, id, func, c->buf.head, ubus_lua_call_cb, L, timeout * 1000); if (rv != UBUS_STATUS_OK) { -- 2.25.1 _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel