Skip to content

Commit 6d1f79f

Browse files
committed
remove last traces of the code cache
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200513 13f79535-47bb-0310-9956-ffa450edef68
1 parent e4422d6 commit 6d1f79f

3 files changed

Lines changed: 18 additions & 61 deletions

File tree

modules/lua/lua_vmprep.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,22 @@ static void munge_path(lua_State *L,
282282
current = lua_tostring(L, -1);
283283

284284
parent_dir = ap_make_dirstr_parent(pool, file);
285+
286+
ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "parent_dir %s", parent_dir);
287+
285288
pattern = apr_pstrcat(pool, parent_dir, sub_pat, NULL);
289+
ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "pattern %s", pattern);
286290
luaL_gsub(L, current, rep_pat, pattern);
287291
lua_setfield(L, -3, field);
288292
lua_getfield(L, -2, field);
289293
modified = lua_tostring(L, -1);
290-
294+
ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "modified %s", modified);
291295

292296
lua_pop(L, 2);
293297

294298
part = apr_pstrcat(pool, modified, ";", apr_array_pstrcat(pool, paths, ';'),
295299
NULL);
296-
300+
ap_log_perror(APLOG_MARK, APLOG_WARNING, 0, NULL, "part %s", part);
297301
lua_pushstring(L, part);
298302
lua_setfield(L, -2, field);
299303
lua_pop(L, 1); /* pop "package" off the stack */
@@ -438,8 +442,10 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
438442
spec->pool) != APR_SUCCESS)
439443
return NULL;
440444

441-
apr_pool_userdata_set(reslist, "mod_lua",
442-
vm_reslist_destroy, spec->pool);
445+
apr_pool_userdata_set(reslist,
446+
"mod_lua",
447+
vm_reslist_destroy,
448+
spec->pool);
443449
}
444450
apr_reslist_acquire(reslist, (void **)&L);
445451
lua_pushlightuserdata(L, L);

modules/lua/mod_lua.c

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ static int lua_handler(request_rec *r)
129129
spec->scope = dcfg->vm_scope;
130130
spec->pool = spec->scope==APL_SCOPE_SERVER ? cfg->pool : r->pool;
131131
spec->file = r->filename;
132-
spec->code_cache_style = dcfg->code_cache_style;
133132
spec->package_paths = cfg->package_paths;
134133
spec->package_cpaths = cfg->package_cpaths;
135134
spec->vm_server_pool_min = cfg->vm_server_pool_min;
@@ -141,9 +140,8 @@ static int lua_handler(request_rec *r)
141140
}
142141

143142
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
144-
"request details scope:%u, cache:%u, filename:%s, function:%s",
143+
"request details scope:%u, filename:%s, function:%s",
145144
d->spec->scope,
146-
d->spec->code_cache_style,
147145
d->spec->file,
148146
d->function_name);
149147
L = ap_lua_get_lua_state(r->pool,
@@ -200,7 +198,6 @@ static int lua_alias_munger(request_rec *r)
200198
spec->file = ap_pregsub(r->pool, cnd->file_name, r->uri,
201199
AP_MAX_REG_MATCH, matches);
202200
spec->scope = cnd->scope;
203-
spec->code_cache_style = cnd->code_cache_style;
204201
spec->bytecode = cnd->bytecode;
205202
spec->bytecode_len = cnd->bytecode_len;
206203
if (spec->scope == APL_SCOPE_ONCE) {
@@ -253,7 +250,6 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name, int ap
253250
spec = apr_pcalloc(r->pool, sizeof(ap_lua_vm_spec));
254251

255252
spec->file = hook_spec->file_name;
256-
spec->code_cache_style = hook_spec->code_cache_style;
257253
spec->scope = hook_spec->scope;
258254
spec->vm_server_pool_min = cfg->vm_server_pool_min;
259255
spec->vm_server_pool_max = cfg->vm_server_pool_max;
@@ -502,7 +498,6 @@ static const char *register_named_block_function_hook(const char *name,
502498
else {
503499
function = NULL;
504500
}
505-
spec->code_cache_style = APL_CODE_CACHE_FOREVER;
506501

507502
ctx.cmd = cmd;
508503
tmp = apr_pstrdup(cmd->pool, cmd->err_directive->directive + 1);
@@ -580,20 +575,13 @@ static const char *register_named_file_function_hook(const char *name,
580575
spec->file_name = apr_pstrdup(cmd->pool, file);
581576
spec->function_name = apr_pstrdup(cmd->pool, function);
582577
spec->scope = cfg->vm_scope;
583-
spec->code_cache_style = APL_CODE_CACHE_STAT;
584-
/*
585-
int code_cache_style;
586-
char *function_name;
587-
char *file_name;
588-
int scope;
589-
*/
578+
590579
*(ap_lua_mapped_handler_spec **) apr_array_push(hook_specs) = spec;
591580
return NULL;
592581
}
593582

594583
static int lua_check_user_id_harness_first(request_rec *r)
595584
{
596-
597585
return lua_request_rec_hook_harness(r, "check_user_id", AP_LUA_HOOK_FIRST);
598586
}
599587
static int lua_check_user_id_harness(request_rec *r)
@@ -905,43 +893,20 @@ static const char *register_package_dir(cmd_parms *cmd, void *_cfg,
905893
* Called for config directive which looks like
906894
* LuaPackageCPath /lua/package/path/mapped/thing/like/this/?.so
907895
*/
908-
static const char *register_package_cdir(cmd_parms *cmd, void *_cfg,
896+
static const char *register_package_cdir(cmd_parms *cmd,
897+
void *_cfg,
909898
const char *arg)
910899
{
911900
ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
912901

913902
return register_package_helper(cmd, arg, cfg->package_cpaths);
914903
}
915904

916-
/**
917-
* Called for config directive which looks like
918-
* LuaCodeCache
919-
*/
920-
static const char *register_code_cache(cmd_parms *cmd, void *_cfg,
921-
const char *arg)
922-
{
923-
ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
924-
if (strcmp("stat", arg) == 0) {
925-
cfg->code_cache_style = APL_CODE_CACHE_STAT;
926-
}
927-
else if (strcmp("forever", arg) == 0) {
928-
cfg->code_cache_style = APL_CODE_CACHE_FOREVER;
929-
}
930-
else if (strcmp("never", arg) == 0) {
931-
cfg->code_cache_style = APL_CODE_CACHE_NEVER;
932-
}
933-
else {
934-
return apr_psprintf(cmd->pool,
935-
"Invalid value for LuaCodeCache, '%s', "
936-
"acceptable values are 'stat', 'forever', and "
937-
"'never'",
938-
arg);
939-
}
940-
return NULL;
941-
}
942905

943-
static const char *register_lua_scope(cmd_parms *cmd, void *_cfg,
944-
const char *scope, const char *min,
906+
static const char *register_lua_scope(cmd_parms *cmd,
907+
void *_cfg,
908+
const char *scope,
909+
const char *min,
945910
const char *max)
946911
{
947912
ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
@@ -1090,10 +1055,6 @@ command_rec lua_commands[] = {
10901055
OR_ALL,
10911056
"Provide a hook for the insert_filter phase of request processing"),
10921057

1093-
AP_INIT_TAKE1("LuaCodeCache", register_code_cache, NULL, OR_ALL,
1094-
"Configure the compiled code cache. \
1095-
Default is to stat the file each time, options are stat|forever|never"),
1096-
10971058
AP_INIT_TAKE123("LuaScope", register_lua_scope, NULL, OR_ALL,
10981059
"One of once, request, conn, server -- default is once"),
10991060

@@ -1116,7 +1077,6 @@ static void *create_dir_config(apr_pool_t *p, char *dir)
11161077
cfg->package_cpaths = apr_array_make(p, 2, sizeof(char *));
11171078
cfg->mapped_handlers =
11181079
apr_array_make(p, 1, sizeof(ap_lua_mapped_handler_spec *));
1119-
cfg->code_cache_style = APL_CODE_CACHE_STAT;
11201080
cfg->pool = p;
11211081
cfg->hooks = apr_hash_make(p);
11221082
cfg->dir = apr_pstrdup(p, dir);
@@ -1137,12 +1097,8 @@ static void *create_server_config(apr_pool_t *p, server_rec *s)
11371097
{
11381098

11391099
ap_lua_server_cfg *cfg = apr_pcalloc(p, sizeof(ap_lua_server_cfg));
1140-
cfg->code_cache = apr_pcalloc(p, sizeof(ap_lua_code_cache));
1141-
apr_thread_rwlock_create(&cfg->code_cache->compiled_files_lock, p);
1142-
cfg->code_cache->compiled_files = apr_hash_make(p);
11431100
cfg->vm_reslists = apr_hash_make(p);
11441101
apr_thread_rwlock_create(&cfg->vm_reslists_lock, p);
1145-
cfg->code_cache->pool = p;
11461102
cfg->root_path = NULL;
11471103

11481104
return cfg;

modules/lua/mod_lua.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ typedef struct
9393

9494
apr_pool_t *pool;
9595

96-
/**
97-
* CODE_CACHE_STAT | CODE_CACHE_FOREVER | CODE_CACHE_NEVER
98-
*/
99-
unsigned int code_cache_style;
100-
10196
/**
10297
* APL_SCOPE_ONCE | APL_SCOPE_REQUEST | APL_SCOPE_CONN | APL_SCOPE_SERVER
10398
*/

0 commit comments

Comments
 (0)