mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
replace server scope with thread scope
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200656 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -25,6 +25,10 @@
|
|||||||
#include "apr_optional.h"
|
#include "apr_optional.h"
|
||||||
#include "mod_ssl.h"
|
#include "mod_ssl.h"
|
||||||
|
|
||||||
|
#ifdef APR_HAS_THREADS
|
||||||
|
#include "apr_thread_proc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap_lua, AP_LUA, int, lua_open,
|
APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ap_lua, AP_LUA, int, lua_open,
|
||||||
(lua_State *L, apr_pool_t *p),
|
(lua_State *L, apr_pool_t *p),
|
||||||
(L, p), OK, DECLINED)
|
(L, p), OK, DECLINED)
|
||||||
@@ -112,7 +116,26 @@ static int lua_handler(request_rec *r)
|
|||||||
spec->scope,
|
spec->scope,
|
||||||
spec->file,
|
spec->file,
|
||||||
"handle");
|
"handle");
|
||||||
L = ap_lua_get_lua_state(r->pool,
|
|
||||||
|
apr_pool_t *pool;
|
||||||
|
switch (dcfg->vm_scope) {
|
||||||
|
case AP_LUA_SCOPE_ONCE:
|
||||||
|
pool = r->pool;
|
||||||
|
break;
|
||||||
|
case AP_LUA_SCOPE_REQUEST:
|
||||||
|
pool = r->pool;
|
||||||
|
break;
|
||||||
|
case AP_LUA_SCOPE_CONN:
|
||||||
|
pool = r->connection->pool;
|
||||||
|
break;
|
||||||
|
case AP_LUA_SCOPE_THREAD:
|
||||||
|
#if APR_HAS_THREADS
|
||||||
|
pool = apr_thread_pool_get(r->connection->current_thread);
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
L = ap_lua_get_lua_state(pool,
|
||||||
spec);
|
spec);
|
||||||
|
|
||||||
if (!L) {
|
if (!L) {
|
||||||
|
Reference in New Issue
Block a user