if (!r->header_only) {
lua_State *L;
const ap_lua_dir_cfg *cfg = ap_get_module_config(r->per_dir_config,
- &lua_module);
- ap_lua_request_cfg *rcfg =
- ap_get_module_config(r->request_config, &lua_module);
+ &lua_module);
+ ap_lua_request_cfg *rcfg = ap_get_module_config(r->request_config,
+ &lua_module);
mapped_request_details *d = rcfg->mapped_request_details;
ap_lua_vm_spec *spec = NULL;
{
ap_lua_vm_spec *spec;
ap_lua_request_cfg *rcfg = ap_get_module_config(r->request_config,
- &lua_module);
- const ap_lua_dir_cfg *cfg =
- ap_get_module_config(r->per_dir_config, &lua_module);
+ &lua_module);
+ const ap_lua_dir_cfg *cfg = ap_get_module_config(r->per_dir_config,
+ &lua_module);
int i;
ap_regmatch_t matches[AP_MAX_REG_MATCH];
const ap_lua_mapped_handler_spec *cnd =
((const ap_lua_mapped_handler_spec **) cfg->mapped_handlers->elts)[i];
- if (OK ==
- ap_regexec(cnd->uri_pattern, r->uri, AP_MAX_REG_MATCH, matches,
- 0)) {
+ if (OK == ap_regexec(cnd->uri_pattern, r->uri, AP_MAX_REG_MATCH,
+ matches, 0)) {
mapped_request_details *d;
r->handler = "lua-script";
spec = apr_pcalloc(r->pool, sizeof(ap_lua_vm_spec));
- spec->file =
- ap_pregsub(r->pool, cnd->file_name, r->uri, AP_MAX_REG_MATCH,
- matches);
+ spec->file = ap_pregsub(r->pool, cnd->file_name, r->uri,
+ AP_MAX_REG_MATCH, matches);
spec->scope = cnd->scope;
spec->code_cache_style = cnd->code_cache_style;
spec->bytecode = cnd->bytecode;
d = apr_palloc(r->pool, sizeof(mapped_request_details));
- d->function_name =
- ap_pregsub(r->pool, cnd->function_name, r->uri,
- AP_MAX_REG_MATCH, matches);
+ d->function_name = ap_pregsub(r->pool, cnd->function_name, r->uri,
+ AP_MAX_REG_MATCH, matches);
d->spec = spec;
/* now do replacement on method name where? */
lua_State *L;
ap_lua_vm_spec *spec;
ap_lua_server_cfg *server_cfg = ap_get_module_config(r->server->module_config,
- &lua_module);
- const ap_lua_dir_cfg *cfg =
- (ap_lua_dir_cfg *) ap_get_module_config(r->per_dir_config,
- &lua_module);
- apr_array_header_t *hook_specs =
- apr_hash_get(cfg->hooks, name, APR_HASH_KEY_STRING);
+ &lua_module);
+ const ap_lua_dir_cfg *cfg = ap_get_module_config(r->per_dir_config,
+ &lua_module);
+ apr_array_header_t *hook_specs = apr_hash_get(cfg->hooks, name,
+ APR_HASH_KEY_STRING);
if (hook_specs) {
int i;
for (i = 0; i < hook_specs->nelts; i++) {
apr_filepath_merge(&spec->file, server_cfg->root_path,
spec->file, APR_FILEPATH_NOTRELATIVE, r->pool);
- L = ap_lua_get_lua_state(r->pool,
- spec);
-
-
+ L = ap_lua_get_lua_state(r->pool, spec);
if (!L) {
ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
ap_directive_t *directive = cmd->directive;
hack_section_baton *baton = directive->data;
- apr_array_header_t *hook_specs =
- apr_hash_get(cfg->hooks, baton->name, APR_HASH_KEY_STRING);
+ apr_array_header_t *hook_specs = apr_hash_get(cfg->hooks, baton->name,
+ APR_HASH_KEY_STRING);
if (!hook_specs) {
- hook_specs =
- apr_array_make(cmd->pool, 2, sizeof(ap_lua_mapped_handler_spec *));
+ hook_specs = apr_array_make(cmd->pool, 2,
+ sizeof(ap_lua_mapped_handler_spec *));
apr_hash_set(cfg->hooks, apr_pstrdup(cmd->pool, baton->name),
APR_HASH_KEY_STRING, hook_specs);
}
hack_section_baton *baton;
apr_snprintf(buf, sizeof(buf), "%u", cmd->config_file->line_number);
- spec->file_name =
- apr_pstrcat(cmd->pool, cmd->config_file->name, ":", buf, NULL);
+ spec->file_name = apr_pstrcat(cmd->pool, cmd->config_file->name, ":",
+ buf, NULL);
if (function) {
spec->function_name = (char *) function;
}
rv = lua_load(lvm, direct_chunkreader, &ctx, spec->file_name);
if (rv != 0) {
- const char *errstr =
- apr_pstrcat(cmd->pool, "Lua Error:", lua_tostring(lvm, -1),
- NULL);
+ const char *errstr = apr_pstrcat(cmd->pool, "Lua Error:",
+ lua_tostring(lvm, -1), NULL);
lua_close(lvm);
return errstr;
}
lua_dump(lvm, ldump_writer, &b);
luaL_pushresult(&b);
spec->bytecode_len = lua_strlen(lvm, -1);
- spec->bytecode =
- apr_pstrmemdup(cmd->pool, lua_tostring(lvm, -1),
- spec->bytecode_len);
+ spec->bytecode = apr_pstrmemdup(cmd->pool, lua_tostring(lvm, -1),
+ spec->bytecode_len);
lua_close(lvm);
}
(*current)->filename = cmd->config_file->name;
(*current)->line_num = cmd->config_file->line_number;
- (*current)->directive =
- apr_pstrdup(cmd->pool, "Lua_____ByteCodeHack");
+ (*current)->directive = apr_pstrdup(cmd->pool, "Lua_____ByteCodeHack");
(*current)->args = NULL;
(*current)->data = baton;
}
ap_lua_mapped_handler_spec *spec;
ap_lua_dir_cfg *cfg = (ap_lua_dir_cfg *) _cfg;
- apr_array_header_t *hook_specs =
- apr_hash_get(cfg->hooks, name, APR_HASH_KEY_STRING);
+ apr_array_header_t *hook_specs = apr_hash_get(cfg->hooks, name,
+ APR_HASH_KEY_STRING);
if (!hook_specs) {
- hook_specs =
- apr_array_make(cmd->pool, 2, sizeof(ap_lua_mapped_handler_spec *));
+ hook_specs = apr_array_make(cmd->pool, 2,
+ sizeof(ap_lua_mapped_handler_spec *));
apr_hash_set(cfg->hooks, apr_pstrdup(cmd->pool, name),
APR_HASH_KEY_STRING, hook_specs);
}
}
else {
return apr_psprintf(cmd->pool,
- "Invalid value for LuaCodeCache, '%s', acceptable values are %s",
- arg, "'stat', 'forever', and 'never'");
+ "Invalid value for LuaCodeCache, '%s', "
+ "acceptable values are 'stat', 'forever', and "
+ "'never'",
+ arg);
}
return NULL;
}
}
else {
return apr_psprintf(cmd->pool,
- "Invalid value for LuaScope, '%s', acceptable values are %s",
- scope, "'once', 'request', 'conn', and 'server'");
+ "Invalid value for LuaScope, '%s', acceptable "
+ "values are 'once', 'request', 'conn', and "
+ "'server'",
+ scope);
}
return NULL;
}
rv = ap_lua_map_handler(cfg, file, function_name, path, "once");
if (rv != APR_SUCCESS) {
return apr_psprintf(cmd->pool,
- "Unable to configure a lua handler for path '%s', handler %s#%s",
+ "Unable to configure a lua handler for path "
+ "'%s', handler %s#%s",
path, file, function_name);
}
return NULL;
const char *root)
{
/* ap_lua_dir_cfg* cfg = (ap_lua_dir_cfg*)_cfg; */
- ap_lua_server_cfg *cfg =
- ap_get_module_config(cmd->server->module_config, &lua_module);
+ ap_lua_server_cfg *cfg = ap_get_module_config(cmd->server->module_config,
+ &lua_module);
cfg->root_path = root;
return NULL;
AP_INIT_TAKE1("LuaRoot", register_lua_root, NULL, OR_ALL,
"Specify the base path for resolving relative paths for mod_lua directives"),
-
AP_INIT_TAKE1("LuaPackagePath", register_package_dir, NULL, OR_ALL,
"Add a directory to lua's package.path"),
EXEC_ON_READ | OR_ALL,
"Provide a inline hook for the fixups phase of request processing"),
-/* todo: test */
+ /* todo: test */
AP_INIT_TAKE2("LuaHookMapToStorage", register_map_to_storage_hook, NULL,
OR_ALL,
"Provide a hook for the map_to_storage phase of request processing"),