From 00a35be0a58f6332bc9a51a6b8bd5cc450e65db5 Mon Sep 17 00:00:00 2001 From: lxsang Date: Wed, 8 Jan 2020 22:13:41 +0100 Subject: [PATCH] fix to new lib --- lua-api.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua-api.c b/lua-api.c index 2af0921..52d1e58 100644 --- a/lua-api.c +++ b/lua-api.c @@ -49,6 +49,7 @@ static void push_dict_to_lua(lua_State* L, dictionary_t d) void* handle(void* data) { antd_request_t* rq = (antd_request_t*) data; + char buf[BUFFLEN]; plugin_header_t* __plugin__ = meta(); lua_State* L = NULL; //char * index = __s("%s/%s",__plugin__.htdocs,"router.lua"); @@ -67,7 +68,8 @@ void* handle(void* data) lua_settable(L,-3); lua_pushstring(L,"root"); - lua_pushstring(L, rq->client->port_config->htdocs); + htdocs(rq, buf); + lua_pushstring(L, buf); lua_settable(L,-3); lua_pushstring(L,"apiroot"); @@ -75,7 +77,8 @@ void* handle(void* data) lua_settable(L,-3); lua_pushstring(L,"tmpdir"); - lua_pushstring(L, tmpdir()); + tmpdir(buf); + lua_pushstring(L, buf); lua_settable(L,-3); lua_pushstring(L,"dbpath");