32#define APR_WANT_BYTEFUNC
39#define POST_MAX_VARS 500
41#ifndef MODLUA_MAX_REG_MATCH
42#define MODLUA_MAX_REG_MATCH 25
55 for (
i = 1;
i <= top;
i++) {
70 "%d: lightuserdata",
i);
101 "%d: <function>",
i);
371 for (
p = 0;
p <= (hsize -
nsize); ++
p) {
426 "Content-Disposition: form-data; name=\"%255[^\"]\"; filename=\"%255[^\"]\"",
470 lua_pushliteral(L,
"Request body was larger than the permitted size.");
614 default:
return NULL;
721 t->n =
"headers_out";
730 t->n =
"err_headers_out";
739 t->n =
"subprocess_env";
1143 res.line_number = 0;
1202 "regcomp found %d matches; only %d allowed.",
1215 for (
i = 0;
i <=
regex.re_nsub;
i++) {
1635 const char *document_root;
1707 const char *expected;
1879 switch (
rft->type) {
1884 "request_rec->dispatching %s -> apr table",
1894 "request_rec->dispatching %s -> lua_CFunction",
1903 "request_rec->dispatching %s -> string",
name);
1912 "request_rec->dispatching %s -> int",
name);
1921 "request_rec->dispatching %s -> boolean",
name);
2028 object->vb_size = 1;
2051 const char *
key, *cookie;
2056 if (cookie !=
NULL) {
2067 int secure = 0, expires = 0,
httponly = 0;
2146 if (domain !=
NULL && strlen(domain) > 0) {
2157 secure ?
"Secure;" :
"",
2170 unsigned char *
data = (
unsigned char *)&
rval;
2198 "Websocket: Got websocket key: %s",
key);
2221 "Websocket: Upgraded from HTTP to Websocket");
2227 "Websocket: Upgrade from HTTP to Websocket failed");
2337 "Websocket: Reading %" APR_SIZE_T_FMT " (%s) bytes, masking is %s. %s",
2339 (
payload >= 126) ?
"extra payload" :
"no extra payload",
2340 mask ?
"on" :
"off",
2341 fin ?
"This is a final frame" :
"more to follow");
2363 " bytes, pushed to Lua stack", remaining);
2419 "Websocket: Writing framed message to client");
2426 else if (
len < 65535) {
2441 "Websocket: Writing raw message to client");
2497 unsigned char mask =
len >> 7;
2501 "Websocket: Got PONG opcode: %x",
opcode);
2527#define APLUA_REQ_TRACE(lev) static int req_trace##lev(lua_State *L) \
2529 return req_log_at(L, APLOG_TRACE##lev); \
2600 "Property [%s] may not be set on a request_rec",
2615 for (cfg =
rcfg; cfg; cfg = cfg->
next) {
const char apr_size_t len
char * strstr(char *s1, char *s2)
#define APR_SHA1_DIGESTSIZE
APR Thread Mutex Routines.
APR Standard Headers Support.
apr_status_t apr_dir_make_recursive(const char *path, apr_fileperms_t perm, apr_pool_t *pool)
ap_directive_t * ap_conftree
#define APLOG_USE_MODULE(foo)
char * ap_runtime_dir_relative(apr_pool_t *p, const char *fname)
request_rec int int apr_table_t const char * path
const char * ap_show_mpm(void)
apr_status_t ap_cookie_read(request_rec *r, const char *name, const char **val, int remove)
const char * ap_get_server_built(void)
const char * ap_get_server_banner(void)
ap_filter_rec_t * ap_get_input_filter_handle(const char *name)
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
ap_filter_t * ap_add_input_filter_handle(ap_filter_rec_t *f, void *ctx, request_rec *r, conn_rec *c)
ap_filter_t * ap_add_output_filter(const char *name, void *ctx, request_rec *r, conn_rec *c)
apr_status_t ap_get_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
apr_port_t ap_get_server_port(const request_rec *r)
apr_off_t ap_get_limit_req_body(const request_rec *r)
int ap_exists_config_define(const char *name)
int ap_state_query(int query_code)
const char * ap_get_server_name(request_rec *r)
const char * ap_auth_name(request_rec *r)
apr_socket_t * ap_get_conn_socket(conn_rec *c)
const char * ap_document_root(request_rec *r)
void ap_custom_response(request_rec *r, int status, const char *string)
int ap_allow_overrides(request_rec *r)
char * ap_construct_url(apr_pool_t *p, const char *uri, request_rec *r)
const char * ap_get_server_name_for_url(request_rec *r)
int ap_allow_options(request_rec *r)
#define APLOG_MODULE_INDEX
const char * ap_server_argv0
const char * ap_server_root
const unsigned char * buf
int int ap_rflush(request_rec *r)
void ap_send_interim_response(request_rec *r, int send_headers)
int ap_get_basic_auth_pw(request_rec *r, const char **pw)
int ap_set_keepalive(request_rec *r)
int ap_should_client_block(request_rec *r)
static APR_INLINE int ap_rputs(const char *str, request_rec *r)
int ap_rputc(int c, request_rec *r)
void ap_set_content_type(request_rec *r, const char *ct)
int ap_rwrite(const void *buf, int nbyte, request_rec *r)
long ap_get_client_block(request_rec *r, char *buffer, apr_size_t bufsiz)
int ap_setup_client_block(request_rec *r, int read_policy)
apr_status_t ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset, apr_size_t length, apr_size_t *nbytes)
char * ap_make_etag(request_rec *r, int force_weak)
int ap_some_auth_required(request_rec *r)
int ap_is_initial_req(request_rec *r)
void ap_args_to_table(request_rec *r, apr_table_t **table)
void ap_varbuf_grow(struct ap_varbuf *vb, apr_size_t new_size)
void ap_varbuf_init(apr_pool_t *pool, struct ap_varbuf *vb, apr_size_t init_size)
#define APR_STATUS_IS_INCOMPLETE(s)
#define APR_BRIGADE_INSERT_TAIL(b, e)
apr_file_t apr_off_t start
apr_brigade_flush void * ctx
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
const char apr_ssize_t int flags
const char apr_ssize_t slen
const char apr_ssize_t int partial
int ap_expr_exec(request_rec *r, const ap_expr_info_t *expr, const char **err)
const char * ap_expr_parse(apr_pool_t *pool, apr_pool_t *ptemp, ap_expr_info_t *info, const char *expr, ap_expr_lookup_fn_t *lookup_fn)
int ap_strcmp_match(const char *str, const char *expected)
int ap_strcasecmp_match(const char *str, const char *expected)
void ap_set_document_root(request_rec *r, const char *document_root)
char * ap_escape_logitem(apr_pool_t *p, const char *str)
char * ap_strcasestr(const char *s1, const char *s2)
void ap_set_context_info(request_rec *r, const char *prefix, const char *document_root)
void ap_bin2hex(const void *src, apr_size_t srclen, char *dest)
int ap_unescape_urlencoded(char *query)
const char * ap_context_prefix(request_rec *r)
const char * ap_context_document_root(request_rec *r)
int ap_parse_form_data(request_rec *r, struct ap_filter_t *f, apr_array_header_t **ptr, apr_size_t num, apr_size_t size)
#define ap_escape_html(p, s)
char * ap_escape_urlencoded(apr_pool_t *p, const char *s)
char * ap_os_escape_path(apr_pool_t *p, const char *path, int partial)
#define PROXYREQ_RESPONSE
const char int apr_pool_t * pool
apr_int32_t apr_dir_t * thedir
apr_int32_t apr_fileperms_t
const char apr_fileperms_t perms
const char apr_file_t * file
#define APR_FPROT_OS_DEFAULT
const char apr_int32_t wanted
apr_array_header_t ** result
#define APR_HASH_KEY_STRING
apr_vformatter_buff_t * c
apr_sockaddr_t apr_sockaddr_t apr_sockaddr_t * source
apr_interval_time_t apr_pollcb_cb_t func
#define apr_pcalloc(p, size)
apr_size_t const char * filename
apr_int32_t apr_int32_t apr_int32_t err
#define APR_RFC822_DATE_LEN
apr_int64_t apr_interval_time_t
#define apr_time_from_sec(sec)
apr_status_t ap_mpm_query(int query_code, int *result)
#define REQUEST_CHUNKED_ERROR
void ap_lua_push_apr_table(lua_State *L, req_table_t *t)
int lua_db_acquire(lua_State *L)
int mk_password_hash(passwd_ctx *ctx)
static int req_add_output_filter(lua_State *L)
static int lua_ap_exists_config_define(lua_State *L)
static int req_trace4(lua_State *L)
static int req_puts(lua_State *L)
int(* req_field_int_f)(request_rec *r)
static const char * req_ap_auth_type_field(request_rec *r)
static int req_warn(lua_State *L)
static const char * lua_ap_allowoverrides(request_rec *r)
static int lua_read_body(request_rec *r, const char **rbuf, apr_off_t *size, apr_off_t maxsize)
static int lua_ap_scoreboard_worker(lua_State *L)
static int lua_ap_started(request_rec *r)
static int lua_ap_is_initial_req(request_rec *r)
static const struct luaL_Reg connection_methods[]
static int lua_ap_usleep(lua_State *L)
static int lua_ap_runtime_dir_relative(lua_State *L)
static const char * req_context_document_root(request_rec *r)
static const char * req_hostname_field(request_rec *r)
apr_global_mutex_t * lua_ivm_mutex
static int lua_apr_mkdir(lua_State *L)
static int req_log_at(lua_State *L, int level)
static int lua_websocket_peek(lua_State *L)
static int req_ssl_is_https_field(request_rec *r)
static int req_ssl_var_lookup(lua_State *L)
static int lua_ap_module_info(lua_State *L)
static int lua_ap_getdir(lua_State *L)
static const char * req_the_request_field(request_rec *r)
static int req_emerg(lua_State *L)
static int lua_ap_regex(lua_State *L)
static int lua_websocket_write(lua_State *L)
static int req_trace7(lua_State *L)
static const char * req_args_field(request_rec *r)
static int req_trace2(lua_State *L)
static int req_parsebody(lua_State *L)
static int req_trace6(lua_State *L)
static const char * req_document_root(request_rec *r)
static int lua_websocket_close(lua_State *L)
static int lua_ap_strcmp_match(lua_State *L)
static apr_status_t lua_websocket_readbytes(conn_rec *c, apr_bucket_brigade *brigade, char *buffer, apr_off_t len)
static int lua_ap_some_auth_required(request_rec *r)
static int lua_ap_server_info(lua_State *L)
static int req_trace3(lua_State *L)
static void read_cfg_tree(lua_State *L, request_rec *r, ap_directive_t *rcfg)
static const char * req_content_type_field(request_rec *r)
static int req_alert(lua_State *L)
static int lua_apr_date_parse_rfc(lua_State *L)
void ap_lua_push_connection(lua_State *L, conn_rec *c)
static const char * req_unparsed_uri_field(request_rec *r)
static const char * req_context_prefix(request_rec *r)
static int lua_ap_state_query(lua_State *L)
static char * req_uri_field(request_rec *r)
static int lua_ap_expr(lua_State *L)
static const char * req_protocol_field(request_rec *r)
void ap_lua_rstack_dump(lua_State *L, request_rec *r, const char *msg)
static const char * req_canonical_filename_field(request_rec *r)
static int lua_ap_get_config(lua_State *L)
static int lua_ap_os_escape_path(lua_State *L)
char *(* req_field_string_f)(request_rec *r)
static int lua_ap_send_interim_response(lua_State *L)
static int lua_ap_stat(lua_State *L)
static int lua_apr_rmdir(lua_State *L)
static req_table_t * req_subprocess_env(request_rec *r)
static int lua_apr_b64encode(lua_State *L)
static int req_assbackwards_field(request_rec *r)
static int lua_apr_mkrdir(lua_State *L)
static int lua_apr_htpassword(lua_State *L)
static const char * req_filename_field(request_rec *r)
static int req_crit(lua_State *L)
static int req_trace8(lua_State *L)
static const char * lua_ap_basic_auth_pw(request_rec *r)
static const char * lua_ap_get_server_name(request_rec *r)
static const char * req_handler_field(request_rec *r)
static int lua_websocket_greet(lua_State *L)
void ap_lua_push_server(lua_State *L, server_rec *s)
static int lua_ap_get_server_name_for_url(lua_State *L)
static const char * req_content_encoding_field(request_rec *r)
static int lua_ap_loaded_modules(lua_State *L)
static int lua_ap_scoreboard_process(lua_State *L)
static int req_err_headers_out_table(lua_State *L)
static const struct luaL_Reg request_methods[]
static int lua_ap_requestbody(lua_State *L)
void ap_lua_push_request(lua_State *L, request_rec *r)
static int lua_ap_unescape(lua_State *L)
static int lua_ap_mpm_query(lua_State *L)
static int req_status_field(request_rec *r)
static int req_notice(lua_State *L)
static int lua_ivm_set(lua_State *L)
static int req_parseargs(lua_State *L)
static const char * req_range_field(request_rec *r)
static int lua_ap_get_active_config(lua_State *L)
static int req_escape_html(lua_State *L)
static int lua_ap_sendfile(lua_State *L)
static const char * req_proxyreq_field(request_rec *r)
static int lua_ap_set_context_info(lua_State *L)
static apr_status_t lua_write_body(request_rec *r, apr_file_t *file, apr_off_t *size)
static req_fun_t * makefun(const void *fun, int type, apr_pool_t *pool)
static int req_notes_table(lua_State *L)
static int lua_apr_md5(lua_State *L)
static int req_trace1(lua_State *L)
static int req_headers_in_table(lua_State *L)
static int lua_get_cookie(lua_State *L)
static int lua_ap_make_etag(lua_State *L)
#define MODLUA_MAX_REG_MATCH
static req_table_t * req_headers_in(request_rec *r)
static int lua_ap_clock(lua_State *L)
static int req_remaining_field(request_rec *r)
static int req_construct_url(lua_State *L)
static int lua_apr_b64decode(lua_State *L)
static int lua_ap_limit_req_body(request_rec *r)
static int req_err(lua_State *L)
static const char * req_user_field(request_rec *r)
static int lua_ap_escape(lua_State *L)
static int lua_websocket_ping(lua_State *L)
static int req_aprtable2luatable_cb(void *l, const char *key, const char *value)
static int req_aprtable2luatable(lua_State *L, apr_table_t *t)
static int lua_apr_touch(lua_State *L)
static request_rec * ap_lua_check_request_rec(lua_State *L, int index)
static const char * lua_ap_auth_name(request_rec *r)
static const char * lua_ap_options(request_rec *r)
static req_table_t * req_err_headers_out(request_rec *r)
static int lua_ap_custom_response(lua_State *L)
static int req_dispatch(lua_State *L)
static int lua_ap_rflush(lua_State *L)
static int lua_ap_set_keepalive(lua_State *L)
static const char * req_path_info_field(request_rec *r)
static const struct luaL_Reg server_methods[]
static int lua_ap_set_document_root(lua_State *L)
static int req_info(lua_State *L)
req_table_t *(* req_field_apr_table_f)(request_rec *r)
static const char * req_log_id_field(request_rec *r)
static int req_debug(lua_State *L)
static int lua_ap_escape_logitem(lua_State *L)
static int lua_set_cookie(lua_State *L)
static int req_ap_get_server_port(request_rec *r)
static req_table_t * req_headers_out(request_rec *r)
static int lua_ap_add_input_filter(lua_State *L)
static int req_write(lua_State *L)
static const char * req_useragent_ip_field(request_rec *r)
#define APLUA_REQ_TRACE(lev)
static const char * req_method_field(request_rec *r)
static apr_uint64_t ap_ntoh64(const apr_uint64_t *input)
static int req_newindex(lua_State *L)
static int req_aprtable2luatable_cb_len(void *l, const char *key, const char *value, size_t len)
static int req_trace5(lua_State *L)
static req_table_t * req_notes(request_rec *r)
static int lua_ivm_get(lua_State *L)
void ap_lua_load_request_lmodule(lua_State *L, apr_pool_t *p)
static int req_headers_out_table(lua_State *L)
static int req_subprocess_env_table(lua_State *L)
static int lua_websocket_read(lua_State *L)
static int lua_apr_sha1(lua_State *L)
static char * ap_lua_binstrstr(const char *haystack, size_t hsize, const char *needle, size_t nsize)
#define APL_REQ_FUNTYPE_STRING
#define APL_REQ_FUNTYPE_LUACFUN
#define APL_REQ_FUNTYPE_TABLE
#define APL_REQ_FUNTYPE_BOOLEAN
#define APL_REQ_FUNTYPE_INT
static apr_status_t dispatch(md_store_fs_t *s_fs, md_store_fs_ev_t ev, unsigned int group, const char *fname, apr_filetype_e ftype, apr_pool_t *p)
static const char *const directory
const char * ap_lua_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var)
int ap_lua_ssl_is_https(conn_rec *c)
#define luaL_setfuncs_compat(a, b)
static int send_headers(request_rec *r, proxy_conn_rec *conn)
Apache scoreboard library.
scoreboard * ap_scoreboard_image
const char * ap_scoreboard_fname
void ap_copy_scoreboard_worker(worker_score *dest, int child_num, int thread_num)
process_score * ap_get_scoreboard_process(int x)
Structure used to build the config tree.
struct ap_directive_t * next
struct ap_directive_t * first_child
This structure is used for recording information about the registered filters. It associates a name w...
Structure to store things which are per connection.
ap_conn_keepalive_e keepalive
struct ap_filter_t * input_filters
struct apr_bucket_alloc_t * bucket_alloc
A structure that represents the current request.
const char * content_type
struct ap_filter_t * output_filters
apr_table_t * err_headers_out
char * canonical_filename
apr_table_t * subprocess_env
const char * content_encoding
apr_table_t * headers_out
A structure to store information for each virtual server.
apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, apr_dir_t *thedir)
apr_status_t apr_dir_make(const char *path, apr_fileperms_t perm, apr_pool_t *pool)
apr_status_t apr_dir_remove(const char *path, apr_pool_t *pool)
apr_status_t apr_dir_close(apr_dir_t *thedir)
apr_status_t apr_dir_open(apr_dir_t **new, const char *dirname, apr_pool_t *pool)
apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
apr_status_t apr_socket_close(apr_socket_t *thesocket)
apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)
char * ap_md5_binary(apr_pool_t *p, const unsigned char *buf, int length)
Apache resizable variable length buffer library.
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray