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

Rename mod_wombat -> mod_lua.

Note that this isn't a complete transformation yet, but it should basically compile and load as mod_lua.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@728494 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Paul Querna
2008-12-21 20:48:19 +00:00
parent 8e9b3aa735
commit c16fe2875d
31 changed files with 25 additions and 26 deletions

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
#include "mod_wombat.h"
#include "mod_lua.h"
#ifndef APW_CONFIG_H
#define APW_CONFIG_H

View File

@@ -1,5 +1,5 @@
APACHE_MODPATH_INIT(wombat)
APACHE_MODPATH_INIT(lua)
dnl Check for Lua 5.1 Libraries
dnl CHECK_LUA(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
@@ -92,9 +92,9 @@ else
fi
])
wombat_objects="apr_lua.lo config.lo mod_wombat.lo request.lo vmprep.lo"
lua_objects="apr_lua.lo config.lo mod_lua.lo request.lo vmprep.lo"
APACHE_MODULE(wombat, Apache Lua Framework, $wombat_objects, , no,
APACHE_MODULE(lua, Apache Lua Framework, $lua_objects, , no,
[
CHECK_LUA()
APR_ADDTO(LIBS, ["$LUA_LIBS"])

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
#include "mod_wombat.h"
#include "mod_lua.h"
#include "config.h"
#include <string.h>
#include <stdlib.h>
@@ -33,7 +33,7 @@ APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(apw, WOMBAT, int, wombat_request,
(L, r),
OK, DECLINED)
module AP_MODULE_DECLARE_DATA wombat_module;
module AP_MODULE_DECLARE_DATA lua_module;
/**
* error reporting if lua has an error.
@@ -100,10 +100,10 @@ static int wombat_handler(request_rec *r) {
}
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "handling [%s] in mod_wombat", r->filename);
apw_dir_cfg *dcfg = ap_get_module_config(r->per_dir_config, &wombat_module);
apw_dir_cfg *dcfg = ap_get_module_config(r->per_dir_config, &lua_module);
if (!r->header_only) {
apw_request_cfg* rcfg = ap_get_module_config(r->request_config, &wombat_module);
apw_request_cfg* rcfg = ap_get_module_config(r->request_config, &lua_module);
mapped_request_details *d = rcfg->mapped_request_details;
apw_vm_spec *spec = NULL;
if (!d) {
@@ -119,7 +119,7 @@ static int wombat_handler(request_rec *r) {
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "request details scope:%u, cache:%u",
d->spec->scope,
d->spec->code_cache_style);
const apw_dir_cfg* cfg = ap_get_module_config(r->per_dir_config, &wombat_module);
const apw_dir_cfg* cfg = ap_get_module_config(r->per_dir_config, &lua_module);
lua_State *L = apw_get_lua_state(r->pool,
d->spec->file,
cfg->package_paths,
@@ -147,7 +147,7 @@ static int wombat_handler(request_rec *r) {
* Like mod_alias except for lua handler fun :-)
*/
static int apw_alias_munger(request_rec *r) {
const apw_dir_cfg *cfg = ap_get_module_config(r->per_dir_config, &wombat_module);
const apw_dir_cfg *cfg = ap_get_module_config(r->per_dir_config, &lua_module);
int i;
ap_regmatch_t matches[AP_MAX_REG_MATCH];
@@ -174,7 +174,7 @@ static int apw_alias_munger(request_rec *r) {
/* now do replacement on method name where? */
r->filename = apr_pstrdup(r->pool, spec->file);
apw_request_cfg *rcfg = ap_get_module_config(r->request_config, &wombat_module);
apw_request_cfg *rcfg = ap_get_module_config(r->request_config, &lua_module);
rcfg->mapped_request_details = d;
return OK;
}
@@ -190,7 +190,7 @@ static int wombat_request_rec_hook_harness(request_rec *r, const char *name) {
char *fixed_filename;
const apw_dir_cfg* cfg = (apw_dir_cfg*) ap_get_module_config(r->per_dir_config,
&wombat_module);
&lua_module);
apr_array_header_t *hook_specs = apr_hash_get(cfg->hooks, name, APR_HASH_KEY_STRING);
if (hook_specs) {
int i;
@@ -207,14 +207,14 @@ static int wombat_request_rec_hook_harness(request_rec *r, const char *name) {
spec->pool = r->pool;
/*
const apw_dir_cfg* cfg = ap_get_module_config(r->per_dir_config, &wombat_module);
const apw_dir_cfg* cfg = ap_get_module_config(r->per_dir_config, &lua_module);
lua_State *L = apw_get_lua_state(r->pool,
d->spec->file,
cfg->package_paths,
cfg->package_cpaths,
&wombat_open_callback, NULL);
*/
apw_server_cfg *server_cfg = ap_get_module_config(r->server->module_config, &wombat_module);
apw_server_cfg *server_cfg = ap_get_module_config(r->server->module_config, &lua_module);
apr_filepath_merge(&fixed_filename, server_cfg->root_path, spec->file, APR_FILEPATH_NOTRELATIVE, r->pool);
lua_State *L = apw_get_lua_state(r->pool,
fixed_filename,
@@ -608,7 +608,7 @@ static const char* register_quick_block(cmd_parms *cmd, void *_cfg, const char *
static const char* register_package_helper(cmd_parms *cmd, const char *arg, apr_array_header_t *dir_array) {
apr_status_t rv;
apw_server_cfg *server_cfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
apw_server_cfg *server_cfg = ap_get_module_config(cmd->server->module_config, &lua_module);
char *fixed_filename;
rv = apr_filepath_merge(&fixed_filename, server_cfg->root_path, arg, APR_FILEPATH_NOTRELATIVE, cmd->pool);
if (rv != APR_SUCCESS) {
@@ -710,7 +710,7 @@ static const char* lua_map_handler(cmd_parms *cmd, void *_cfg, const char *path,
static const char* register_lua_root(cmd_parms *cmd, void *_cfg, const char *root) {
/* apw_dir_cfg* cfg = (apw_dir_cfg*)_cfg; */
apw_server_cfg* cfg = ap_get_module_config(cmd->server->module_config, &wombat_module);
apw_server_cfg* cfg = ap_get_module_config(cmd->server->module_config, &lua_module);
cfg->root_path = root;
return NULL;
@@ -820,7 +820,7 @@ static int create_request_config(request_rec *r) {
apw_request_cfg *cfg = apr_palloc(r->pool, sizeof(apw_request_cfg));
cfg->mapped_request_details = NULL;
cfg->request_scoped_vms = apr_hash_make(r->pool);
ap_set_module_config(r->request_config, &wombat_module, cfg);
ap_set_module_config(r->request_config, &lua_module, cfg);
return OK;
}
@@ -869,7 +869,7 @@ static void wombat_register_hooks(apr_pool_t *p) {
APR_HOOK_REALLY_FIRST);
}
module AP_MODULE_DECLARE_DATA wombat_module = {
module AP_MODULE_DECLARE_DATA lua_module = {
STANDARD20_MODULE_STUFF,
create_dir_config, /* create per-dir config structures */
NULL, /* merge per-dir config structures */

View File

@@ -1,6 +1,3 @@
#ifndef MOD_WOMBAT_H
#define MOD_WOMBAT_H
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,6 +15,9 @@
* limitations under the License.
*/
#ifndef _MOD_LUA_H_
#define _MOD_LUA_H_
#include <stdio.h>
#include "httpd.h"
@@ -113,8 +113,7 @@ typedef struct {
char *function;
} apw_filter_ctx;
extern module AP_MODULE_DECLARE_DATA wombat_module;
/* module wombat_module; */
extern module AP_MODULE_DECLARE_DATA lua_module;
#if !defined(WIN32)
#define WOMBAT_DECLARE(type) type
@@ -140,5 +139,5 @@ APR_DECLARE_EXTERNAL_HOOK(apw, WOMBAT, int, wombat_open,
APR_DECLARE_EXTERNAL_HOOK(apw, WOMBAT, int, wombat_request,
(lua_State *L, request_rec *r));
#endif /* !MOD_WOMBAT_H */
#endif /* !_MOD_LUA_H_ */

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
#include "mod_wombat.h"
#include "mod_lua.h"
#include "util_script.h"
#include "apr_lua.h"

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
#include "vmprep.h"
#include "mod_wombat.h"
#include "mod_lua.h"
#include "http_log.h"
#include "apr_reslist.h"
#include "apr_uuid.h"