From e0fa1fe46aeb9e405cb58234f6016b2c48a10777 Mon Sep 17 00:00:00 2001 From: dormando Date: Sat, 4 Mar 2023 21:44:24 -0800 Subject: proxy: restrict functions for lua config vs route Also changes the way the global context and thread contexts are fetched from lua; via the VM extra space instead of upvalues, which is a little faster and more universal. It was always erroneous to run a lot of the config functions from routes and vice versa, but there was no consistent strictness so users could get into trouble. --- proto_proxy.c | 1 + 1 file changed, 1 insertion(+) (limited to 'proto_proxy.c') diff --git a/proto_proxy.c b/proto_proxy.c index 3bcaf9c..952c897 100644 --- a/proto_proxy.c +++ b/proto_proxy.c @@ -166,6 +166,7 @@ void proxy_thread_init(void *ctx, LIBEVENT_THREAD *thr) { fprintf(stderr, "Failed to allocate proxy thread stats\n"); exit(EXIT_FAILURE); } + thr->proxy_ctx = ctx; // Initialize the lua state. lua_State *L = luaL_newstate(); -- cgit v1.2.1