From: Brian McCallister Date: Thu, 10 Nov 2011 23:57:57 +0000 (+0000) Subject: remove lingering reslist references before killing server scope X-Git-Tag: 2.5.0-alpha~7940 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49ac1fbeb2820dc000226474c416a8f4103e7671;p=thirdparty%2Fapache%2Fhttpd.git remove lingering reslist references before killing server scope git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200646 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/lua/lua_config.c b/modules/lua/lua_config.c index 40ad8fd7c79..84356d71fd2 100644 --- a/modules/lua/lua_config.c +++ b/modules/lua/lua_config.c @@ -46,8 +46,8 @@ static int apl_toscope(const char *name) return AP_LUA_SCOPE_CONN; if (0 == strcmp("conn", name)) return AP_LUA_SCOPE_CONN; - if (0 == strcmp("server", name)) - return AP_LUA_SCOPE_SERVER; + if (0 == strcmp("thread", name)) + return AP_LUA_SCOPE_THREAD; return AP_LUA_SCOPE_ONCE; } diff --git a/modules/lua/lua_vmprep.c b/modules/lua/lua_vmprep.c index 8e38decebd5..6af677a62c1 100644 --- a/modules/lua/lua_vmprep.c +++ b/modules/lua/lua_vmprep.c @@ -16,7 +16,6 @@ */ #include "mod_lua.h" #include "http_log.h" -#include "apr_reslist.h" #include "apr_uuid.h" #include "lua_config.h" #include "apr_file_info.h" @@ -403,21 +402,6 @@ static apr_status_t vm_destruct(void *vm, void *params, apr_pool_t *pool) return APR_SUCCESS; } -static apr_status_t vm_release(void *vm) -{ - apr_reslist_t* reslist; - lua_pushlightuserdata(vm,vm); - lua_rawget(vm,LUA_REGISTRYINDEX); - reslist = (apr_reslist_t*)lua_topointer(vm,-1); - - return apr_reslist_release(reslist, vm); -} - -static apr_status_t vm_reslist_destroy(void *data) -{ - return apr_reslist_destroy(data); -} - /** * Function used to create a lua_State instance bound into the web * server in the appropriate scope. diff --git a/modules/lua/lua_vmprep.h b/modules/lua/lua_vmprep.h index b3cbd2b778a..ed9c65ef28c 100644 --- a/modules/lua/lua_vmprep.h +++ b/modules/lua/lua_vmprep.h @@ -37,7 +37,7 @@ #define AP_LUA_SCOPE_ONCE 1 #define AP_LUA_SCOPE_REQUEST 2 #define AP_LUA_SCOPE_CONN 3 -#define AP_LUA_SCOPE_SERVER 4 +#define AP_LUA_SCOPE_THREAD 4 typedef void (*ap_lua_state_open_callback) (lua_State *L, apr_pool_t *p, @@ -55,7 +55,7 @@ typedef struct /* name of base file to load in the vm */ char *file; - /* APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_SERVER */ + /* APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_THREAD */ int scope; ap_lua_state_open_callback cb; diff --git a/modules/lua/mod_lua.c b/modules/lua/mod_lua.c index 04cd363de7a..6458476c34f 100644 --- a/modules/lua/mod_lua.c +++ b/modules/lua/mod_lua.c @@ -100,7 +100,7 @@ static int lua_handler(request_rec *r) spec = apr_pcalloc(r->pool, sizeof(ap_lua_vm_spec)); spec->scope = dcfg->vm_scope; - spec->pool = spec->scope==AP_LUA_SCOPE_SERVER ? cfg->pool : r->pool; + spec->pool = r->pool; spec->file = r->filename; spec->package_paths = cfg->package_paths; spec->package_cpaths = cfg->package_cpaths; @@ -172,7 +172,7 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name, int ap spec->scope = hook_spec->scope; spec->bytecode = hook_spec->bytecode; spec->bytecode_len = hook_spec->bytecode_len; - spec->pool = spec->scope==AP_LUA_SCOPE_SERVER ? cfg->pool : r->pool; + spec->pool = r->pool; spec->package_paths = cfg->package_paths; spec->package_cpaths = cfg->package_cpaths; spec->cb = &lua_open_callback; @@ -836,8 +836,8 @@ static const char *register_lua_scope(cmd_parms *cmd, else if (strcmp("conn", scope) == 0) { cfg->vm_scope = AP_LUA_SCOPE_CONN; } - else if (strcmp("server", scope) == 0) { - cfg->vm_scope = AP_LUA_SCOPE_SERVER; + else if (strcmp("thread", scope) == 0) { + cfg->vm_scope = AP_LUA_SCOPE_THREAD; } else { return apr_psprintf(cmd->pool,