mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-04 20:51:29 +00:00
allows non-request plugin to register rpc functions
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "../../uwsgi.h"
|
||||
#include <uwsgi.h>
|
||||
|
||||
#include <lua.h>
|
||||
#include <lualib.h>
|
||||
@@ -13,6 +13,8 @@ struct uwsgi_lua {
|
||||
struct uwsgi_string_list *load;
|
||||
} ulua;
|
||||
|
||||
struct uwsgi_plugin lua_plugin;
|
||||
|
||||
#define lca(L, n) ulua_check_args(L, __FUNCTION__, n)
|
||||
|
||||
static void uwsgi_opt_luashell(char *opt, char *value, void *foobar) {
|
||||
@@ -88,7 +90,7 @@ static int uwsgi_api_register_rpc(lua_State *L) {
|
||||
uwsgi_log("registered function %d in Lua global table\n", func);
|
||||
lfunc = func;
|
||||
|
||||
if (uwsgi_register_rpc((char *)name, 6, 0, (void *) lfunc)) {
|
||||
if (uwsgi_register_rpc((char *)name, &lua_plugin, 0, (void *) lfunc)) {
|
||||
lua_pushnil(L);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user