Apache HTTPD
Macros | Functions | Variables
lua_vmprep.c File Reference
module lua_module
#include "mod_lua.h"
#include "http_log.h"
#include "apr_uuid.h"
#include "lua_config.h"
#include "apr_file_info.h"
#include "mod_auth.h"

Go to the source code of this file.

Macros

#define AP_LUA_MODULE_EXT   ".so"
 
#define makeintegerfield(L, n)   lua_pushinteger(L, n); lua_setfield(L, -2, #n)
 

Functions

void ap_lua_init_mutex (apr_pool_t *pool, server_rec *s)
 
void ap_lua_load_apache2_lmodule (lua_State *L)
 
static apr_status_t cleanup_lua (void *l)
 
static apr_status_t server_cleanup_lua (void *resource, void *params, apr_pool_t *pool)
 
static void munge_path (lua_State *L, const char *field, const char *sub_pat, const char *rep_pat, apr_pool_t *pool, apr_array_header_t *paths, const char *file)
 
static apr_status_t vm_construct (lua_State **vm, void *params, apr_pool_t *lifecycle_pool)
 
static ap_lua_vm_speccopy_vm_spec (apr_pool_t *pool, ap_lua_vm_spec *spec)
 
static apr_status_t server_vm_construct (lua_State **resource, void *params, apr_pool_t *pool)
 
lua_Stateap_lua_get_lua_state (apr_pool_t *lifecycle_pool, ap_lua_vm_spec *spec, request_rec *r)
 

Variables

static int *const aplog_module_index = &( lua_module.module_index)
 
apr_global_mutex_tlua_ivm_mutex
 

Macro Definition Documentation

◆ AP_LUA_MODULE_EXT

#define AP_LUA_MODULE_EXT   ".so"

Definition at line 34 of file lua_vmprep.c.

◆ makeintegerfield

#define makeintegerfield (   L,
  n 
)    lua_pushinteger(L, n); lua_setfield(L, -2, #n)

Definition at line 143 of file lua_vmprep.c.

Function Documentation

◆ ap_lua_get_lua_state()

lua_State * ap_lua_get_lua_state ( apr_pool_t lifecycle_pool,
ap_lua_vm_spec spec,
request_rec r 
)

Function used to create a lua_State instance bound into the web server in the appropriate scope.

< Modification Time

< Size of the file

Definition at line 436 of file lua_vmprep.c.

◆ ap_lua_init_mutex()

void ap_lua_init_mutex ( apr_pool_t pool,
server_rec s 
)

Definition at line 43 of file lua_vmprep.c.

◆ ap_lua_load_apache2_lmodule()

void ap_lua_load_apache2_lmodule ( lua_State L)

Fake out addition of the "apache2" module

< Module has handled this stage.

< Module declines to handle

< Module has served the response completely * - it's safe to die() with no more output

< No proxy

< Standard proxy

< Reverse proxy

< Origin response

< Origin response

Definition at line 145 of file lua_vmprep.c.

◆ cleanup_lua()

static apr_status_t cleanup_lua ( void *  l)
static

Definition at line 240 of file lua_vmprep.c.

◆ copy_vm_spec()

static ap_lua_vm_spec * copy_vm_spec ( apr_pool_t pool,
ap_lua_vm_spec spec 
)
static

Definition at line 398 of file lua_vmprep.c.

◆ munge_path()

static void munge_path ( lua_State L,
const char field,
const char sub_pat,
const char rep_pat,
apr_pool_t pool,
apr_array_header_t paths,
const char file 
)
static

field -> "path" or "cpath" sub_pat -> "?.lua" rep_pat -> "./?.lua" pool -> lifecycle pool for allocations paths -> things to add file -> ???

Definition at line 274 of file lua_vmprep.c.

◆ server_cleanup_lua()

static apr_status_t server_cleanup_lua ( void *  resource,
void *  params,
apr_pool_t pool 
)
static

Definition at line 247 of file lua_vmprep.c.

◆ server_vm_construct()

static apr_status_t server_vm_construct ( lua_State **  resource,
void *  params,
apr_pool_t pool 
)
static

Definition at line 414 of file lua_vmprep.c.

◆ vm_construct()

static apr_status_t vm_construct ( lua_State **  vm,
void *  params,
apr_pool_t lifecycle_pool 
)
static

Definition at line 333 of file lua_vmprep.c.

Variable Documentation

◆ aplog_module_index

int* const aplog_module_index = &( lua_module.module_index)
static

Definition at line 24 of file lua_vmprep.c.

◆ lua_ivm_mutex

apr_global_mutex_t* lua_ivm_mutex
extern

Definition at line 85 of file mod_lua.c.