1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Change apl_get_lua_state to take a apl_vm_spec instead of a filename, and to

load the bytecode if it is present, rather than the file, as this gets the 
inline config file blocks hooks working again.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728531 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Paul Querna
2008-12-21 22:21:54 +00:00
parent 729bcf2b58
commit db88fbdb27
3 changed files with 30 additions and 25 deletions

View File

@@ -127,7 +127,7 @@ static int lua_handler(request_rec *r)
const apl_dir_cfg *cfg =
ap_get_module_config(r->per_dir_config, &lua_module);
lua_State *L = apl_get_lua_state(r->pool,
d->spec->file,
d->spec,
cfg->package_paths,
cfg->package_cpaths,
&lua_open_callback, NULL);
@@ -206,8 +206,8 @@ static int apl_alias_munger(request_rec *r)
static int lua_request_rec_hook_harness(request_rec *r, const char *name)
{
char *fixed_filename;
apl_server_cfg *server_cfg = ap_get_module_config(r->server->module_config,
&lua_module);
const apl_dir_cfg *cfg =
(apl_dir_cfg *) ap_get_module_config(r->per_dir_config,
&lua_module);
@@ -216,10 +216,13 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name)
if (hook_specs) {
int i;
for (i = 0; i < hook_specs->nelts; i++) {
char *fixed_filename = NULL;
apl_mapped_handler_spec *hook_spec =
((apl_mapped_handler_spec **) hook_specs->elts)[i];
if (hook_spec == NULL)
if (hook_spec == NULL) {
continue;
}
apl_vm_spec *spec = apr_pcalloc(r->pool, sizeof(apl_vm_spec));
spec->file = hook_spec->file_name;
@@ -229,20 +232,10 @@ static int lua_request_rec_hook_harness(request_rec *r, const char *name)
spec->bytecode_len = hook_spec->bytecode_len;
spec->pool = r->pool;
/*
const apl_dir_cfg* cfg = ap_get_module_config(r->per_dir_config, &lua_module);
lua_State *L = apl_get_lua_state(r->pool,
d->spec->file,
cfg->package_paths,
cfg->package_cpaths,
&lua_open_callback, NULL);
*/
apl_server_cfg *server_cfg =
ap_get_module_config(r->server->module_config, &lua_module);
apr_filepath_merge(&fixed_filename, server_cfg->root_path,
apr_filepath_merge(&spec->file, server_cfg->root_path,
spec->file, APR_FILEPATH_NOTRELATIVE, r->pool);
lua_State *L = apl_get_lua_state(r->pool,
fixed_filename,
spec,
cfg->package_paths,
cfg->package_cpaths,
&lua_open_callback, NULL);