allows non-request plugin to register rpc functions

This commit is contained in:
Unbit
2013-04-21 09:43:45 +02:00
parent 222ca2915b
commit 375d6ee331
12 changed files with 25 additions and 18 deletions
+4 -2
View File
@@ -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 {