#define INADDR_NONE ((unsigned long) -1)
#endif
+#if 0
+/* This stuff taken care of in APR XXXXX */
/*
* Replace signal function with sigaction equivalent
*/
#define signal(s,f) ap_signal(s,f)
Sigfunc *signal(int signo, Sigfunc * func);
#endif
-
+#endif
#include <setjmp.h>
#if defined(USE_LONGJMP)
ap_listen_rec *ap_listeners;
void ap_listen_pre_config(void);
-int ap_listen_open(pool *pconf, unsigned port);
+int ap_listen_open(ap_context_t *pconf, unsigned port);
const char *ap_set_listenbacklog(cmd_parms *cmd, void *dummy, char *arg);
const char *ap_set_listener(cmd_parms *cmd, void *dummy, char *ips);
const char *ap_set_send_buffer_size(cmd_parms *cmd, void *dummy, char *arg);
However the MPM may choose to terminate processes when the user
requests a non-graceful restart/stop. When this occurs, the MPM kills
all threads with extreme prejudice, and destroys the pchild pool.
- User cleanups registered in the pchild pool will be invoked at
+ User cleanups registered in the pchild ap_context_t will be invoked at
this point. (This can pose some complications, the user cleanups
are asynchronous behaviour not unlike longjmp/signal... but if the
admin is asking for a non-graceful shutdown, how much effort should
/* run until a restart/shutdown is indicated, return 1 for shutdown
0 otherwise */
-API_EXPORT(int) ap_mpm_run(pool *pconf, pool *plog, server_rec *server_conf);
+API_EXPORT(int) ap_mpm_run(ap_context_t *pconf, ap_context_t *plog, server_rec *server_conf);
/* predicate indicating if a graceful stop has been requested ...
used by the connection loop */
configfile_t *config_file; /* Config file structure from pcfg_openfile() */
- ap_pool *pool; /* Pool to allocate new storage in */
- struct pool *temp_pool; /* Pool for scratch memory; persists during
+ ap_context_t *pool; /* Pool to allocate new storage in */
+ ap_context_t *temp_pool; /* Pool for scratch memory; persists during
* configuration, but wiped before the first
* request is served...
*/
* (see also mod_so).
*/
- void *(*create_dir_config) (pool *p, char *dir);
- void *(*merge_dir_config) (pool *p, void *base_conf, void *new_conf);
- void *(*create_server_config) (pool *p, server_rec *s);
- void *(*merge_server_config) (pool *p, void *base_conf, void *new_conf);
+ void *(*create_dir_config) (ap_context_t *p, char *dir);
+ void *(*merge_dir_config) (ap_context_t *p, void *base_conf, void *new_conf);
+ void *(*create_server_config) (ap_context_t *p, server_rec *s);
+ void *(*merge_server_config) (ap_context_t *p, void *base_conf, void *new_conf);
const command_rec *cmds;
const handler_rec *handlers;
* it relativizes it wrt server_root.
*/
-API_EXPORT(const char *) ap_server_root_relative(pool *p, const char *fname);
+API_EXPORT(const char *) ap_server_root_relative(ap_context_t *p, const char *fname);
/* Finally, the hook for dynamically loading modules in... */
/* For mod_so.c... */
-void ap_single_module_configure(pool *p, server_rec *s, module *m);
+void ap_single_module_configure(ap_context_t *p, server_rec *s, module *m);
/* For http_main.c... */
void ap_setup_prelinked_modules(void);
void ap_show_directives(void);
void ap_show_modules(void);
-server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, const char *config_name);
-void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s);
-void ap_child_init_hook(pool *pchild, server_rec *s);
+server_rec *ap_read_config(ap_context_t *conf_pool, ap_context_t *temp_pool, const char *config_name);
+void ap_post_config_hook(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s);
+void ap_child_init_hook(ap_context_t *pchild, server_rec *s);
/* For http_request.c... */
-void *ap_create_request_config(pool *p);
-CORE_EXPORT(void *) ap_create_per_dir_config(pool *p);
-void *ap_merge_per_dir_configs(pool *p, void *base, void *new);
+void *ap_create_request_config(ap_context_t *p);
+CORE_EXPORT(void *) ap_create_per_dir_config(ap_context_t *p);
+void *ap_merge_per_dir_configs(ap_context_t *p, void *base, void *new);
/* For http_connection.c... */
-void *ap_create_conn_config(pool *p);
+void *ap_create_conn_config(ap_context_t *p);
/* For http_core.c... (<Directory> command and virtual hosts) */
int ap_parse_htaccess(void **result, request_rec *r, int override,
const char *path, const char *access_name);
-CORE_EXPORT(const char *) ap_init_virtual_host(pool *p, const char *hostname,
+CORE_EXPORT(const char *) ap_init_virtual_host(ap_context_t *p, const char *hostname,
server_rec *main_server, server_rec **);
-void ap_process_resource_config(server_rec *s, const char *fname, pool *p, pool *ptemp);
+void ap_process_resource_config(server_rec *s, const char *fname, ap_context_t *p, ap_context_t *ptemp);
/* Module-method dispatchers, also for http_request.c */
/* Hooks */
DECLARE_HOOK(int,header_parser,(request_rec *))
-DECLARE_HOOK(void,pre_config,(pool *pconf,pool *plog,pool *ptemp))
+DECLARE_HOOK(void,pre_config,(ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp))
DECLARE_HOOK(void,post_config,
- (pool *pconf,pool *plog,pool *ptemp,server_rec *s))
+ (ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp,server_rec *s))
DECLARE_HOOK(void,open_logs,
- (pool *pconf,pool *plog,pool *ptemp,server_rec *s))
-DECLARE_HOOK(void,child_init,(pool *pchild, server_rec *s))
+ (ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp,server_rec *s))
+DECLARE_HOOK(void,child_init,(ap_context_t *pchild, server_rec *s))
#ifdef __cplusplus
}
extern "C" {
#endif
-conn_rec *ap_new_connection(pool *p, server_rec *server, BUFF *inout,
+conn_rec *ap_new_connection(ap_context_t *p, server_rec *server, BUFF *inout,
const struct sockaddr_in *remaddr,
const struct sockaddr_in *saddr, long id);
CORE_EXPORT(void) ap_process_connection(conn_rec *);
extern "C" {
#endif
+#include "apr_lib.h"
+
/*****************************************************************
*
* The most basic server code is encapsulated in a single module
/* Used for constructing self-referencing URLs, and things like SERVER_PORT,
* and SERVER_NAME.
*/
-API_EXPORT(char *) ap_construct_url(pool *p, const char *uri, request_rec *r);
+API_EXPORT(char *) ap_construct_url(ap_context_t *p, const char *uri, request_rec *r);
API_EXPORT(const char *) ap_get_server_name(request_rec *r);
API_EXPORT(unsigned) ap_get_server_port(const request_rec *r);
API_EXPORT(unsigned long) ap_get_limit_req_body(const request_rec *r);
API_EXPORT(const char *) ap_auth_type (request_rec *);
API_EXPORT(const char *) ap_auth_name (request_rec *);
API_EXPORT(int) ap_satisfies (request_rec *r);
-API_EXPORT(const array_header *) ap_requires (request_rec *);
+API_EXPORT(const ap_array_header_t *) ap_requires (request_rec *);
#ifdef WIN32
/*
int satisfy;
char *ap_auth_type;
char *ap_auth_name;
- array_header *ap_requires;
+ ap_array_header_t *ap_requires;
/* Custom response config. These can contain text or a URL to redirect to.
* if response_code_strings is NULL then there are none in the config,
int loglevel;
/* Access control */
- array_header *sec;
+ ap_array_header_t *sec;
regex_t *r;
#ifdef WIN32
/* Access control */
char *access_name;
- array_header *sec;
- array_header *sec_url;
+ ap_array_header_t *sec;
+ ap_array_header_t *sec_url;
} core_server_config;
/* for http_config.c */
-void ap_core_reorder_directories(pool *, server_rec *);
+void ap_core_reorder_directories(ap_context_t *, server_rec *);
/* for mod_perl */
CORE_EXPORT(void) ap_add_per_dir_conf (server_rec *s, void *dir_config);
#define APLOG_MARK __FILE__,__LINE__
-void ap_open_logs (server_rec *, pool *p);
+void ap_open_logs (server_rec *, ap_context_t *p);
/* The two primary logging functions, ap_log_error and ap_log_rerror,
* use a printf style format string to build the log message. It is
__attribute__((format(printf,5,6)));
API_EXPORT(void) ap_error_log2stderr (server_rec *);
-void ap_log_pid (pool *p, const char *fname);
+void ap_log_pid (ap_context_t *p, const char *fname);
/* These are for legacy code, new code should use ap_log_error,
* or ap_log_rerror.
*/
request_rec *r);
typedef struct piped_log {
- pool *p;
+ ap_context_t *p;
#ifndef NO_RELIABLE_PIPED_LOGS
char *program;
int pid;
#endif
} piped_log;
-API_EXPORT(piped_log *) ap_open_piped_log (pool *p, const char *program);
+API_EXPORT(piped_log *) ap_open_piped_log (ap_context_t *p, const char *program);
API_EXPORT(void) ap_close_piped_log (piped_log *);
#ifndef NO_RELIABLE_PIPED_LOGS
#define ap_piped_log_read_fd(pl) ((pl)->fds[0])
extern API_VAR_EXPORT const char *ap_server_root;
/* for -C, -c and -D switches */
-extern array_header *ap_server_pre_read_config;
-extern array_header *ap_server_post_read_config;
-extern array_header *ap_server_config_defines;
+extern ap_array_header_t *ap_server_pre_read_config;
+extern ap_array_header_t *ap_server_post_read_config;
+extern ap_array_header_t *ap_server_config_defines;
#ifdef __cplusplus
}
* (e.g., for includes), a module may call for the request to be run
* by calling run_sub_req. The space allocated to create sub_reqs can be
* reclaimed by calling destroy_sub_req --- be sure to copy anything you care
- * about which was allocated in its pool elsewhere before doing this.
+ * about which was allocated in its ap_context_t elsewhere before doing this.
*/
API_EXPORT(request_rec *) ap_sub_req_lookup_uri(const char *new_file,
#endif
/* called before any config is read */
-void ap_init_vhost_config(pool *p);
+void ap_init_vhost_config(ap_context_t *p);
/* called after the config has been read */
-void ap_fini_vhost_config(pool *p, server_rec *main_server);
+void ap_fini_vhost_config(ap_context_t *p, server_rec *main_server);
/* handle addresses in <VirtualHost> statement */
-const char *ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s);
+const char *ap_parse_vhost_addrs(ap_context_t *p, const char *hostname, server_rec *s);
/* handle NameVirtualHost directive */
const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg);
/* Headers in which EVERYONE has an interest... */
#include "ap_config.h"
-#include "alloc.h"
+#include "apr_general.h"
+#include "apr_lib.h"
#include "buff.h"
#include "ap.h"
#include "apr.h"
#define SERVER_BASEVERSION "Apache/2.0-dev" /* SEE COMMENTS ABOVE */
#define SERVER_VERSION SERVER_BASEVERSION
-/* TODO: re-implement the server token/version stuff -- it's part of http_core
+/* TODO: re ap_context_t mplement the server token/version stuff -- it's part of http_core
* it should be possible to do without touching http_main at all. (or else
* we haven't got enough module hooks)
*/
/* The size of the static array in http_protocol.c for storing
* all of the potential response status-lines (a sparse table).
- * A future version should dynamically generate the table at startup.
+ * A future version should dynamically generate the ap_table_t at startup.
*/
#define RESPONSE_CODES 55
#define ASCIITEXT_MAGIC_TYPE_PREFIX "text/x-ascii-" /* Text files whose content-type starts with this are passed thru unconverted */
#endif /*CHARSET_EBCDIC*/
#define MAP_FILE_MAGIC_TYPE "application/x-type-map"
-#define ASIS_MAGIC_TYPE "httpd/send-as-is"
+#define ASIS_MAGIC_TYPE "httpd/send-as ap_context_t s"
#define DIR_MAGIC_TYPE "httpd/unix-directory"
#define STATUS_MAGIC_TYPE "application/x-httpd-status"
struct request_rec {
- ap_pool *pool;
+ ap_context_t *pool;
conn_rec *connection;
server_rec *server;
* latter are printed even on error, and persist across internal redirects
* (so the headers printed for ErrorDocument handlers will have them).
*
- * The 'notes' table is for notes from one module to another, with no
+ * The 'notes' ap_table_t is for notes from one module to another, with no
* other set purpose in mind...
*/
- table *headers_in;
- table *headers_out;
- table *err_headers_out;
- table *subprocess_env;
- table *notes;
+ ap_table_t *headers_in;
+ ap_table_t *headers_out;
+ ap_table_t *err_headers_out;
+ ap_table_t *subprocess_env;
+ ap_table_t *notes;
/* content_type, handler, content_encoding, content_language, and all
* content_languages MUST be lowercased strings. They may be pointers
const char *content_encoding;
const char *content_language; /* for back-compat. only -- do not use */
- array_header *content_languages; /* array of (char*) */
+ ap_array_header_t *content_languages; /* array of (char*) */
char *vlist_validator; /* variant list validator (if negotiated) */
struct conn_rec {
- ap_pool *pool;
+ ap_context_t *pool;
server_rec *base_server; /* Physical vhost this conn come in on */
void *vhost_lookup_data; /* used by http_vhost.c */
char *path; /* Pathname for ServerPath */
int pathlen; /* Length of path */
- array_header *names; /* Normal names for ServerAlias servers */
- array_header *wild_names; /* Wildcarded names for ServerAlias servers */
+ ap_array_header_t *names; /* Normal names for ServerAlias servers */
+ ap_array_header_t *wild_names; /* Wildcarded names for ServerAlias servers */
uid_t server_uid; /* effective user id when calling exec wrapper */
gid_t server_gid; /* effective group id when calling exec wrapper */
API_EXPORT(struct tm *) ap_get_gmtoff(int *tz);
API_EXPORT(char *) ap_get_time(void);
-API_EXPORT(char *) ap_field_noparam(pool *p, const char *intype);
-API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt);
-API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t t);
+API_EXPORT(char *) ap_field_noparam(ap_context_t *p, const char *intype);
+API_EXPORT(char *) ap_ht_time(ap_context_t *p, time_t t, const char *fmt, int gmt);
+API_EXPORT(char *) ap_gm_timestr_822(ap_context_t *p, time_t t);
/* String handling. The *_nc variants allow you to use non-const char **s as
arguments (unfortunately C won't automatically convert a char ** to a const
char **) */
-API_EXPORT(char *) ap_getword(pool *p, const char **line, char stop);
-API_EXPORT(char *) ap_getword_nc(pool *p, char **line, char stop);
-API_EXPORT(char *) ap_getword_white(pool *p, const char **line);
-API_EXPORT(char *) ap_getword_white_nc(pool *p, char **line);
-API_EXPORT(char *) ap_getword_nulls(pool *p, const char **line, char stop);
-API_EXPORT(char *) ap_getword_nulls_nc(pool *p, char **line, char stop);
-API_EXPORT(char *) ap_getword_conf(pool *p, const char **line);
-API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line);
+API_EXPORT(char *) ap_getword(ap_context_t *p, const char **line, char stop);
+API_EXPORT(char *) ap_getword_nc(ap_context_t *p, char **line, char stop);
+API_EXPORT(char *) ap_getword_white(ap_context_t *p, const char **line);
+API_EXPORT(char *) ap_getword_white_nc(ap_context_t *p, char **line);
+API_EXPORT(char *) ap_getword_nulls(ap_context_t *p, const char **line, char stop);
+API_EXPORT(char *) ap_getword_nulls_nc(ap_context_t *p, char **line, char stop);
+API_EXPORT(char *) ap_getword_conf(ap_context_t *p, const char **line);
+API_EXPORT(char *) ap_getword_conf_nc(ap_context_t *p, char **line);
API_EXPORT(const char *) ap_size_list_item(const char **field, int *len);
-API_EXPORT(char *) ap_get_list_item(pool *p, const char **field);
-API_EXPORT(int) ap_find_list_item(pool *p, const char *line, const char *tok);
+API_EXPORT(char *) ap_get_list_item(ap_context_t *p, const char **field);
+API_EXPORT(int) ap_find_list_item(ap_context_t *p, const char *line, const char *tok);
-API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_white);
-API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok);
-API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok);
+API_EXPORT(char *) ap_get_token(ap_context_t *p, const char **accept_line, int accept_white);
+API_EXPORT(int) ap_find_token(ap_context_t *p, const char *line, const char *tok);
+API_EXPORT(int) ap_find_last_token(ap_context_t *p, const char *line, const char *tok);
API_EXPORT(int) ap_is_url(const char *u);
API_EXPORT(int) ap_unescape_url(char *url);
API_EXPORT(void) ap_no2slash(char *name);
API_EXPORT(void) ap_getparents(char *name);
-API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s);
-API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial);
+API_EXPORT(char *) ap_escape_path_segment(ap_context_t *p, const char *s);
+API_EXPORT(char *) ap_os_escape_path(ap_context_t *p, const char *path, int partial);
#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
-API_EXPORT(char *) ap_escape_html(pool *p, const char *s);
-API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname,
+API_EXPORT(char *) ap_escape_html(ap_context_t *p, const char *s);
+API_EXPORT(char *) ap_construct_server(ap_context_t *p, const char *hostname,
unsigned port, const request_rec *r);
-API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *s);
+API_EXPORT(char *) ap_escape_shell_cmd(ap_context_t *p, const char *s);
API_EXPORT(int) ap_count_dirs(const char *path);
API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n);
-API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s);
+API_EXPORT(char *) ap_make_dirstr_parent(ap_context_t *p, const char *s);
/* deprecated. The previous two routines are preferred. */
-API_EXPORT(char *) ap_make_dirstr(pool *a, const char *s, int n);
-API_EXPORT(char *) ap_make_full_path(pool *a, const char *dir, const char *f);
+API_EXPORT(char *) ap_make_dirstr(ap_context_t *a, const char *s, int n);
+API_EXPORT(char *) ap_make_full_path(ap_context_t *a, const char *dir, const char *f);
API_EXPORT(int) ap_is_matchexp(const char *str);
API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp);
API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp);
-API_EXPORT(char *) ap_pbase64decode(pool *p, const char *bufcoded);
-API_EXPORT(char *) ap_pbase64encode(pool *p, char *string);
-API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded);
-API_EXPORT(char *) ap_uuencode(pool *p, char *string);
+API_EXPORT(char *) ap_pbase64decode(ap_context_t *p, const char *bufcoded);
+API_EXPORT(char *) ap_pbase64encode(ap_context_t *p, char *string);
+API_EXPORT(char *) ap_uudecode(ap_context_t *p, const char *bufcoded);
+API_EXPORT(char *) ap_uuencode(ap_context_t *p, char *string);
#ifdef OS2
void os2pathname(char *path);
-char *ap_double_quotes(pool *p, char *str);
+char *ap_double_quotes(ap_context_t *p, char *str);
#endif
API_EXPORT(int) ap_regexec(const regex_t *preg, const char *string,
size_t nmatch, regmatch_t pmatch[], int eflags);
API_EXPORT(size_t) ap_regerror(int errcode, const regex_t *preg,
char *errbuf, size_t errbuf_size);
-API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source,
+API_EXPORT(char *) ap_pregsub(ap_context_t *p, const char *input, const char *source,
size_t nmatch, regmatch_t pmatch[]);
API_EXPORT(void) ap_content_type_tolower(char *);
API_EXPORT(int) ap_ind(const char *, char); /* Sigh... */
API_EXPORT(int) ap_rind(const char *, char);
-API_EXPORT(char *) ap_escape_quotes (pool *p, const char *instring);
+API_EXPORT(char *) ap_escape_quotes (ap_context_t *p, const char *instring);
/* Common structure for reading of config files / passwd files etc. */
typedef struct {
} configfile_t;
/* Open a configfile_t as FILE, return open configfile_t struct pointer */
-API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name);
+API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name);
/* Allocate a configfile_t handle with user defined functions and params */
-API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr,
+API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_context_t *p, const char *descr,
void *param,
int(*getc_func)(void*),
void *(*gets_func) (void *buf, size_t bufsiz, void *param),
#ifndef HAVE_CANONICAL_FILENAME
/*
- * We can't define these in os.h because of dependence on pool pointer.
+ * We can't define these in os.h because of dependence on ap_context_t pointer.
*/
#define ap_os_canonical_filename(p,f) (f)
#define ap_os_case_canonical_filename(p,f) (f)
#define ap_os_systemcase_filename(p,f) (f)
#else
-API_EXPORT(char *) ap_os_canonical_filename(pool *p, const char *file);
+API_EXPORT(char *) ap_os_canonical_filename(ap_context_t *p, const char *file);
#ifdef WIN32
-API_EXPORT(char *) ap_os_case_canonical_filename(pool *pPool, const char *szFile);
-API_EXPORT(char *) ap_os_systemcase_filename(pool *pPool, const char *szFile);
+API_EXPORT(char *) ap_os_case_canonical_filename(ap_context_t *pPool, const char *szFile);
+API_EXPORT(char *) ap_os_systemcase_filename(ap_context_t *pPool, const char *szFile);
#else
#define ap_os_case_canonical_filename(p,f) ap_os_canonical_filename(p,f)
#define ap_os_systemcase_filename(p,f) ap_os_canonical_filename(p,f)
#endif
#ifdef _OSD_POSIX
-extern const char *os_set_account(pool *p, const char *account);
+extern const char *os_set_account(ap_context_t *p, const char *account);
extern int os_init_job_environment(server_rec *s, const char *user_name, int one_process);
#endif /* _OSD_POSIX */
-char *ap_get_local_host(pool *);
+char *ap_get_local_host(ap_context_t *);
unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port);
extern API_VAR_EXPORT time_t ap_restart_time;
#define AP_SLACK_HIGH 2
#endif
-API_EXPORT(char *) ap_escape_quotes(pool *p, const char *instr);
+API_EXPORT(char *) ap_escape_quotes(ap_context_t *p, const char *instr);
/*
* Redefine assert() to something more useful for an Apache...
#include "ap_md5.h"
-API_EXPORT(char *) ap_md5(pool *a, const unsigned char *string);
-API_EXPORT(char *) ap_md5_binary(pool *a, const unsigned char *buf, int len);
-API_EXPORT(char *) ap_md5contextTo64(pool *p, AP_MD5_CTX * context);
+API_EXPORT(char *) ap_md5(ap_context_t *a, const unsigned char *string);
+API_EXPORT(char *) ap_md5_binary(ap_context_t *a, const unsigned char *buf, int len);
+API_EXPORT(char *) ap_md5contextTo64(ap_context_t *p, AP_MD5_CTX * context);
#ifdef CHARSET_EBCDIC
-API_EXPORT(char *) ap_md5digest(pool *p, FILE *infile, int convert);
+API_EXPORT(char *) ap_md5digest(ap_context_t *p, FILE *infile, int convert);
#else
-API_EXPORT(char *) ap_md5digest(pool *p, APRFile infile);
+API_EXPORT(char *) ap_md5digest(ap_context_t *p, APRFile infile);
#endif /* CHARSET_EBCDIC */
#ifdef __cplusplus
#endif
#endif
-API_EXPORT(char **) ap_create_environment(pool *p, table *t);
+API_EXPORT(char **) ap_create_environment(ap_context_t *p, ap_table_t *t);
API_EXPORT(int) ap_find_path_info(const char *uri, const char *path_info);
API_EXPORT(void) ap_add_cgi_vars(request_rec *r);
API_EXPORT(void) ap_add_common_vars(request_rec *r);
int (*getsfunc) (char *, int, void *),
void *getsfunc_data);
API_EXPORT(void) ap_send_size(size_t size, request_rec *r);
-API_EXPORT(int) ap_call_exec(request_rec *r, child_info *pinfo, char *argv0, char **env,
+API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0, char **env,
int shellcmd);
#ifdef __cplusplus
/* util_uri.c */
API_EXPORT(unsigned short) ap_default_port_for_scheme(const char *scheme_str);
API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec *r);
-API_EXPORT(struct hostent *) ap_pduphostent(pool *p, const struct hostent *hp);
-API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname);
-API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr,
+API_EXPORT(struct hostent *) ap_pduphostent(ap_context_t *p, const struct hostent *hp);
+API_EXPORT(struct hostent *) ap_pgethostbyname(ap_context_t *p, const char *hostname);
+API_EXPORT(char *) ap_unparse_uri_components(ap_context_t *p, const uri_components *uptr,
unsigned flags);
-API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr);
-API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr);
+API_EXPORT(int) ap_parse_uri_components(ap_context_t *p, const char *uri, uri_components *uptr);
+API_EXPORT(int) ap_parse_hostinfo_components(ap_context_t *p, const char *hostinfo, uri_components *uptr);
/* called by the core in main() */
extern void ap_util_uri_init(void);
typedef struct {
int order[METHODS];
- array_header *allows;
- array_header *denys;
+ ap_array_header_t *allows;
+ ap_array_header_t *denys;
} access_dir_conf;
module MODULE_VAR_EXPORT access_module;
-static void *create_access_dir_config(pool *p, char *dummy)
+static void *create_access_dir_config(ap_context_t *p, char *dummy)
{
access_dir_conf *conf =
(access_dir_conf *) ap_pcalloc(p, sizeof(access_dir_conf));
return 0;
}
-static int find_allowdeny(request_rec *r, array_header *a, int method)
+static int find_allowdeny(request_rec *r, ap_array_header_t *a, int method)
{
allowdeny *ap = (allowdeny *) a->elts;
int mmask = (1 << method);
* Adapted to Apache by rst.
*
* dirkx - Added Authoritative control to allow passing on to lower
- * modules if and only if the user-id is not known to this
+ * modules if and only if the user ap_context_t d is not known to this
* module. A known user with a faulty or absent password still
* causes an AuthRequired. The default is 'Authoritative', i.e.
* no control is passed along.
int auth_authoritative;
} auth_config_rec;
-static void *create_auth_dir_config(pool *p, char *d)
+static void *create_auth_dir_config(ap_context_t *p, char *d)
{
auth_config_rec *sec =
(auth_config_rec *) ap_pcalloc(p, sizeof(auth_config_rec));
return NULL;
}
-static table *groups_for_user(pool *p, char *user, char *grpfile)
+static ap_table_t *groups_for_user(ap_context_t *p, char *user, char *grpfile)
{
configfile_t *f;
- table *grps = ap_make_table(p, 15);
- pool *sp;
+ ap_table_t *grps = ap_make_table(p, 15);
+ ap_context_t *sp;
char l[MAX_STRING_LEN];
const char *group_name, *ll, *w;
return NULL;
}
- sp = ap_make_sub_pool(p);
+ ap_create_context(p, NULL, &sp);
while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) {
if ((l[0] == '#') || (!l[0]))
int method_restricted = 0;
register int x;
const char *t, *w;
- table *grpstatus;
- const array_header *reqs_arr = ap_requires(r);
+ ap_table_t *grpstatus;
+ const ap_array_header_t *reqs_arr = ap_requires(r);
require_line *reqs;
/* BUG FIX: tadc, 11-Nov-1995. If there is no "requires" directive,
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- auth_cmds, /* command table */
+ auth_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
*
* Just add the following tokes to your <directory> setup:
*
- * Anonymous magic-user-id [magic-user-id]...
+ * Anonymous magic-user ap_context_t d [magic-user ap_context_t d]...
*
* Anonymous_MustGiveEmail [ on | off ] default = off
* Anonymous_LogEmail [ on | off ] default = on
} anon_auth_config_rec;
-static void *create_anon_auth_dir_config(pool *p, char *d)
+static void *create_anon_auth_dir_config(ap_context_t *p, char *d)
{
anon_auth_config_rec *sec = (anon_auth_config_rec *)
ap_pcalloc(p, sizeof(anon_auth_config_rec));
NULL, /* dir merger ensure strictness */
NULL, /* server config */
NULL, /* merge server config */
- anon_auth_cmds, /* command table */
+ anon_auth_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
* can also be used when compatibility mode is enabled.
*
* dirkx - Added Authoritative control to allow passing on to lower
- * modules if and only if the user-id is not known to this
+ * modules if and only if the user ap_context_t d is not known to this
* module. A known user with a faulty or absent password still
* causes an AuthRequired. The default is 'Authoritative', i.e.
* no control is passed along.
int auth_dbauthoritative;
} db_auth_config_rec;
-static void *create_db_auth_dir_config(pool *p, char *d)
+static void *create_db_auth_dir_config(ap_context_t *p, char *d)
{
db_auth_config_rec *sec
= (db_auth_config_rec *) ap_pcalloc(p, sizeof(db_auth_config_rec));
char *user = r->user;
int m = r->method_number;
- const array_header *reqs_arr = ap_requires(r);
+ const ap_array_header_t *reqs_arr = ap_requires(r);
require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
register int x;
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- db_auth_cmds, /* command table */
+ db_auth_cmds, /* command ap_table_t */
NULL, /* handlers */
NULL, /* filename translation */
db_authenticate_basic_user, /* check_user_id */
* Adapted to Apache by rst.
*
* dirkx - Added Authoritative control to allow passing on to lower
- * modules if and only if the user-id is not known to this
+ * modules if and only if the user ap_context_t d is not known to this
* module. A known user with a faulty or absent password still
* causes an AuthRequired. The default is 'Authoritative', i.e.
* no control is passed along.
} dbm_auth_config_rec;
-static void *create_dbm_auth_dir_config(pool *p, char *d)
+static void *create_dbm_auth_dir_config(ap_context_t *p, char *d)
{
dbm_auth_config_rec *sec
= (dbm_auth_config_rec *) ap_pcalloc(p, sizeof(dbm_auth_config_rec));
char *user = r->user;
int m = r->method_number;
- const array_header *reqs_arr = ap_requires(r);
+ const ap_array_header_t *reqs_arr = ap_requires(r);
require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL;
register int x;
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- dbm_auth_cmds, /* command table */
+ dbm_auth_cmds, /* command ap_table_t */
NULL, /* handlers */
NULL, /* filename translation */
dbm_authenticate_basic_user, /* check_user_id */
* function as well).
*
* To load, simply place the ISA in a location in the document tree.
- * Then add an "AddHandler isapi-isa dll" into your config file.
+ * Then add an "AddHandler isapi ap_context_t sa dll" into your config file.
* You should now be able to load ISAPI DLLs just be reffering to their
* URLs. Make sure the ExecCGI option is active in the directory
* the ISA is in.
BOOL (*isapi_term)(DWORD); /* optional entry point 3 */
isapi_cid *cid = ap_pcalloc(r->pool, sizeof(isapi_cid));
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
int retval;
/* Use similar restrictions as CGIs */
BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
LPVOID lpvBuffer, LPDWORD lpdwSizeofBuffer) {
request_rec *r = ((isapi_cid *)hConn)->r;
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
const char *result;
/* Mostly, we just grab it from the environment, but there are
}
handler_rec isapi_handlers[] = {
-{ "isapi-isa", isapi_handler },
+{ "isapi ap_context_t sa", isapi_handler },
{ NULL}
};
NULL, /* merge per-dir config */
NULL, /* server config */
NULL, /* merge server config */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
isapi_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
int bEnabled;
} EchoConfig;
-static void *create_echo_server_config(pool *p,server_rec *s)
+static void *create_echo_server_config(ap_context_t *p,server_rec *s)
{
EchoConfig *pConfig=ap_pcalloc(p,sizeof *pConfig);
NULL, /* merge per-directory config structures */
create_echo_server_config, /* create per-server config structure */
NULL, /* merge per-server config structures */
- echo_cmds, /* command table */
+ echo_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
* the same routine/environment.
*/
static const char *trace = NULL;
-static table *static_calls_made = NULL;
+static ap_table_t *static_calls_made = NULL;
/*
* To avoid leaking memory from pools other than the per-request one, we
* freed each time we modify the trace. That way previous layers of trace
* data don't get lost.
*/
-static pool *example_pool = NULL;
-static pool *example_subpool = NULL;
+static ap_context_t *example_pool = NULL;
+static ap_context_t *example_subpool = NULL;
/*
* Declare ourselves so the configuration routines can find and know us.
example_pool = ap_make_sub_pool(NULL);
};
/*
- * Likewise for the table of routine/environment pairs we visit outside of
+ * Likewise for the ap_table_t of routine/environment pairs we visit outside of
* request context.
*/
if (static_calls_made == NULL) {
* The list can be displayed by the example_handler() routine.
*
* If the call occurs within a request context (i.e., we're passed a request
- * record), we put the trace into the request pool and attach it to the
+ * record), we put the trace into the request ap_context_t and attach it to the
* request via the notes mechanism. Otherwise, the trace gets added
* to the static (non-request-specific) list.
*
- * Note that the r->notes table is only for storing strings; if you need to
+ * Note that the r->notes ap_table_t is only for storing strings; if you need to
* maintain per-request data of any other type, you need to use another
* mechanism.
*/
const char *sofar;
char *addon;
char *where;
- pool *p;
+ ap_context_t *p;
const char *trace_copy;
/*
where = (where != NULL) ? where : "";
/*
* Now, if we're not in request context, see if we've been called with
- * this particular combination before. The table is allocated in the
+ * this particular combination before. The ap_table_t is allocated in the
* module's private pool, which doesn't get destroyed.
*/
if (r == NULL) {
*/
/*
- * All our module-initialiser does is add its trace to the log.
+ * All our module ap_context_t nitialiser does is add its trace to the log.
*/
-static void example_init(server_rec *s, pool *p)
+static void example_init(server_rec *s, ap_context_t *p)
{
char *note;
/*
* This function is called during server initialisation when an heavy-weight
* process (such as a child) is being initialised. As with the
- * module-initialisation function, any information that needs to be recorded
+ * module ap_context_t nitialisation function, any information that needs to be recorded
* must be in static cells, since there's no configuration record.
*
* There is no return value.
*/
/*
- * All our process-initialiser does is add its trace to the log.
+ * All our process ap_context_t nitialiser does is add its trace to the log.
*/
-static void example_child_init(server_rec *s, pool *p)
+static void example_child_init(server_rec *s, ap_context_t *p)
{
char *note;
/*
* This function is called when an heavy-weight process (such as a child) is
- * being run down or destroyed. As with the child-initialisation function,
+ * being run down or destroyed. As with the child ap_context_t nitialisation function,
* any information that needs to be recorded must be in static cells, since
* there's no configuration record.
*
/*
* All our process-death routine does is add its trace to the log.
*/
-static void example_child_exit(server_rec *s, pool *p)
+static void example_child_exit(server_rec *s, ap_context_t *p)
{
char *note;
* The return value is a pointer to the created module-specific
* structure.
*/
-static void *example_create_dir_config(pool *p, char *dirspec)
+static void *example_create_dir_config(ap_context_t *p, char *dirspec)
{
excfg *cfg;
char *dname = dirspec;
/*
- * Allocate the space for our record from the pool supplied.
+ * Allocate the space for our record from the ap_context_t supplied.
*/
cfg = (excfg *) ap_pcalloc(p, sizeof(excfg));
/*
* The return value is a pointer to the created module-specific structure
* containing the merged values.
*/
-static void *example_merge_dir_config(pool *p, void *parent_conf,
+static void *example_merge_dir_config(ap_context_t *p, void *parent_conf,
void *newloc_conf)
{
* The return value is a pointer to the created module-specific
* structure.
*/
-static void *example_create_server_config(pool *p, server_rec *s)
+static void *example_create_server_config(ap_context_t *p, server_rec *s)
{
excfg *cfg;
* The return value is a pointer to the created module-specific structure
* containing the merged values.
*/
-static void *example_merge_server_config(pool *p, void *server1_conf,
+static void *example_merge_server_config(ap_context_t *p, void *server1_conf,
void *server2_conf)
{
example_merge_dir_config, /* dir config merger */
example_create_server_config, /* server config creator */
example_merge_server_config, /* server config merger */
- example_cmds, /* command table */
+ example_cmds, /* command ap_table_t */
example_handlers, /* [7] list of handlers */
example_translate_handler, /* [2] filename-to-URI translation */
example_check_user_id, /* [5] check/validate user_id */
#ifndef WIN32
struct passwd *pw;
#endif /* ndef WIN32 */
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
char *t;
time_t date = r->request_time;
* the tag value is html decoded if dodecode is non-zero
*/
-static char *get_tag(pool *p, FILE *in, char *tag, int tagbuf_len, int dodecode)
+static char *get_tag(ap_context_t *p, FILE *in, char *tag, int tagbuf_len, int dodecode)
{
char *t = tag, *tag_val, c, term;
return ap_pstrdup(p, tag_val);
}
-static int get_directive(FILE *in, char *dest, size_t len, pool *p)
+static int get_directive(FILE *in, char *dest, size_t len, ap_context_t *p)
{
char *d = dest;
char c;
{
request_rec *r = ((include_cmd_arg *) arg)->r;
char *s = ((include_cmd_arg *) arg)->s;
- table *env = r->subprocess_env;
+ ap_table_t *env = r->subprocess_env;
int child_pid = 0;
#ifdef DEBUG_INCLUDE_CMD
#ifdef OS2
char tag[MAX_STRING_LEN];
char *tag_val;
char parsed_string[MAX_STRING_LEN];
- table *env = r->subprocess_env;
+ ap_table_t *env = r->subprocess_env;
while (1) {
if (!(tag_val = get_tag(r->pool, in, tag, sizeof(tag), 0))) {
} *root, *current, *new;
const char *parse;
char buffer[MAX_STRING_LEN];
- pool *expr_pool;
+ ap_context_t *expr_pool;
int retval = 0;
if ((parse = expr) == (char *) NULL) {
{
char tag[MAX_STRING_LEN];
char *tag_val;
- array_header *arr = ap_table_elts(r->subprocess_env);
+ ap_array_header_t *arr = ap_table_elts(r->subprocess_env);
table_entry *elts = (table_entry *) arr->elts;
int i;
#define DEFAULT_XBITHACK xbithack_off
#endif
-static void *create_includes_dir_config(pool *p, char *dummy)
+static void *create_includes_dir_config(ap_context_t *p, char *dummy)
{
enum xbithack *result = (enum xbithack *) ap_palloc(p, sizeof(enum xbithack));
*result = DEFAULT_XBITHACK;
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- includes_cmds, /* command table */
+ includes_cmds, /* command ap_table_t */
includes_handlers, /* handlers */
NULL, /* check auth */
NULL, /* check access */
static const handler_rec asis_handlers[] =
{
{ASIS_MAGIC_TYPE, asis_handler},
- {"send-as-is", asis_handler},
+ {"send-as ap_context_t s", asis_handler},
{NULL}
};
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
asis_handlers, /* handlers */
NULL /* register hooks */
};
int icon_height;
char *default_order;
- array_header *icon_list;
- array_header *alt_list;
- array_header *desc_list;
- array_header *ign_list;
- array_header *hdr_list;
- array_header *rdme_list;
+ ap_array_header_t *icon_list;
+ ap_array_header_t *alt_list;
+ ap_array_header_t *desc_list;
+ ap_array_header_t *ign_list;
+ ap_array_header_t *hdr_list;
+ ap_array_header_t *rdme_list;
} autoindex_config_rec;
"</TITLE>\n </HEAD>\n <BODY>\n", NULL);
}
-static void push_item(array_header *arr, char *type, char *to, char *path,
+static void push_item(ap_array_header_t *arr, char *type, char *to, char *path,
char *data)
{
struct item *p = (struct item *) ap_push_array(arr);
}
p->type = type;
- p->data = data ? ap_pstrdup(arr->pool, data) : NULL;
- p->apply_path = ap_pstrcat(arr->pool, path, "*", NULL);
+ p->data = data ? ap_pstrdup(arr->cont, data) : NULL;
+ p->apply_path = ap_pstrcat(arr->cont, path, "*", NULL);
if ((type == BY_PATH) && (!ap_is_matchexp(to))) {
- p->apply_to = ap_pstrcat(arr->pool, "*", to, NULL);
+ p->apply_to = ap_pstrcat(arr->cont, "*", to, NULL);
}
else if (to) {
- p->apply_to = ap_pstrdup(arr->pool, to);
+ p->apply_to = ap_pstrdup(arr->cont, to);
}
else {
p->apply_to = NULL;
|| ap_is_fnmatch(to));
if (desc_entry->wildcards) {
prefix = desc_entry->full_path ? "*/" : "*";
- desc_entry->pattern = ap_pstrcat(dcfg->desc_list->pool,
+ desc_entry->pattern = ap_pstrcat(dcfg->desc_list->cont,
prefix, to, "*", NULL);
}
else {
- desc_entry->pattern = ap_pstrdup(dcfg->desc_list->pool, to);
+ desc_entry->pattern = ap_pstrdup(dcfg->desc_list->cont, to);
}
- desc_entry->description = ap_pstrdup(dcfg->desc_list->pool, desc);
+ desc_entry->description = ap_pstrdup(dcfg->desc_list->cont, desc);
return NULL;
}
{NULL}
};
-static void *create_autoindex_config(pool *p, char *dummy)
+static void *create_autoindex_config(ap_context_t *p, char *dummy)
{
autoindex_config_rec *new =
(autoindex_config_rec *) ap_pcalloc(p, sizeof(autoindex_config_rec));
return (void *) new;
}
-static void *merge_autoindex_configs(pool *p, void *basev, void *addv)
+static void *merge_autoindex_configs(ap_context_t *p, void *basev, void *addv)
{
autoindex_config_rec *new;
autoindex_config_rec *base = (autoindex_config_rec *) basev;
}
else {
/*
- * If there were any non-incremental options selected for
+ * If there were any non ap_context_t ncremental options selected for
* this directory, they dominate and we don't inherit *anything.*
* Contrariwise, we *do* inherit if the only settings here are
* incremental ones.
}
else {
/*
- * There are local non-incremental settings, which clear
+ * There are local non ap_context_t ncremental settings, which clear
* all inheritance from above. They *are* the new base settings.
*/
new->opts = add->opts;;
char key;
};
-static char *find_item(request_rec *r, array_header *list, int path_only)
+static char *find_item(request_rec *r, ap_array_header_t *list, int path_only)
{
const char *content_type = r->content_type;
const char *content_encoding = r->content_encoding;
static int ignore_entry(autoindex_config_rec *d, char *path)
{
- array_header *list = d->ign_list;
+ ap_array_header_t *list = d->ign_list;
struct item *items = (struct item *) list->elts;
char *tt;
int i;
char *name = r->uri;
char *tp;
int static_columns = (autoindex_opts & SUPPRESS_COLSORT);
- pool *scratch = ap_make_sub_pool(r->pool);
+ ap_context_t *scratch;
int name_width;
char *name_scratch;
char *pad_scratch;
+ ap_create_context(r->pool, NULL, &scratch);
if (name[0] == '\0') {
name = "/";
}
merge_autoindex_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- autoindex_cmds, /* command table */
+ autoindex_cmds, /* command ap_table_t */
autoindex_handlers, /* handlers */
NULL /* register hooks */
};
int bufbytes;
} cgi_server_conf;
-static void *create_cgi_config(pool *p, server_rec *s)
+static void *create_cgi_config(ap_context_t *p, server_rec *s)
{
cgi_server_conf *c =
(cgi_server_conf *) ap_pcalloc(p, sizeof(cgi_server_conf));
return c;
}
-static void *merge_cgi_config(pool *p, void *basev, void *overridesv)
+static void *merge_cgi_config(ap_context_t *p, void *basev, void *overridesv)
{
cgi_server_conf *base = (cgi_server_conf *) basev, *overrides = (cgi_server_conf *) overridesv;
static int log_script(request_rec *r, cgi_server_conf * conf, int ret,
char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err)
{
- array_header *hdrs_arr = ap_table_elts(r->headers_in);
+ ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
table_entry *hdrs = (table_entry *) hdrs_arr->elts;
char argsbuffer[HUGE_STRING_LEN];
FILE *f;
NULL, /* dir merger --- default is to override */
create_cgi_config, /* server config */
merge_cgi_config, /* merge server config */
- cgi_cmds, /* command table */
+ cgi_cmds, /* command ap_table_t */
cgi_handlers, /* handlers */
NULL, /* check auth */
NULL, /* check access */
* Info Module. Display configuration information for the server and
* all included modules.
*
- * <Location /server-info>
- * SetHandler server-info
+ * <Location /server ap_context_t nfo>
+ * SetHandler server ap_context_t nfo
* </Location>
*
- * GET /server-info - Returns full configuration page for server and all modules
- * GET /server-info?server - Returns server configuration only
- * GET /server-info?module_name - Returns configuration for a single module
- * GET /server-info?list - Returns quick list of included modules
+ * GET /server ap_context_t nfo - Returns full configuration page for server and all modules
+ * GET /server ap_context_t nfo?server - Returns server configuration only
+ * GET /server ap_context_t nfo?module_name - Returns configuration for a single module
+ * GET /server ap_context_t nfo?list - Returns quick list of included modules
*
* Rasmus Lerdorf <rasmus@vex.net>, May 1996
*
} info_entry;
typedef struct {
- array_header *more_info;
+ ap_array_header_t *more_info;
} info_svr_conf;
typedef struct info_cfg_lines {
module MODULE_VAR_EXPORT info_module;
extern module *top_module;
-static void *create_info_config(pool *p, server_rec *s)
+static void *create_info_config(ap_context_t *p, server_rec *s)
{
info_svr_conf *conf = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf));
return conf;
}
-static void *merge_info_config(pool *p, void *basev, void *overridesv)
+static void *merge_info_config(ap_context_t *p, void *basev, void *overridesv)
{
info_svr_conf *new = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf));
info_svr_conf *base = (info_svr_conf *) basev;
return (buf);
}
-static info_cfg_lines *mod_info_load_config(pool *p, const char *filename,
+static info_cfg_lines *mod_info_load_config(ap_context_t *p, const char *filename,
request_rec *r)
{
char s[MAX_STRING_LEN];
static const handler_rec info_handlers[] =
{
- {"server-info", display_info},
+ {"server ap_context_t nfo", display_info},
{NULL}
};
NULL, /* dir merger --- default is to override */
create_info_config, /* server config */
merge_info_config, /* merge server config */
- info_cmds, /* command table */
+ info_cmds, /* command ap_table_t */
info_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
* http://your_server_name/server-status
*
* /server-status - Returns page using tables
- * /server-status?notable - Returns page for browsers without table support
+ * /server-status?notable - Returns page for browsers without ap_table_t support
* /server-status?refresh - Returns page with 1 second refresh
* /server-status?refresh=6 - Returns page with refresh every 6 seconds
* /server-status?auto - Returns page with data for automatic parsing
/* Main handler for x-httpd-status requests */
-/* ID values for command table */
+/* ID values for command ap_table_t */
#define STAT_OPT_END -1
#define STAT_OPT_REFRESH 0
}
-static void status_init(server_rec *s, pool *p)
+static void status_init(server_rec *s, ap_context_t *p)
{
int i;
for (i = 0; i < SERVER_NUM_STATUS; i++)
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- status_module_cmds, /* command table */
+ status_module_cmds, /* command ap_table_t */
status_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
*/
#define CORE_PRIVATE
+#include "apr_lib.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
* the http_conf_globals.
*/
-static void *create_core_dir_config(pool *a, char *dir)
+static void *create_core_dir_config(ap_context_t *a, char *dir)
{
core_dir_config *conf;
return (void *)conf;
}
-static void *merge_core_dir_configs(pool *a, void *basev, void *newv)
+static void *merge_core_dir_configs(ap_context_t *a, void *basev, void *newv)
{
core_dir_config *base = (core_dir_config *)basev;
core_dir_config *new = (core_dir_config *)newv;
return (void*)conf;
}
-static void *create_core_server_config(pool *a, server_rec *s)
+static void *create_core_server_config(ap_context_t *a, server_rec *s)
{
core_server_config *conf;
int is_virtual = s->is_virtual;
return (void *)conf;
}
-static void *merge_core_server_configs(pool *p, void *basev, void *virtv)
+static void *merge_core_server_configs(ap_context_t *p, void *basev, void *virtv)
{
core_server_config *base = (core_server_config *)basev;
core_server_config *virt = (core_server_config *)virtv;
return a->orig_index - b->orig_index;
}
-void ap_core_reorder_directories(pool *p, server_rec *s)
+void ap_core_reorder_directories(ap_context_t *p, server_rec *s)
{
core_server_config *sconf;
- array_header *sec;
+ ap_array_header_t *sec;
struct reorder_sort_rec *sortbin;
int nelts;
void **elts;
int i;
- pool *tmp;
+ ap_context_t *tmp;
sconf = ap_get_module_config(s->module_config, &core_module);
sec = sconf->sec;
elts = (void **)sec->elts;
/* we have to allocate tmp space to do a stable sort */
- tmp = ap_make_sub_pool(p);
+ ap_create_context(p, NULL, &tmp);
sortbin = ap_palloc(tmp, sec->nelts * sizeof(*sortbin));
for (i = 0; i < nelts; ++i) {
sortbin[i].orig_index = i;
return conf->ap_document_root;
}
-API_EXPORT(const array_header *) ap_requires(request_rec *r)
+API_EXPORT(const ap_array_header_t *) ap_requires(request_rec *r)
{
core_dir_config *conf;
return port;
}
-API_EXPORT(char *) ap_construct_url(pool *p, const char *uri,
+API_EXPORT(char *) ap_construct_url(ap_context_t *p, const char *uri,
request_rec *r)
{
unsigned port = ap_get_server_port(r);
}
#ifdef WIN32
-static char* get_interpreter_from_win32_registry(pool *p, const char* ext)
+static char* get_interpreter_from_win32_registry(ap_context_t *p, const char* ext)
{
char extension_path[] = "SOFTWARE\\Classes\\";
char executable_path[] = "\\SHELL\\OPEN\\COMMAND";
/*
* Future optimization:
* When the registry is successfully searched, store the interpreter
- * string in a table to make subsequent look-ups faster
+ * string in a ap_table_t to make subsequent look-ups faster
*/
/* Open the key associated with the script extension */
server_rec *main_server = cmd->server, *s;
const char *errmsg;
char *endp = strrchr(arg, '>');
- pool *p = cmd->pool, *ptemp = cmd->temp_pool;
+ ap_context_t *p = cmd->pool, *ptemp = cmd->temp_pool;
const char *old_end_token;
const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
return err;
}
- /* TODO: re-implement the server token stuff. */
+ /* TODO: re ap_context_t mplement the server token stuff. */
#if 0
if (!strcasecmp(arg, "OS")) {
ap_server_tokens = SrvTk_OS;
size_t length;
};
-static void mmap_cleanup(void *mmv)
+static ap_status_t mmap_cleanup(void *mmv)
{
struct mmap_rec *mmd = mmv;
"Failed to munmap memory of length %ld at 0x%lx",
(long) mmd->length, (long) mmd->mm);
}
+ return APR_SUCCESS;
}
#endif
{ NULL, NULL }
};
-static void core_open_logs(pool *pconf, pool *plog, pool *ptemp, server_rec *s)
+static void core_open_logs(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s)
{
ap_open_logs(s, pconf);
}
merge_core_dir_configs, /* merge per-directory config structures */
create_core_server_config, /* create per-server config structure */
merge_core_server_configs, /* merge per-server config structures */
- core_cmds, /* command table */
+ core_cmds, /* command ap_table_t */
core_handlers, /* handlers */
register_hooks /* register hooks */
};
* read(). B_SAFEREAD ensures that the BUFF layer flushes if it will
* have to block during a read.
*/
- /* TODO: re-implement SAFEREAD external to BUFF using a layer */
+ /* TODO: re ap_context_t mplement SAFEREAD external to BUFF using a layer */
/* //ap_bsetflag(conn->client, B_SAFEREAD, 1); */
ap_bflush(conn->client);
while ((len = getline(l, sizeof(l), conn->client, 0)) <= 0) {
char *copy;
int len;
unsigned int fields_read = 0;
- table *tmp_headers;
+ ap_table_t *tmp_headers;
/* We'll use ap_overlap_tables later to merge these into r->headers_in. */
tmp_headers = ap_make_table(r->pool, 50);
request_rec *ap_read_request(conn_rec *conn)
{
request_rec *r;
- pool *p;
+ ap_context_t *p;
const char *expect;
int access_status;
- p = ap_make_sub_pool(conn->pool);
+ ap_create_context(conn->pool, NULL, &p);
r = ap_pcalloc(p, sizeof(request_rec));
r->pool = p;
r->connection = conn;
*/
static int uniq_field_values(void *d, const char *key, const char *val)
{
- array_header *values;
+ ap_array_header_t *values;
char *start;
char *e;
char **strpp;
int i;
- values = (array_header *)d;
+ values = (ap_array_header_t *)d;
- e = ap_pstrdup(values->pool, val);
+ e = ap_pstrdup(values->cont, val);
do {
/* Find a non-empty fieldname */
*/
static void fixup_vary(request_rec *r)
{
- array_header *varies;
+ ap_array_header_t *varies;
varies = ap_make_array(r->pool, 5, sizeof(char *));
ap_table_do((int (*)(void *, const char *, const char *))uniq_field_values,
(void *) varies, r->headers_out, "Vary", NULL);
- /* If we found any, replace old Vary fields with unique-ified value */
+ /* If we found any, replace old Vary fields with unique ap_context_t fied value */
if (varies->nelts > 0) {
ap_table_setn(r->headers_out, "Vary",
ap_table_addn(r->headers_out, "Expires",
ap_gm_timestr_822(r->pool, r->request_time));
- /* Send the entire table of header fields, terminated by an empty line. */
+ /* Send the entire ap_table_t of header fields, terminated by an empty line. */
ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field,
(void *) r, r->headers_out, NULL);
}
-/* TODO: re-implement ap_send_fb */
+/* TODO: re ap_context_t mplement ap_send_fb */
#if 0
/*
* Send the body of a response to the client.
}
if (!r->assbackwards) {
- table *tmp = r->headers_out;
+ ap_table_t *tmp = r->headers_out;
/* For all HTTP/1.x responses for which we generate the message,
* we need to avoid inheriting the "normal status" header fields
static request_rec *make_sub_request(const request_rec *r)
{
- pool *rrp = ap_make_sub_pool(r->pool);
- request_rec *rr = ap_pcalloc(rrp, sizeof(request_rec));
-
+ ap_context_t *rrp;
+ request_rec *rr;
+
+ ap_create_context(r->pool, NULL, &rrp);
+ rr = ap_pcalloc(rrp, sizeof(request_rec));
rr->pool = rrp;
return rr;
}
{
/* Is there a require line configured for the type of *this* req? */
- const array_header *reqs_arr = ap_requires(r);
+ const ap_array_header_t *reqs_arr = ap_requires(r);
require_line *reqs;
int i;
* this packet, then it'll appear like the link is stalled when really
* it's the application that's stalled.
*/
- /* TODO: re-implement ap_bhalfduplex... not sure how yet */
+ /* TODO: re ap_context_t mplement ap_bhalfduplex... not sure how yet */
/* //ap_bhalfduplex(r->connection->client); */
ap_run_log_transaction(r);
}
-static table *rename_original_env(pool *p, table *t)
+static ap_table_t *rename_original_env(ap_context_t *p, ap_table_t *t)
{
- array_header *env_arr = ap_table_elts(t);
- table_entry *elts = (table_entry *) env_arr->elts;
- table *new = ap_make_table(p, env_arr->nalloc);
+ ap_array_header_t *env_arr = ap_table_elts(t);
+ ap_table_entry_t *elts = (ap_table_entry_t *) env_arr->elts;
+ ap_table_t *new = ap_make_table(p, env_arr->nalloc);
int i;
for (i = 0; i < env_arr->nelts; ++i) {
} handlers_info;
typedef struct {
- table *forced_types; /* Additional AddTyped stuff */
- table *encoding_types; /* Added with AddEncoding... */
- table *language_types; /* Added with AddLanguage... */
- table *handlers; /* Added with AddHandler... */
- array_header *handlers_remove; /* List of handlers to remove */
+ ap_table_t *forced_types; /* Additional AddTyped stuff */
+ ap_table_t *encoding_types; /* Added with AddEncoding... */
+ ap_table_t *language_types; /* Added with AddLanguage... */
+ ap_table_t *handlers; /* Added with AddHandler... */
+ ap_array_header_t *handlers_remove; /* List of handlers to remove */
char *type; /* Type forced with ForceType */
char *handler; /* Handler forced with SetHandler */
module MODULE_VAR_EXPORT mime_module;
-static void *create_mime_dir_config(pool *p, char *dummy)
+static void *create_mime_dir_config(ap_context_t *p, char *dummy)
{
mime_dir_config *new =
(mime_dir_config *) ap_palloc(p, sizeof(mime_dir_config));
return new;
}
-static void *merge_mime_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_mime_dir_configs(ap_context_t *p, void *basev, void *addv)
{
mime_dir_config *base = (mime_dir_config *) basev;
mime_dir_config *add = (mime_dir_config *) addv;
{NULL}
};
-/* Hash table --- only one of these per daemon; virtual hosts can
+/* Hash ap_table_t --- only one of these per daemon; virtual hosts can
* get private versions through AddType...
*/
#define MIME_HASHSIZE (32)
#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)
-static table *hash_buckets[MIME_HASHSIZE];
+static ap_table_t *hash_buckets[MIME_HASHSIZE];
-static void mime_post_config(pool *p, pool *plog, pool *ptemp, server_rec *s)
+static void mime_post_config(ap_context_t *p, ap_context_t *plog, ap_context_t *ptemp, server_rec *s)
{
configfile_t *f;
char l[MAX_STRING_LEN];
merge_mime_dir_configs, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- mime_cmds, /* command table */
+ mime_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
typedef struct {
char *default_format_string;
- array_header *default_format;
- array_header *config_logs;
- array_header *server_config_logs;
- table *formats;
+ ap_array_header_t *default_format;
+ ap_array_header_t *config_logs;
+ ap_array_header_t *server_config_logs;
+ ap_table_t *formats;
} multi_log_state;
/*
typedef struct {
char *fname;
char *format_string;
- array_header *format;
+ ap_array_header_t *format;
int log_fd;
char *condition_var;
#ifdef BUFFERED_LOGS
char *arg;
int condition_sense;
int want_orig;
- array_header *conditions;
+ ap_array_header_t *conditions;
} log_format_item;
-static char *format_integer(pool *p, int i)
+static char *format_integer(ap_context_t *p, int i)
{
return ap_psprintf(p, "%d", i);
}
-static char *pfmt(pool *p, int i)
+static char *pfmt(ap_context_t *p, int i)
{
if (i <= 0) {
return "-";
return NULL;
}
-static char *parse_log_misc_string(pool *p, log_format_item *it,
+static char *parse_log_misc_string(ap_context_t *p, log_format_item *it,
const char **sa)
{
const char *s;
return NULL;
}
-static char *parse_log_item(pool *p, log_format_item *it, const char **sa)
+static char *parse_log_item(ap_context_t *p, log_format_item *it, const char **sa)
{
const char *s = *sa;
return "Ran off end of LogFormat parsing args to some directive";
}
-static array_header *parse_log_string(pool *p, const char *s, const char **err)
+static ap_array_header_t *parse_log_string(ap_context_t *p, const char *s, const char **err)
{
- array_header *a = ap_make_array(p, 30, sizeof(log_format_item));
+ ap_array_header_t *a = ap_make_array(p, 30, sizeof(log_format_item));
char *res;
while (*s) {
#endif
static int config_log_transaction(request_rec *r, config_log_state *cls,
- array_header *default_format)
+ ap_array_header_t *default_format)
{
log_format_item *items;
char *str, *s;
request_rec *orig;
int i;
int len = 0;
- array_header *format;
+ ap_array_header_t *format;
char *envar;
if (cls->fname == NULL) {
* Module glue...
*/
-static void *make_config_log_state(pool *p, server_rec *s)
+static void *make_config_log_state(ap_context_t *p, server_rec *s)
{
multi_log_state *mls;
* vhosts inherit any globally-defined format names.
*/
-static void *merge_config_log_state(pool *p, void *basev, void *addv)
+static void *merge_config_log_state(ap_context_t *p, void *basev, void *addv)
{
multi_log_state *base = (multi_log_state *) basev;
multi_log_state *add = (multi_log_state *) addv;
{NULL}
};
-static config_log_state *open_config_log(server_rec *s, pool *p,
+static config_log_state *open_config_log(server_rec *s, ap_context_t *p,
config_log_state *cls,
- array_header *default_format)
+ ap_array_header_t *default_format)
{
if (cls->log_fd > 0) {
return cls; /* virtual config shared w/main server */
return cls;
}
-static config_log_state *open_multi_logs(server_rec *s, pool *p)
+static config_log_state *open_multi_logs(server_rec *s, ap_context_t *p)
{
int i;
multi_log_state *mls = ap_get_module_config(s->module_config,
return NULL;
}
-static void init_config_log(pool *pc, pool *p, pool *pt, server_rec *s)
+static void init_config_log(ap_context_t *pc, ap_context_t *p, ap_context_t *pt, server_rec *s)
{
/* First, do "physical" server, which gets default log fd and format
* for the virtual servers, if they don't override...
static void flush_all_logs(server_rec *s)
{
multi_log_state *mls;
- array_header *log_list;
+ ap_array_header_t *log_list;
config_log_state *clsarray;
int i;
NULL, /* merge per-dir config */
make_config_log_state, /* server config */
merge_config_log_state, /* merge server config */
- config_log_cmds, /* command table */
+ config_log_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
#include "util_script.h"
typedef struct {
- table *action_types; /* Added with Action... */
+ ap_table_t *action_types; /* Added with Action... */
char *scripted[METHODS]; /* Added with Script... */
} action_dir_config;
module action_module;
-static void *create_action_dir_config(pool *p, char *dummy)
+static void *create_action_dir_config(ap_context_t *p, char *dummy)
{
action_dir_config *new =
(action_dir_config *) ap_palloc(p, sizeof(action_dir_config));
return new;
}
-static void *merge_action_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_action_dir_configs(ap_context_t *p, void *basev, void *addv)
{
action_dir_config *base = (action_dir_config *) basev;
action_dir_config *add = (action_dir_config *) addv;
merge_action_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- action_cmds, /* command table */
+ action_cmds, /* command ap_table_t */
action_handlers, /* handlers */
NULL /* register hooks */
};
} alias_entry;
typedef struct {
- array_header *aliases;
- array_header *redirects;
+ ap_array_header_t *aliases;
+ ap_array_header_t *redirects;
} alias_server_conf;
typedef struct {
- array_header *redirects;
+ ap_array_header_t *redirects;
} alias_dir_conf;
module MODULE_VAR_EXPORT alias_module;
-static void *create_alias_config(pool *p, server_rec *s)
+static void *create_alias_config(ap_context_t *p, server_rec *s)
{
alias_server_conf *a =
(alias_server_conf *) ap_pcalloc(p, sizeof(alias_server_conf));
return a;
}
-static void *create_alias_dir_config(pool *p, char *d)
+static void *create_alias_dir_config(ap_context_t *p, char *d)
{
alias_dir_conf *a =
(alias_dir_conf *) ap_pcalloc(p, sizeof(alias_dir_conf));
return a;
}
-static void *merge_alias_config(pool *p, void *basev, void *overridesv)
+static void *merge_alias_config(ap_context_t *p, void *basev, void *overridesv)
{
alias_server_conf *a =
(alias_server_conf *) ap_pcalloc(p, sizeof(alias_server_conf));
return a;
}
-static void *merge_alias_dir_config(pool *p, void *basev, void *overridesv)
+static void *merge_alias_dir_config(ap_context_t *p, void *basev, void *overridesv)
{
alias_dir_conf *a =
(alias_dir_conf *) ap_pcalloc(p, sizeof(alias_dir_conf));
return urip - uri;
}
-static char *try_alias_list(request_rec *r, array_header *aliases, int doesc, int *status)
+static char *try_alias_list(request_rec *r, ap_array_header_t *aliases, int doesc, int *status)
{
alias_entry *entries = (alias_entry *) aliases->elts;
regmatch_t regm[10];
merge_alias_dir_config, /* dir merger --- default is to override */
create_alias_config, /* server config */
merge_alias_config, /* merge server configs */
- alias_cmds, /* command table */
+ alias_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
module MODULE_VAR_EXPORT dir_module;
typedef struct dir_config_struct {
- array_header *index_names;
+ ap_array_header_t *index_names;
} dir_config_rec;
#define DIR_CMD_PERMS OR_INDEXES
{NULL}
};
-static void *create_dir_config(pool *p, char *dummy)
+static void *create_dir_config(ap_context_t *p, char *dummy)
{
dir_config_rec *new =
(dir_config_rec *) ap_pcalloc(p, sizeof(dir_config_rec));
return (void *) new;
}
-static void *merge_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_dir_configs(ap_context_t *p, void *basev, void *addv)
{
dir_config_rec *new = (dir_config_rec *) ap_pcalloc(p, sizeof(dir_config_rec));
dir_config_rec *base = (dir_config_rec *) basev;
merge_dir_configs, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- dir_cmds, /* command table */
+ dir_cmds, /* command ap_table_t */
dir_handlers, /* handlers */
NULL /* register hooks */
};
#include "http_log.h"
#include "util_script.h"
-#define IMAP_MAGIC_TYPE "application/x-httpd-imap"
+#define IMAP_MAGIC_TYPE "application/x-httpd ap_context_t map"
#define MAXVERTS 100
#define X 0
#define Y 1
char *imap_base;
} imap_conf_rec;
-static void *create_imap_dir_config(pool *p, char *dummy)
+static void *create_imap_dir_config(ap_context_t *p, char *dummy)
{
imap_conf_rec *icr =
(imap_conf_rec *) ap_palloc(p, sizeof(imap_conf_rec));
return icr;
}
-static void *merge_imap_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_imap_dir_configs(ap_context_t *p, void *basev, void *addv)
{
imap_conf_rec *new = (imap_conf_rec *) ap_pcalloc(p, sizeof(imap_conf_rec));
imap_conf_rec *base = (imap_conf_rec *) basev;
merge_imap_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- imap_cmds, /* command table */
+ imap_cmds, /* command ap_table_t */
imap_handlers, /* handlers */
NULL /* register hooks */
};
*/
typedef struct {
- array_header *language_priority;
+ ap_array_header_t *language_priority;
} neg_dir_config;
module MODULE_VAR_EXPORT negotiation_module;
-static void *create_neg_dir_config(pool *p, char *dummy)
+static void *create_neg_dir_config(ap_context_t *p, char *dummy)
{
neg_dir_config *new = (neg_dir_config *) ap_palloc(p, sizeof(neg_dir_config));
return new;
}
-static void *merge_neg_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_neg_dir_configs(ap_context_t *p, void *basev, void *addv)
{
neg_dir_config *base = (neg_dir_config *) basev;
neg_dir_config *add = (neg_dir_config *) addv;
static const char *set_language_priority(cmd_parms *cmd, void *n, char *lang)
{
- array_header *arr = ((neg_dir_config *) n)->language_priority;
+ ap_array_header_t *arr = ((neg_dir_config *) n)->language_priority;
char **langp = (char **) ap_push_array(arr);
*langp = lang;
char *mime_type; /* MUST be lowercase */
char *file_name;
const char *content_encoding;
- array_header *content_languages; /* list of languages for this variant */
+ ap_array_header_t *content_languages; /* list of languages for this variant */
char *content_charset;
char *description;
*/
typedef struct {
- pool *pool;
+ ap_context_t *pool;
request_rec *r;
char *dir_name;
int accept_q; /* 1 if an Accept item has a q= param */
/* the array pointers below are NULL if the corresponding accept
* headers are not present
*/
- array_header *accepts; /* accept_recs */
- array_header *accept_encodings; /* accept_recs */
- array_header *accept_charsets; /* accept_recs */
- array_header *accept_langs; /* accept_recs */
+ ap_array_header_t *accepts; /* accept_recs */
+ ap_array_header_t *accept_encodings; /* accept_recs */
+ ap_array_header_t *accept_charsets; /* accept_recs */
+ ap_array_header_t *accept_langs; /* accept_recs */
- array_header *avail_vars; /* available variants */
+ ap_array_header_t *avail_vars; /* available variants */
int count_multiviews_variants; /* number of variants found on disk */
* enter the values we recognize into the argument accept_rec
*/
-static const char *get_entry(pool *p, accept_rec *result,
+static const char *get_entry(ap_context_t *p, accept_rec *result,
const char *accept_line)
{
result->quality = 1.0f;
*/
result->name = ap_get_token(p, &accept_line, 0);
- ap_str_tolower(result->name); /* You want case-insensitive,
- * you'll *get* case-insensitive.
+ ap_str_tolower(result->name); /* You want case ap_context_t nsensitive,
+ * you'll *get* case ap_context_t nsensitive.
*/
/* KLUDGE!!! Default HTML to level 2.0 unless the browser
* where charset is only valid in Accept.
*/
-static array_header *do_header_line(pool *p, const char *accept_line)
+static ap_array_header_t *do_header_line(ap_context_t *p, const char *accept_line)
{
- array_header *accept_recs;
+ ap_array_header_t *accept_recs;
if (!accept_line) {
return NULL;
* return an array containing the languages of this variant
*/
-static array_header *do_languages_line(pool *p, const char **lang_line)
+static ap_array_header_t *do_languages_line(ap_context_t *p, const char **lang_line)
{
- array_header *lang_recs = ap_make_array(p, 2, sizeof(char *));
+ ap_array_header_t *lang_recs = ap_make_array(p, 2, sizeof(char *));
if (!lang_line) {
return lang_recs;
negotiation_state *new =
(negotiation_state *) ap_pcalloc(r->pool, sizeof(negotiation_state));
accept_rec *elts;
- table *hdrs = r->headers_in;
+ ap_table_t *hdrs = r->headers_in;
int i;
new->pool = r->pool;
* to set lang_index.
*/
-static int find_lang_index(array_header *accept_langs, char *lang)
+static int find_lang_index(ap_array_header_t *accept_langs, char *lang)
{
accept_rec *accs;
int i;
static int find_default_index(neg_dir_config *conf, char *lang)
{
- array_header *arr;
+ ap_array_header_t *arr;
int nelts;
char **elts;
int i;
static void set_neg_headers(request_rec *r, negotiation_state *neg,
int alg_result)
{
- table *hdrs;
+ ap_table_t *hdrs;
var_rec *avail_recs = (var_rec *) neg->avail_vars->elts;
const char *sample_type = NULL;
const char *sample_language = NULL;
char *qstr;
char *lenstr;
long len;
- array_header *arr;
+ ap_array_header_t *arr;
int max_vlist_array = (neg->avail_vars->nelts * 21);
int first_variant = 1;
int vary_by_type = 0;
int j;
/* In order to avoid O(n^2) memory copies in building Alternates,
- * we preallocate a table with the maximum substrings possible,
+ * we preallocate a ap_table_t with the maximum substrings possible,
* fill it with the variant list, and then concatenate the entire array.
* Note that if you change the number of substrings pushed, you also
* need to change the calculation of max_vlist_array above.
static char *make_variant_list(request_rec *r, negotiation_state *neg)
{
- array_header *arr;
+ ap_array_header_t *arr;
int i;
int max_vlist_array = (neg->avail_vars->nelts * 15) + 2;
/* In order to avoid O(n^2) memory copies in building the list,
- * we preallocate a table with the maximum substrings possible,
+ * we preallocate a ap_table_t with the maximum substrings possible,
* fill it with the variant list, and then concatenate the entire array.
*/
arr = ap_make_array(r->pool, max_vlist_array, sizeof(char *));
for (i = 0; i < neg->avail_vars->nelts; ++i) {
var_rec *variant = &((var_rec *) neg->avail_vars->elts)[i];
char *filename = variant->file_name ? variant->file_name : "";
- array_header *languages = variant->content_languages;
+ ap_array_header_t *languages = variant->content_languages;
char *description = variant->description ? variant->description : "";
/* The format isn't very neat, and it would be nice to make
{
const char *enc = r->content_encoding;
char *x_enc = NULL;
- array_header *accept_encodings;
+ ap_array_header_t *accept_encodings;
accept_rec *accept_recs;
int i;
merge_neg_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- negotiation_cmds, /* command table */
+ negotiation_cmds, /* command ap_table_t */
negotiation_handlers, /* handlers */
register_hooks /* register hooks */
};
* MODULE-DEFINITION-END
*/
- /* the table of commands we provide */
+ /* the ap_table_t of commands we provide */
static const command_rec command_table[] = {
{ "RewriteEngine", cmd_rewriteengine, NULL, OR_FILEINFO, FLAG,
"On or Off to enable or disable (default) the whole rewriting engine" },
{ NULL }
};
- /* the table of content handlers we provide */
+ /* the ap_table_t of content handlers we provide */
static const handler_rec handler_table[] = {
{ "redirect-handler", handler_redirect },
{ NULL }
config_perdir_merge, /* merge per-dir config structures */
config_server_create, /* create per-server config structures */
config_server_merge, /* merge per-server config structures */
- command_table, /* table of config file commands */
+ command_table, /* ap_table_t of config file commands */
handler_table, /* [#8] MIME-typed-dispatched handlers */
hook_uri2file, /* [#1] URI to filename translation */
NULL, /* [#4] validate user id from request */
**
*/
-static void *config_server_create(pool *p, server_rec *s)
+static void *config_server_create(ap_context_t *p, server_rec *s)
{
rewrite_server_conf *a;
return (void *)a;
}
-static void *config_server_merge(pool *p, void *basev, void *overridesv)
+static void *config_server_merge(ap_context_t *p, void *basev, void *overridesv)
{
rewrite_server_conf *a, *base, *overrides;
**
*/
-static void *config_perdir_create(pool *p, char *path)
+static void *config_perdir_create(ap_context_t *p, char *path)
{
rewrite_perdir_conf *a;
return (void *)a;
}
-static void *config_perdir_merge(pool *p, void *basev, void *overridesv)
+static void *config_perdir_merge(ap_context_t *p, void *basev, void *overridesv)
{
rewrite_perdir_conf *a, *base, *overrides;
return err;
}
-static const char *cmd_rewriteoptions_setoption(pool *p, int *options,
+static const char *cmd_rewriteoptions_setoption(ap_context_t *p, int *options,
char *name)
{
if (strcasecmp(name, "inherit") == 0) {
}
/* now be careful: Under the POSIX regex library
- we can compile the pattern for case-insensitive matching,
+ we can compile the pattern for case ap_context_t nsensitive matching,
under the old V8 library we have to do it self via a hack */
if (new->flags & CONDFLAG_NOCASE) {
rc = ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED|REG_ICASE))
return NULL;
}
-static const char *cmd_rewritecond_parseflagfield(pool *p,
+static const char *cmd_rewritecond_parseflagfield(ap_context_t *p,
rewritecond_entry *cfg,
char *str)
{
return NULL;
}
-static const char *cmd_rewritecond_setflag(pool *p, rewritecond_entry *cfg,
+static const char *cmd_rewritecond_setflag(ap_context_t *p, rewritecond_entry *cfg,
char *key, char *val)
{
if ( strcasecmp(key, "nocase") == 0
return NULL;
}
-static const char *cmd_rewriterule_parseflagfield(pool *p,
+static const char *cmd_rewriterule_parseflagfield(ap_context_t *p,
rewriterule_entry *cfg,
char *str)
{
return NULL;
}
-static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg,
+static const char *cmd_rewriterule_setflag(ap_context_t *p, rewriterule_entry *cfg,
char *key, char *val)
{
int status = 0;
**
*/
-static void init_module(server_rec *s, pool *p)
+static void init_module(server_rec *s, ap_context_t *p)
{
/* check if proxy module is available */
proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL);
**
*/
-static void init_child(server_rec *s, pool *p)
+static void init_child(server_rec *s, ap_context_t *p)
{
/* open the rewriting lockfile */
rewritelock_open(s, p);
* Apply a complete rule set,
* i.e. a list of rewrite rules
*/
-static int apply_rewrite_list(request_rec *r, array_header *rewriterules,
+static int apply_rewrite_list(request_rec *r, ap_array_header_t *rewriterules,
char *perdir)
{
rewriterule_entry *entries;
backrefinfo *briRC = NULL;
int prefixstrip;
int failed;
- array_header *rewriteconds;
+ ap_array_header_t *rewriteconds;
rewritecond_entry *conds;
rewritecond_entry *c;
int i;
* make sure we really match against the complete URL.
*/
if (perdir != NULL && r->path_info != NULL && r->path_info[0] != '\0') {
- rewritelog(r, 3, "[per-dir %s] add path-info postfix: %s -> %s%s",
+ rewritelog(r, 3, "[per-dir %s] add path ap_context_t nfo postfix: %s -> %s%s",
perdir, uri, uri, r->path_info);
uri = ap_pstrcat(r->pool, uri, r->path_info, NULL);
}
**
*/
-static void expand_backref_inbuffer(pool *p, char *buf, int nbuf,
+static void expand_backref_inbuffer(ap_context_t *p, char *buf, int nbuf,
backrefinfo *bri, char c)
{
int i;
{
void *sconf;
rewrite_server_conf *conf;
- array_header *rewritemaps;
+ ap_array_header_t *rewritemaps;
rewritemap_entry *entries;
rewritemap_entry *s;
char *value;
*/
-static void open_rewritelog(server_rec *s, pool *p)
+static void open_rewritelog(server_rec *s, ap_context_t *p)
{
rewrite_server_conf *conf;
char *fname;
#define REWRITELOCK_MODE ( S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH )
#endif
-static void rewritelock_create(server_rec *s, pool *p)
+static void rewritelock_create(server_rec *s, ap_context_t *p)
{
rewrite_server_conf *conf;
return;
}
-static void rewritelock_open(server_rec *s, pool *p)
+static void rewritelock_open(server_rec *s, ap_context_t *p)
{
rewrite_server_conf *conf;
** +-------------------------------------------------------+
*/
-static void run_rewritemap_programs(server_rec *s, pool *p)
+static void run_rewritemap_programs(server_rec *s, ap_context_t *p)
{
rewrite_server_conf *conf;
FILE *fpin;
FILE *fpout;
FILE *fperr;
- array_header *rewritemaps;
+ ap_array_header_t *rewritemaps;
rewritemap_entry *entries;
rewritemap_entry *map;
int i;
rsub = subrecfunc(r->filename, r); \
/* now recursively lookup the variable in the sub_req */ \
result = lookup_variable(rsub, var+5); \
- /* copy it up to our scope before we destroy sub_req's pool */ \
+ /* copy it up to our scope before we destroy sub_req's ap_context_t */ \
result = ap_pstrdup(r->pool, result); \
/* cleanup by destroying the subrequest */ \
ap_destroy_sub_req(rsub); \
static char *lookup_header(request_rec *r, const char *name)
{
- array_header *hdrs_arr;
+ ap_array_header_t *hdrs_arr;
table_entry *hdrs;
int i;
*/
-static cache *init_cache(pool *p)
+static cache *init_cache(ap_context_t *p)
{
cache *c;
#include "http_vhost.h"
/*
- * The key in the r->notes table wherein we store our accumulated
+ * The key in the r->notes ap_table_t wherein we store our accumulated
* Vary values, and the one used for per-condition checks in a chain.
*/
#define VARY_KEY "rewrite-Vary"
} rewritecond_entry;
typedef struct {
- array_header *rewriteconds; /* the corresponding RewriteCond entries */
+ ap_array_header_t *rewriteconds; /* the corresponding RewriteCond entries */
char *pattern; /* the RegExp pattern string */
regex_t *regexp; /* the RegExp pattern compilation */
char *output; /* the Substitution string */
char *rewritelogfile; /* the RewriteLog filename */
int rewritelogfp; /* the RewriteLog open filepointer */
int rewriteloglevel; /* the RewriteLog level of verbosity */
- array_header *rewritemaps; /* the RewriteMap entries */
- array_header *rewriteconds; /* the RewriteCond entries (temporary) */
- array_header *rewriterules; /* the RewriteRule entries */
+ ap_array_header_t *rewritemaps; /* the RewriteMap entries */
+ ap_array_header_t *rewriteconds; /* the RewriteCond entries (temporary) */
+ ap_array_header_t *rewriterules; /* the RewriteRule entries */
server_rec *server; /* the corresponding server indicator */
} rewrite_server_conf;
typedef struct {
int state; /* the RewriteEngine state */
int options; /* the RewriteOption state */
- array_header *rewriteconds; /* the RewriteCond entries (temporary) */
- array_header *rewriterules; /* the RewriteRule entries */
+ ap_array_header_t *rewriteconds; /* the RewriteCond entries (temporary) */
+ ap_array_header_t *rewriterules; /* the RewriteRule entries */
char *directory; /* the directory where it applies */
char *baseurl; /* the base-URL where it applies */
} rewrite_perdir_conf;
/* the cache structures,
- * a 4-way hash table with LRU functionality
+ * a 4-way hash ap_table_t with LRU functionality
*/
typedef struct cacheentry {
time_t time;
typedef struct cachelist {
char *resource;
- array_header *entries;
- array_header *tlb;
+ ap_array_header_t *entries;
+ ap_array_header_t *tlb;
} cachelist;
typedef struct cache {
- pool *pool;
- array_header *lists;
+ ap_context_t *pool;
+ ap_array_header_t *lists;
} cache;
*/
/* config structure handling */
-static void *config_server_create(pool *p, server_rec *s);
-static void *config_server_merge (pool *p, void *basev, void *overridesv);
-static void *config_perdir_create(pool *p, char *path);
-static void *config_perdir_merge (pool *p, void *basev, void *overridesv);
+static void *config_server_create(ap_context_t *p, server_rec *s);
+static void *config_server_merge (ap_context_t *p, void *basev, void *overridesv);
+static void *config_perdir_create(ap_context_t *p, char *path);
+static void *config_perdir_merge (ap_context_t *p, void *basev, void *overridesv);
/* config directive handling */
static const char *cmd_rewriteengine(cmd_parms *cmd,
static const char *cmd_rewriteoptions(cmd_parms *cmd,
rewrite_perdir_conf *dconf,
char *option);
-static const char *cmd_rewriteoptions_setoption(pool *p, int *options,
+static const char *cmd_rewriteoptions_setoption(ap_context_t *p, int *options,
char *name);
static const char *cmd_rewritelog (cmd_parms *cmd, void *dconf, char *a1);
static const char *cmd_rewriteloglevel(cmd_parms *cmd, void *dconf, char *a1);
char *a1);
static const char *cmd_rewritecond(cmd_parms *cmd, rewrite_perdir_conf *dconf,
char *str);
-static const char *cmd_rewritecond_parseflagfield(pool *p,
+static const char *cmd_rewritecond_parseflagfield(ap_context_t *p,
rewritecond_entry *new,
char *str);
-static const char *cmd_rewritecond_setflag(pool *p, rewritecond_entry *cfg,
+static const char *cmd_rewritecond_setflag(ap_context_t *p, rewritecond_entry *cfg,
char *key, char *val);
static const char *cmd_rewriterule(cmd_parms *cmd, rewrite_perdir_conf *dconf,
char *str);
-static const char *cmd_rewriterule_parseflagfield(pool *p,
+static const char *cmd_rewriterule_parseflagfield(ap_context_t *p,
rewriterule_entry *new,
char *str);
-static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg,
+static const char *cmd_rewriterule_setflag(ap_context_t *p, rewriterule_entry *cfg,
char *key, char *val);
/* initialisation */
-static void init_module(server_rec *s, pool *p);
-static void init_child(server_rec *s, pool *p);
+static void init_module(server_rec *s, ap_context_t *p);
+static void init_child(server_rec *s, ap_context_t *p);
/* runtime hooks */
static int hook_uri2file (request_rec *r);
static int handler_redirect(request_rec *r);
/* rewriting engine */
-static int apply_rewrite_list(request_rec *r, array_header *rewriterules,
+static int apply_rewrite_list(request_rec *r, ap_array_header_t *rewriterules,
char *perdir);
static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p,
char *perdir);
static void splitout_queryargs(request_rec *r, int qsappend);
static void fully_qualify_uri(request_rec *r);
static void reduce_uri(request_rec *r);
-static void expand_backref_inbuffer(pool *p, char *buf, int nbuf,
+static void expand_backref_inbuffer(ap_context_t *p, char *buf, int nbuf,
backrefinfo *bri, char c);
static char *expand_tildepaths(request_rec *r, char *uri);
static void expand_map_lookups(request_rec *r, char *uri, int uri_len);
static int rewrite_rand(int l, int h);
/* rewriting logfile support */
-static void open_rewritelog(server_rec *s, pool *p);
+static void open_rewritelog(server_rec *s, ap_context_t *p);
static void rewritelog(request_rec *r, int level, const char *text, ...)
__attribute__((format(printf,3,4)));
static char *current_logtime(request_rec *r);
/* rewriting lockfile support */
-static void rewritelock_create(server_rec *s, pool *p);
-static void rewritelock_open(server_rec *s, pool *p);
+static void rewritelock_create(server_rec *s, ap_context_t *p);
+static void rewritelock_open(server_rec *s, ap_context_t *p);
static void rewritelock_remove(void *data);
static void rewritelock_alloc(request_rec *r);
static void rewritelock_free(request_rec *r);
/* program map support */
-static void run_rewritemap_programs(server_rec *s, pool *p);
+static void run_rewritemap_programs(server_rec *s, ap_context_t *p);
static int rewritemap_program_child(void *cmd, child_info *pinfo);
/* env variable support */
static char *lookup_header(request_rec *r, const char *name);
/* caching functions */
-static cache *init_cache(pool *p);
+static cache *init_cache(ap_context_t *p);
static char *get_cache_string(cache *c, char *res, int mode, time_t mtime,
char *key);
static void set_cache_string(cache *c, char *res, int mode, time_t mtime,
* You can use this to dynamically change the capability of your server
* without bringing it down.
*
- * Because currently there is only limited built-in support in the Configure
+ * Because currently there is only limited built ap_context_t n support in the Configure
* script for creating the shared library files (`.so'), please consult your
* vendors cc(1), ld(1) and dlopen(3) manpages to find out the appropriate
* compiler and linker flags and insert them manually into the Configuration
} moduleinfo;
typedef struct so_server_conf {
- array_header *loaded_modules;
+ ap_array_header_t *loaded_modules;
} so_server_conf;
-static void *so_sconf_create(pool *p, server_rec *s)
+static void *so_sconf_create(ap_context_t *p, server_rec *s)
{
so_server_conf *soc;
ap_add_loaded_module(modp);
/*
- * Register a cleanup in the config pool (normally pconf). When
+ * Register a cleanup in the config ap_context_t (normally pconf). When
* we do a restart (or shutdown) this cleanup will cause the
* shared object to be unloaded.
*/
NULL, /* merge per-dir config */
so_sconf_create, /* server config */
NULL, /* merge server config */
- so_cmds, /* command table */
+ so_cmds, /* command ap_table_t */
NULL, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
* bother to have such a function.
*/
-static void *mkconfig(pool *p)
+static void *mkconfig(ap_context_t *p)
{
spconfig *cfg = ap_pcalloc(p, sizeof(spconfig));
* Respond to a callback to create configuration record for a server or
* vhost environment.
*/
-static void *create_mconfig_for_server(pool *p, server_rec *s)
+static void *create_mconfig_for_server(ap_context_t *p, server_rec *s)
{
return mkconfig(p);
}
/*
* Respond to a callback to create a config record for a specific directory.
*/
-static void *create_mconfig_for_directory(pool *p, char *dir)
+static void *create_mconfig_for_directory(ap_context_t *p, char *dir)
{
return mkconfig(p);
}
int filoc, dotloc, urlen, pglen;
DIR *dirp;
struct DIR_TYPE *dir_entry;
- array_header *candidates = NULL;
+ ap_array_header_t *candidates = NULL;
cfg = ap_get_module_config(r->per_dir_config, &speling_module);
if (!cfg->enabled) {
* returned.
*/
else {
- pool *p;
- table *notes;
- pool *sub_pool;
- array_header *t;
- array_header *v;
+ ap_context_t *p;
+ ap_table_t *notes;
+ ap_context_t *sub_pool;
+ ap_array_header_t *t;
+ ap_array_header_t *v;
if (r->main == NULL) {
}
- /* Pass our table to http_protocol.c (see mod_negotiation): */
+ /* Pass our ap_table_t to http_protocol.c (see mod_negotiation): */
ap_table_setn(notes, "variant-list", ap_array_pstrcat(p, t, 0));
ap_table_mergen(r->subprocess_env, "VARIANTS",
NULL, /* merge per-dir config */
create_mconfig_for_server, /* server config */
NULL, /* merge server config */
- speling_cmds, /* command table */
+ speling_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
typedef struct userdir_config {
int globally_disabled;
char *userdir;
- table *enabled_users;
- table *disabled_users;
+ ap_table_t *enabled_users;
+ ap_table_t *disabled_users;
} userdir_config;
/*
* explicit) disablement, and the replacement string for all others.
*/
-static void *create_userdir_config(pool *p, server_rec *s)
+static void *create_userdir_config(ap_context_t *p, server_rec *s)
{
userdir_config
* newcfg = (userdir_config *) ap_pcalloc(p, sizeof(userdir_config));
const char
*usernames = arg;
char *kw = ap_getword_conf(cmd->pool, &usernames);
- table *usertable;
+ ap_table_t *usertable;
/*
* Let's do the comparisons once.
NULL, /* dir merger --- default is to override */
create_userdir_config, /* server config */
NULL, /* merge server config */
- userdir_cmds, /* command table */
+ userdir_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
mva_mode_e cgi_root_mode;
} mva_sconf_t;
-static void *mva_create_server_config(pool *p, server_rec *s)
+static void *mva_create_server_config(ap_context_t *p, server_rec *s)
{
mva_sconf_t *conf;
return conf;
}
-static void *mva_merge_server_config(pool *p, void *parentv, void *childv)
+static void *mva_merge_server_config(ap_context_t *p, void *parentv, void *childv)
{
mva_sconf_t *parent = (mva_sconf_t *) parentv;
mva_sconf_t *child = (mva_sconf_t *) childv;
NULL, /* dir merger --- default is to override */
mva_create_server_config, /* server config */
mva_merge_server_config, /* merge server configs */
- mva_commands, /* command table */
+ mva_commands, /* command ap_table_t */
NULL, /* handlers */
mva_translate, /* filename translation */
NULL, /* check_user_id */
char *metafiles;
} cern_meta_dir_config;
-static void *create_cern_meta_dir_config(pool *p, char *dummy)
+static void *create_cern_meta_dir_config(ap_context_t *p, char *dummy)
{
cern_meta_dir_config *new =
(cern_meta_dir_config *) ap_palloc(p, sizeof(cern_meta_dir_config));
return new;
}
-static void *merge_cern_meta_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_cern_meta_dir_configs(ap_context_t *p, void *basev, void *addv)
{
cern_meta_dir_config *base = (cern_meta_dir_config *) basev;
cern_meta_dir_config *add = (cern_meta_dir_config *) addv;
char w[MAX_STRING_LEN];
char *l;
int p;
- table *tmp_headers;
+ ap_table_t *tmp_headers;
tmp_headers = ap_make_table(r->pool, 5);
while (fgets(w, MAX_STRING_LEN - 1, f) != NULL) {
merge_cern_meta_dir_configs,/* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
- cern_meta_cmds, /* command table */
+ cern_meta_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
* 08.Dec.95 Now allows PassEnv directive to appear more than once in
* conf files.
* 10.Dec.95 optimisation. getenv() only called at startup and used
- * to build a fast-to-access table. table used to build
+ * to build a fast-to-access table. ap_table_t used to build
* per-server environment for each request.
* robustness. better able to handle errors in configuration
* files:
#include "http_request.h"
typedef struct {
- table *vars;
+ ap_table_t *vars;
char *unsetenv;
int vars_present;
} env_dir_config_rec;
module MODULE_VAR_EXPORT env_module;
-static void *create_env_dir_config(pool *p, char *dummy)
+static void *create_env_dir_config(ap_context_t *p, char *dummy)
{
env_dir_config_rec *new =
(env_dir_config_rec *) ap_palloc(p, sizeof(env_dir_config_rec));
return (void *) new;
}
-static void *merge_env_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_env_dir_configs(ap_context_t *p, void *basev, void *addv)
{
env_dir_config_rec *base = (env_dir_config_rec *) basev;
env_dir_config_rec *add = (env_dir_config_rec *) addv;
env_dir_config_rec *new =
(env_dir_config_rec *) ap_palloc(p, sizeof(env_dir_config_rec));
- table *new_table;
- table_entry *elts;
- array_header *arr;
+ ap_table_t *new_table;
+ ap_table_entry_t *elts;
+ ap_array_header_t *arr;
int i;
const char *uenv, *unset;
new_table = ap_copy_table(p, base->vars);
arr = ap_table_elts(add->vars);
- elts = (table_entry *)arr->elts;
+ elts = (ap_table_entry_t *)arr->elts;
for (i = 0; i < arr->nelts; ++i) {
ap_table_setn(new_table, elts[i].key, elts[i].val);
env_dir_config_rec *sconf,
const char *arg)
{
- table *vars = sconf->vars;
+ ap_table_t *vars = sconf->vars;
char *env_var;
char *name_ptr;
env_dir_config_rec *sconf,
const char *arg)
{
- table *vars = sconf->vars;
+ ap_table_t *vars = sconf->vars;
char *name, *value;
name = ap_getword_conf(cmd->pool, &arg);
static int fixup_env_module(request_rec *r)
{
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
env_dir_config_rec *sconf = ap_get_module_config(r->per_dir_config,
&env_module);
- table *vars = sconf->vars;
+ ap_table_t *vars = sconf->vars;
if (!sconf->vars_present)
return DECLINED;
merge_env_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
- env_module_cmds, /* command table */
+ env_module_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
typedef struct {
int active;
char *expiresdefault;
- table *expiresbytype;
+ ap_table_t *expiresbytype;
} expires_dir_config;
/* from mod_dir, why is this alias used?
module MODULE_VAR_EXPORT expires_module;
-static void *create_dir_expires_config(pool *p, char *dummy)
+static void *create_dir_expires_config(ap_context_t *p, char *dummy)
{
expires_dir_config *new =
(expires_dir_config *) ap_pcalloc(p, sizeof(expires_dir_config));
* string. If we return NULL then real_code contains code converted
* to the cnnnn format.
*/
-static char *check_code(pool *p, const char *code, char **real_code)
+static char *check_code(ap_context_t *p, const char *code, char **real_code)
{
char *word;
char base = 'X';
{NULL}
};
-static void *merge_expires_dir_configs(pool *p, void *basev, void *addv)
+static void *merge_expires_dir_configs(ap_context_t *p, void *basev, void *addv)
{
expires_dir_config *new = (expires_dir_config *) ap_pcalloc(p, sizeof(expires_dir_config));
expires_dir_config *base = (expires_dir_config *) basev;
merge_expires_dir_configs, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
- expires_cmds, /* command table */
+ expires_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
* a per-dir and per-server config
*/
typedef struct {
- array_header *headers;
+ ap_array_header_t *headers;
} headers_conf;
module MODULE_VAR_EXPORT headers_module;
-static void *create_headers_config(pool *p, server_rec *s)
+static void *create_headers_config(ap_context_t *p, server_rec *s)
{
headers_conf *a =
(headers_conf *) ap_pcalloc(p, sizeof(headers_conf));
return a;
}
-static void *create_headers_dir_config(pool *p, char *d)
+static void *create_headers_dir_config(ap_context_t *p, char *d)
{
return (headers_conf *) create_headers_config(p, NULL);
}
-static void *merge_headers_config(pool *p, void *basev, void *overridesv)
+static void *merge_headers_config(ap_context_t *p, void *basev, void *overridesv)
{
headers_conf *a =
(headers_conf *) ap_pcalloc(p, sizeof(headers_conf));
{NULL}
};
-static void do_headers_fixup(request_rec *r, array_header *headers)
+static void do_headers_fixup(request_rec *r, ap_array_header_t *headers)
{
int i;
merge_headers_config, /* dir merger --- default is to override */
create_headers_config, /* server config */
merge_headers_config, /* merge server configs */
- headers_cmds, /* command table */
+ headers_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
*
* For compliance with Mr Darwin's terms: this has been very significantly
* modified from the free "file" command.
- * - all-in-one file for compilation convenience when moving from one
+ * - all ap_context_t n-one file for compilation convenience when moving from one
* version of Apache to the next.
- * - Memory allocation is done through the Apache API's pool structure.
+ * - Memory allocation is done through the Apache API's ap_context_t structure.
* - All functions have had necessary Apache API request or server
* structures passed to them where necessary to call other Apache API
* routines. (i.e. usually for logging, files, or memory allocation in
static int getvalue(server_rec *, struct magic *, char **);
static int hextoint(int);
static char *getstr(server_rec *, char *, char *, int, int *);
-static int parse(server_rec *, pool *p, char *, int);
+static int parse(server_rec *, ap_context_t *p, char *, int);
static int match(request_rec *, unsigned char *, int);
static int mget(request_rec *, union VALUETYPE *, unsigned char *,
* make HOWMANY too high unless you have a very fast CPU.
*/
-/* these types are used to index the table 'types': keep em in sync! */
+/* these types are used to index the ap_table_t 'types': keep em in sync! */
/* HTML inserted in first because this is a web server module now */
#define L_HTML 0 /* HTML */
#define L_C 1 /* first and foremost on UNIX */
module mime_magic_module;
-static void *create_magic_server_config(pool *p, server_rec *d)
+static void *create_magic_server_config(ap_context_t *p, server_rec *d)
{
/* allocate the config - use pcalloc because it needs to be zeroed */
return ap_pcalloc(p, sizeof(magic_server_config_rec));
}
-static void *merge_magic_server_config(pool *p, void *basev, void *addv)
+static void *merge_magic_server_config(ap_context_t *p, void *basev, void *addv)
{
magic_server_config_rec *base = (magic_server_config_rec *) basev;
magic_server_config_rec *add = (magic_server_config_rec *) addv;
* apprentice - load configuration from the magic file r
* API request record
*/
-static int apprentice(server_rec *s, pool *p)
+static int apprentice(server_rec *s, ap_context_t *p)
{
FILE *f;
char line[BUFSIZ + 1];
/*
* parse one line from magic file, put into magic[index++] if valid
*/
-static int parse(server_rec *serv, pool *p, char *l, int lineno)
+static int parse(server_rec *serv, ap_context_t *p, char *l, int lineno)
{
struct magic *m;
char *t, *s;
{
struct uncompress_parms parm;
BUFF *bout;
- pool *sub_pool;
+ ap_context_t *sub_pool;
parm.r = r;
parm.method = method;
sum = 0;
p = header->charptr;
- for (i = sizeof(union record); --i >= 0;) {
+ for (i = sizeof(union record); - ap_context_t >= 0;) {
/*
* We can't use unsigned char here because of old compilers, e.g. V7.
*/
}
/* Adjust checksum to count the "chksum" field as blanks. */
- for (i = sizeof(header->header.chksum); --i >= 0;)
+ for (i = sizeof(header->header.chksum); - ap_context_t >= 0;)
sum -= 0xFF & header->header.chksum[i];
sum += ' ' * sizeof header->header.chksum;
* initialize the module
*/
-static void magic_init(server_rec *main_server, pool *p)
+static void magic_init(server_rec *main_server, ap_context_t *p)
{
int result;
magic_server_config_rec *conf;
NULL, /* dir merger --- default is to override */
create_magic_server_config, /* server config */
merge_magic_server_config, /* merge server config */
- mime_magic_cmds, /* command table */
+ mime_magic_cmds, /* command ap_table_t */
NULL, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
char *name; /* header name */
char *regex; /* regex to match against */
regex_t *preg; /* compiled regex */
- table *features; /* env vars to set (or unset) */
+ ap_table_t *features; /* env vars to set (or unset) */
ENUM_BITFIELD( /* is it a "special" header ? */
enum special,
special_type,4);
} sei_entry;
typedef struct {
- array_header *conditionals;
+ ap_array_header_t *conditionals;
} sei_cfg_rec;
module MODULE_VAR_EXPORT setenvif_module;
-static void *create_setenvif_config(pool *p, server_rec *dummy)
+static void *create_setenvif_config(ap_context_t *p, server_rec *dummy)
{
sei_cfg_rec *new = (sei_cfg_rec *) ap_palloc(p, sizeof(sei_cfg_rec));
return (void *) new;
}
-static void *merge_setenvif_config(pool *p, void *basev, void *overridesv)
+static void *merge_setenvif_config(ap_context_t *p, void *basev, void *overridesv)
{
sei_cfg_rec *a = ap_pcalloc(p, sizeof(sei_cfg_rec));
sei_cfg_rec *base = basev, *overrides = overridesv;
server_rec *s = r->server;
sei_cfg_rec *sconf;
sei_entry *entries;
- table_entry *elts;
+ ap_table_entry_t *elts;
const char *val;
int i, j;
char *last_name;
}
if (!ap_regexec(b->preg, val, 0, NULL, 0)) {
- array_header *arr = ap_table_elts(b->features);
- elts = (table_entry *) arr->elts;
+ ap_array_header_t *arr = ap_table_elts(b->features);
+ elts = (ap_table_entry_t *) arr->elts;
for (j = 0; j < arr->nelts; ++j) {
if (!strcmp(elts[j].val, "!")) {
NULL, /* dir merger --- default is to override */
create_setenvif_config, /* server config */
merge_setenvif_config, /* merge server configs */
- setenvif_module_cmds, /* command table */
+ setenvif_module_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
unique_id_rec_total_size,
unique_id_rec_size_uu;
-static void unique_id_global_init(server_rec *s, pool *p)
+static void unique_id_global_init(server_rec *s, ap_context_t *p)
{
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
#endif
}
-static void unique_id_child_init(server_rec *s, pool *p)
+static void unique_id_child_init(server_rec *s, ap_context_t *p)
{
pid_t pid;
#ifndef NO_GETTIMEOFDAY
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server configs */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
NULL, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
return OK; /* We set our cookie */
}
-static void *make_cookie_log_state(pool *p, server_rec *s)
+static void *make_cookie_log_state(ap_context_t *p, server_rec *s)
{
cookie_log_state *cls =
(cookie_log_state *) ap_palloc(p, sizeof(cookie_log_state));
return (void *) cls;
}
-static void *make_cookie_dir(pool *p, char *d)
+static void *make_cookie_dir(ap_context_t *p, char *d)
{
cookie_dir_rec *dcfg;
NULL, /* dir merger --- default is to override */
make_cookie_log_state, /* server config */
NULL, /* merge server configs */
- cookie_log_cmds, /* command table */
+ cookie_log_cmds, /* command ap_table_t */
NULL, /* handlers */
register_hooks /* register hooks */
};
return OK; /* otherwise; we've done the best we can */
}
-static void proxy_init(server_rec *r, pool *p)
+static void proxy_init(server_rec *r, ap_context_t *p)
{
ap_proxy_garbage_init(r, p);
}
void *sconf = r->server->module_config;
proxy_server_conf *conf =
(proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
- array_header *proxies = conf->proxies;
+ ap_array_header_t *proxies = conf->proxies;
struct proxy_remote *ents = (struct proxy_remote *) proxies->elts;
int i, rc;
cache_req *cr;
/* Setup configurable data */
static void *
- create_proxy_config(pool *p, server_rec *s)
+ create_proxy_config(ap_context_t *p, server_rec *s)
{
proxy_server_conf *ps = ap_pcalloc(p, sizeof(proxy_server_conf));
NULL, /* merge per-directory config structures */
create_proxy_config, /* create per-server config structure */
NULL, /* merge per-server config structures */
- proxy_cmds, /* command table */
+ proxy_cmds, /* command ap_table_t */
proxy_handlers, /* handlers */
proxy_trans, /* translate_handler */
NULL, /* check_user_id */
typedef struct {
struct cache_conf cache; /* cache configuration */
- array_header *proxies;
- array_header *aliases;
- array_header *raliases;
- array_header *noproxies;
- array_header *dirconn;
- array_header *nocaches;
- array_header *allowed_connect_ports;
+ ap_array_header_t *proxies;
+ ap_array_header_t *aliases;
+ ap_array_header_t *raliases;
+ ap_array_header_t *noproxies;
+ ap_array_header_t *dirconn;
+ ap_array_header_t *nocaches;
+ ap_array_header_t *allowed_connect_ports;
char *domain; /* domain name to use in absence of a domain name in the request */
int req; /* true if proxy requests are enabled */
enum {
unsigned int written; /* total *content* bytes written to cache */
float cache_completion; /* specific to this request */
char *resp_line; /* the whole status like (protocol, code + message) */
- table *hdrs; /* the HTTP headers of the file */
+ ap_table_t *hdrs; /* the HTTP headers of the file */
} cache_req;
/* Additional information passed to the function called by ap_table_do() */
void ap_proxy_cache_tidy(cache_req *c);
int ap_proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf,
cache_req **cr);
-int ap_proxy_cache_update(cache_req *c, table *resp_hdrs,
+int ap_proxy_cache_update(cache_req *c, ap_table_t *resp_hdrs,
const int is_HTTP1, int nocache);
void ap_proxy_garbage_coll(request_rec *r);
int ap_proxy_hex2c(const char *x);
void ap_proxy_c2hex(int ch, char *x);
-char *ap_proxy_canonenc(pool *p, const char *x, int len, enum enctype t,
+char *ap_proxy_canonenc(ap_context_t *p, const char *x, int len, enum enctype t,
int isenc);
-char *ap_proxy_canon_netloc(pool *p, char **const urlp, char **userp,
+char *ap_proxy_canon_netloc(ap_context_t *p, char **const urlp, char **userp,
char **passwordp, char **hostp, int *port);
-const char *ap_proxy_date_canon(pool *p, const char *x);
+const char *ap_proxy_date_canon(ap_context_t *p, const char *x);
table *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF *f);
long int ap_proxy_send_fb(BUFF *f, request_rec *r, cache_req *c);
-void ap_proxy_send_headers(request_rec *r, const char *respline, table *hdrs);
+void ap_proxy_send_headers(request_rec *r, const char *respline, ap_table_t *hdrs);
int ap_proxy_liststr(const char *list, const char *val);
void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength);
int ap_proxy_hex2sec(const char *x);
cache_req *ap_proxy_cache_error(cache_req *r);
int ap_proxyerror(request_rec *r, int statuscode, const char *message);
const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp);
-int ap_proxy_is_ipaddr(struct dirconn_entry *This, pool *p);
-int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p);
-int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p);
-int ap_proxy_is_word(struct dirconn_entry *This, pool *p);
+int ap_proxy_is_ipaddr(struct dirconn_entry *This, ap_context_t *p);
+int ap_proxy_is_domainname(struct dirconn_entry *This, ap_context_t *p);
+int ap_proxy_is_hostname(struct dirconn_entry *This, ap_context_t *p);
+int ap_proxy_is_word(struct dirconn_entry *This, ap_context_t *p);
int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r);
-int ap_proxy_garbage_init(server_rec *, pool *);
+int ap_proxy_garbage_init(server_rec *, ap_context_t *);
/* This function is called by ap_table_do() for all header lines */
int ap_proxy_send_hdr_line(void *p, const char *key, const char *value);
unsigned ap_proxy_bputs2(const char *data, BUFF *client, cache_req *cache);
int ap_proxy_ftp_canon(request_rec *r, char *url)
{
char *user, *password, *host, *path, *parms, *strp, sport[7];
- pool *p = r->pool;
+ ap_context_t *p = r->pool;
const char *err;
int port;
* with username and password (which was presumably queried from the user)
* supplied in the Authorization: header.
* Note that we "invent" a realm name which consists of the
- * ftp://user@host part of the reqest (sans password -if supplied but invalid-)
+ * ftp://user@host part of the reqest (sans password ap_context_t f supplied but invalid-)
*/
static int ftp_unauthorized (request_rec *r, int log_it)
{
struct sockaddr_in server;
struct hostent server_hp;
struct in_addr destaddr;
- table *resp_hdrs;
+ ap_table_t *resp_hdrs;
BUFF *f;
BUFF *data = NULL;
- pool *p = r->pool;
+ ap_context_t *p = r->pool;
int one = 1;
const long int zero = 0L;
NET_SIZE_T clen;
return url;
}
-/* Clear all connection-based headers from the incoming headers table */
-static void clear_connection(pool *p, table *headers)
+/* Clear all connection-based headers from the incoming headers ap_table_t */
+static void clear_connection(ap_context_t *p, ap_table_t *headers)
{
const char *name;
char *next = ap_pstrdup(p, ap_table_get(headers, "Connection"));
char *strp2;
const char *err, *desthost;
int i, j, sock, len, backasswards;
- array_header *reqhdrs_arr;
- table *resp_hdrs;
+ ap_array_header_t *reqhdrs_arr;
+ ap_table_t *resp_hdrs;
table_entry *reqhdrs;
struct sockaddr_in server;
struct in_addr destaddr;
BUFF *f;
char buffer[HUGE_STRING_LEN];
char portstr[32];
- pool *p = r->pool;
+ ap_context_t *p = r->pool;
const long int zero = 0L;
int destport = 0;
char *destportstr = NULL;
* those which must not be touched.
*/
char *
- ap_proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc)
+ ap_proxy_canonenc(ap_context_t *p, const char *x, int len, enum enctype t, int isenc)
{
int i, j, ch;
char *y;
* Returns an error string.
*/
char *
- ap_proxy_canon_netloc(pool *p, char **const urlp, char **userp,
+ ap_proxy_canon_netloc(ap_context_t *p, char **const urlp, char **userp,
char **passwordp, char **hostp, int *port)
{
int i;
return "Port number in URL > 65535";
}
}
- ap_str_tolower(host); /* DNS names are case-insensitive */
+ ap_str_tolower(host); /* DNS names are case ap_context_t nsensitive */
if (*host == '\0')
return "Missing host in URL";
/* check hostname syntax */
* formatted, then it exits very quickly.
*/
const char *
- ap_proxy_date_canon(pool *p, const char *x)
+ ap_proxy_date_canon(ap_context_t *p, const char *x)
{
int wk, mday, year, hour, min, sec, mon;
char *q, month[4], zone[4], week[4];
*/
table *ap_proxy_read_headers(request_rec *r, char *buffer, int size, BUFF *f)
{
- table *resp_hdrs;
+ ap_table_t *resp_hdrs;
int len;
char *value, *end;
char field[MAX_STRING_LEN];
*
* A timeout should be set before calling this routine.
*/
-void ap_proxy_send_headers(request_rec *r, const char *respline, table *t)
+void ap_proxy_send_headers(request_rec *r, const char *respline, ap_table_t *t)
{
int i;
BUFF *fp = r->connection->client;
/*
- * list is a comma-separated list of case-insensitive tokens, with
+ * list is a comma-separated list of case ap_context_t nsensitive tokens, with
* optional whitespace around the tokens.
* The return returns 1 if the token val is found in the list, or 0
* otherwise.
}
/* Return TRUE if addr represents an IP address (or an IP network address) */
-int ap_proxy_is_ipaddr(struct dirconn_entry *This, pool *p)
+int ap_proxy_is_ipaddr(struct dirconn_entry *This, ap_context_t *p)
{
const char *addr = This->name;
long ip_addr[4];
}
/* Return TRUE if addr represents a domain name */
-int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p)
+int ap_proxy_is_domainname(struct dirconn_entry *This, ap_context_t *p)
{
char *addr = This->name;
int i;
return 0;
/* Strip trailing dots */
- for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i)
+ for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; - ap_context_t )
addr[i] = '\0';
This->matcher = proxy_match_domainname;
}
/* Return TRUE if addr represents a host name */
-int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p)
+int ap_proxy_is_hostname(struct dirconn_entry *This, ap_context_t *p)
{
struct hostent host;
char *addr = This->name;
This->hostentry = ap_pduphostent (p, &host);
/* Strip trailing dots */
- for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i)
+ for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; - ap_context_t )
addr[i] = '\0';
This->matcher = proxy_match_hostname;
}
/* Return TRUE if addr is to be matched as a word */
-int ap_proxy_is_word(struct dirconn_entry *This, pool *p)
+int ap_proxy_is_word(struct dirconn_entry *This, ap_context_t *p)
{
This->matcher = proxy_match_word;
return 1;
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
rndchunk_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
* SetHandler test-util-uri
* </Location>
*
- * Then make a request to /test-util-uri. An html table of errors will
+ * Then make a request to /test-util-uri. An html ap_table_t of errors will
* be output... and a total count of errors.
*/
static unsigned iterate_pieces(request_rec *r, const test_uri_t *pieces, int row)
{
unsigned u;
- pool *sub;
+ ap_context_t *sub;
char *input_uri;
char *strp;
uri_components result;
NULL, /* dir merger --- default is to override */
NULL, /* server config */
NULL, /* merge server config */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
test_util_uri_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
/*
* This file will include OS specific functions which are not inlineable.
- * Any inlineable functions should be defined in os-inline.c instead.
+ * Any inlineable functions should be defined in os ap_context_t nline.c instead.
*/
#include "ap_config.h"
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
- * and prototypes of OS specific functions defined in os.c or os-inline.c
+ * and prototypes of OS specific functions defined in os.c or os ap_context_t nline.c
*/
extern int ap_os_is_path_absolute(const char *file);
/* This routine is called by http_core for the BS2000Account directive */
/* It stores the account name for later use */
-const char *os_set_account(pool *p, const char *account)
+const char *os_set_account(ap_context_t *p, const char *account)
{
char account_temp[ACCT_LEN+1];
"native BS2000", namely EBCDIC.
EBCDIC Table. (Yes, in EBCDIC, the letters 'a'..'z' are not contiguous!)
-This table is bijective, i.e. there are no ambigous or duplicate characters
+This ap_table_t is bijective, i.e. there are no ambigous or duplicate characters
00 00 01 02 03 85 09 86 7f 87 8d 8e 0b 0c 0d 0e 0f *................*
10 10 11 12 13 8f 0a 08 97 18 19 9c 9d 1c 1d 1e 1f *................*
20 80 81 82 83 84 92 17 1b 88 89 8a 8b 8c 05 06 07 *................*
0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e /*0123456789.{.}.~*/
};
-/* This table is (almost) identical to the previous one. The only difference
+/* This ap_table_t is (almost) identical to the previous one. The only difference
* is the fact that it maps every EBCDIC *except 0x0A* to its ASCII
- * equivalent. The reason for this table is simple: Throughout the
+ * equivalent. The reason for this ap_table_t is simple: Throughout the
* server, protocol strings are used in the form
* "Content-Type: text/plain\015\012". Now all the characters in the string
* are stored as EBCDIC, only the semantics of \012 is completely
- * different from LF (look it up in the table above). \015 happens to be
+ * different from LF (look it up in the ap_table_t above). \015 happens to be
* mapped to \015 anyway, so there's no special case for it.
*
* In THIS table, EBCDIC-\012 is mapped to ASCII-\012.
- * This table is therefore used wherever an EBCDIC to ASCII conversion is
+ * This ap_table_t is therefore used wherever an EBCDIC to ASCII conversion is
* needed in the server.
*/
/* ebcdic-to-ascii with \012 mapped to ASCII-\n */
/*
* This file will include OS specific functions which are not inlineable.
- * Any inlineable functions should be defined in os-inline.c instead.
+ * Any inlineable functions should be defined in os ap_context_t nline.c instead.
*/
#include "httpd.h"
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
- * and prototypes of OS specific functions defined in os.c or os-inline.c
+ * and prototypes of OS specific functions defined in os.c or os ap_context_t nline.c
*/
#if !defined(INLINE) && defined(USE_GNU_INLINE)
INLINE int ap_os_is_path_absolute(const char *file);
-#include "os-inline.c"
+#include "os ap_context_t nline.c"
#endif
#ifndef INLINE
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
- * and prototypes of OS specific functions defined in os.c or os-inline.c
+ * and prototypes of OS specific functions defined in os.c or os ap_context_t nline.c
*/
#if defined(__GNUC__) && !defined(INLINE)
INLINE int ap_os_is_path_absolute(const char *file);
-#include "os-inline.c"
+#include "os ap_context_t nline.c"
#endif
#ifndef INLINE
#include "http_log.h"
-API_EXPORT(char *)ap_os_canonical_filename(pool *pPool, const char *szFile)
+API_EXPORT(char *)ap_os_canonical_filename(ap_context_t *pPool, const char *szFile)
{
char buf[HUGE_STRING_LEN];
char buf2[HUGE_STRING_LEN];
/*
Bijective EBCDIC (character set IBM-1047) to US-ASCII table:
-This table is bijective - there are no ambigous or duplicate characters.
+This ap_table_t is bijective - there are no ambigous or duplicate characters.
*/
const unsigned char os_toascii_strictly[256] = {
0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, /* 00-0f: */
/*
Server EBCDIC (character set IBM-1047) to US-ASCII table:
-This table is a copy of the os_toascii_strictly bijective table above.
+This ap_table_t is a copy of the os_toascii_strictly bijective ap_table_t above.
The only change is that hex 0a (\012 octal) is mapped to hex 0a
(ASCII's line feed) instead of hex 8e. This is done because throughout
Apache, protocol string definitions hardcode the linefeed as \012 (octal):
/*
The US-ASCII to EBCDIC (character set IBM-1047) table:
-This table is bijective (no ambiguous or duplicate characters)
+This ap_table_t is bijective (no ambiguous or duplicate characters)
*/
const unsigned char os_toebcdic[256] = {
0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f, /* 00-0f: */
/*
* This file will include OS specific functions which are not inlineable.
- * Any inlineable functions should be defined in os-inline.c instead.
+ * Any inlineable functions should be defined in os ap_context_t nline.c instead.
*/
#include "httpd.h"
-int ap_tpf_spawn_child(pool *p, int (*func) (void *, child_info *),
+int ap_tpf_spawn_child(ap_context_t *p, int (*func) (void *, child_info *),
void *data, enum kill_conditions kill_how,
int *pipe_in, int *pipe_out, int *pipe_err,
int out_fds[], int in_fds[], int err_fds[])
int fd_flags_out, fd_flags_in, fd_flags_err;
struct tpf_fork_input fork_input;
TPF_FORK_CHILD *cld = (TPF_FORK_CHILD *) data;
- array_header *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
+ ap_array_header_t *env_arr = ap_table_elts ((array_header *) cld->subprocess_env);
table_entry *elts = (table_entry *) env_arr->elts;
return 0;
}
-void os_note_additional_cleanups(pool *p, int sd) {
+void os_note_additional_cleanups(ap_context_t *p, int sd) {
char sockfilename[50];
/* write the socket to file so that TPF socket device driver will close socket in case
we happen to abend. */
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
- * and prototypes of OS specific functions defined in os.c or os-inline.c
+ * and prototypes of OS specific functions defined in os.c or os ap_context_t nline.c
*/
#include "ap_config.h"
* part of the header
*/
#define INLINE extern ap_inline
-#include "os-inline.c"
+#include "os ap_context_t nline.c"
#endif
#ifndef INLINE
/*
* This file in included in all Apache source code. It contains definitions
* of facilities available on _this_ operating system (HAVE_* macros),
- * and prototypes of OS specific functions defined in os.c or os-inline.c
+ * and prototypes of OS specific functions defined in os.c or os ap_context_t nline.c
*/
#if !defined(INLINE) && defined(USE_GNU_INLINE)
* function as well).
*
* To load, simply place the ISA in a location in the document tree.
- * Then add an "AddHandler isapi-isa dll" into your config file.
+ * Then add an "AddHandler isapi ap_context_t sa dll" into your config file.
* You should now be able to load ISAPI DLLs just be reffering to their
* URLs. Make sure the ExecCGI option is active in the directory
* the ISA is in.
BOOL (*isapi_term)(DWORD); /* optional entry point 3 */
isapi_cid *cid = ap_pcalloc(r->pool, sizeof(isapi_cid));
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
int retval;
/* Use similar restrictions as CGIs */
BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName,
LPVOID lpvBuffer, LPDWORD lpdwSizeofBuffer) {
request_rec *r = ((isapi_cid *)hConn)->r;
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
const char *result;
/* Mostly, we just grab it from the environment, but there are
}
handler_rec isapi_handlers[] = {
-{ "isapi-isa", isapi_handler },
+{ "isapi ap_context_t sa", isapi_handler },
{ NULL}
};
NULL, /* merge per-dir config */
NULL, /* server config */
NULL, /* merge server config */
- NULL, /* command table */
+ NULL, /* command ap_table_t */
isapi_handlers, /* handlers */
NULL, /* filename translation */
NULL, /* check_user_id */
/* char *crypt(const char *pw, const char *salt); */
#define crypt(buf,salt) (buf)
-/* Use the Windows built-in spawnvp */
+/* Use the Windows built ap_context_t n spawnvp */
#define ap_spawnvp(file, argv) (spawnvp(file, argv))
/* Although DIR_TYPE is dirent (see nt/readdir.h) we need direct.h for
* is present on the existing path. This routine also
* converts alias names to long names.
*/
-API_EXPORT(char *) ap_os_systemcase_filename(pool *pPool,
+API_EXPORT(char *) ap_os_systemcase_filename(ap_context_t *pPool,
const char *szFile)
{
char buf[HUGE_STRING_LEN];
/* Perform canonicalization with the exception that the
* input case is preserved.
*/
-API_EXPORT(char *) ap_os_case_canonical_filename(pool *pPool,
+API_EXPORT(char *) ap_os_case_canonical_filename(ap_context_t *pPool,
const char *szFile)
{
char *pNewStr;
/* Perform complete canonicalization.
*/
-API_EXPORT(char *) ap_os_canonical_filename(pool *pPool, const char *szFile)
+API_EXPORT(char *) ap_os_canonical_filename(ap_context_t *pPool, const char *szFile)
{
char *pNewName;
pNewName = ap_os_case_canonical_filename(pPool, szFile);
)
IMPLEMENT_HOOK_RUN_ALL(int,header_parser,(request_rec *r),(r),OK,DECLINED)
-IMPLEMENT_HOOK_VOID(pre_config,(pool *pconf,pool *plog,pool *ptemp),
+IMPLEMENT_HOOK_VOID(pre_config,(ap_context_t *pconf,ap_context_t *plog,ap_context_t *ptemp),
(pconf,plog,ptemp))
IMPLEMENT_HOOK_VOID(post_config,
- (pool *pconf, pool *plog, pool *ptemp, server_rec *s),
+ (ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s),
(pconf,plog,ptemp,s))
IMPLEMENT_HOOK_VOID(open_logs,
- (pool *pconf, pool *plog, pool *ptemp, server_rec *s),
+ (ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s),
(pconf,plog,ptemp,s))
-IMPLEMENT_HOOK_VOID(child_init,(pool *pchild, server_rec *s),(pchild,s))
+IMPLEMENT_HOOK_VOID(child_init,(ap_context_t *pchild, server_rec *s),(pchild,s))
DEF_Explain
API_VAR_EXPORT module **ap_loaded_modules=NULL;
typedef int (*handler_func) (request_rec *);
-typedef void *(*dir_maker_func) (pool *, char *);
-typedef void *(*merger_func) (pool *, void *, void *);
+typedef void *(*dir_maker_func) (ap_context_t *, char *);
+typedef void *(*merger_func) (ap_context_t *, void *, void *);
/* Dealing with config vectors. These are associated with per-directory,
* per-server, and per-request configuration, and have a void* pointer for
}
#endif
-static void *create_empty_config(pool *p)
+static void *create_empty_config(ap_context_t *p)
{
void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) *
(total_modules + DYNAMIC_MODULE_LIMIT));
return (void *) conf_vector;
}
-static void *create_default_per_dir_config(pool *p)
+static void *create_default_per_dir_config(ap_context_t *p)
{
void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT));
module *modp;
}
void *
- ap_merge_per_dir_configs(pool *p, void *base, void *new)
+ ap_merge_per_dir_configs(ap_context_t *p, void *base, void *new)
{
void **conf_vector = (void **) ap_palloc(p, sizeof(void *) * total_modules);
void **base_vector = (void **) base;
return (void *) conf_vector;
}
-static void *create_server_config(pool *p, server_rec *s)
+static void *create_server_config(ap_context_t *p, server_rec *s)
{
void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT));
module *modp;
return (void *) conf_vector;
}
-static void merge_server_configs(pool *p, void *base, void *virt)
+static void merge_server_configs(ap_context_t *p, void *base, void *virt)
{
/* Can reuse the 'virt' vector for the spine of it, since we don't
* have to deal with the moral equivalent of .htaccess files here...
}
}
-void *ap_create_request_config(pool *p)
+void *ap_create_request_config(ap_context_t *p)
{
return create_empty_config(p);
}
-void *ap_create_conn_config(pool *p)
+void *ap_create_conn_config(ap_context_t *p)
{
return create_empty_config(p);
}
-CORE_EXPORT(void *) ap_create_per_dir_config(pool *p)
+CORE_EXPORT(void *) ap_create_per_dir_config(ap_context_t *p)
{
return create_empty_config(p);
}
static fast_handler_rec *handlers;
static fast_handler_rec *wildhandlers;
-static void init_handlers(pool *p)
+static void init_handlers(ap_context_t *p)
{
module *modp;
int nhandlers = 0;
*
* Notes: 1. ap_add_module() would already complain if no more space
* exists for adding a dynamically loaded module
- * 2. ap_add_module() accepts double-inclusion, so we have
+ * 2. ap_add_module() accepts double ap_context_t nclusion, so we have
* to accept this, too.
*/
for (m = ap_loaded_modules; *m != NULL; m++)
static cmd_parms default_parms =
{NULL, 0, -1, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
-API_EXPORT(const char *) ap_server_root_relative(pool *p, const char *file)
+API_EXPORT(const char *) ap_server_root_relative(ap_context_t *p, const char *file)
{
if(ap_os_is_path_absolute(file))
return file;
/* Structure to be passed to cfg_open_custom(): it contains an
* index which is incremented from 0 to nelts on each call to
* cfg_getline() (which in turn calls arr_elts_getstr())
- * and an array_header pointer for the string array.
+ * and an ap_array_header_t pointer for the string array.
*/
typedef struct {
- array_header *array;
+ ap_array_header_t *array;
int curr_idx;
} arr_elts_param_t;
return 0;
}
-static void process_command_config(server_rec *s, array_header *arr, pool *p,
- pool *ptemp)
+static void process_command_config(server_rec *s, ap_array_header_t *arr, ap_context_t *p,
+ ap_context_t *ptemp)
{
const char *errmsg;
cmd_parms parms;
ap_cfg_closefile(parms.config_file);
}
-void ap_process_resource_config(server_rec *s, const char *fname, pool *p, pool *ptemp)
+void ap_process_resource_config(server_rec *s, const char *fname, ap_context_t *p, ap_context_t *ptemp)
{
const char *errmsg;
cmd_parms parms;
}
-CORE_EXPORT(const char *) ap_init_virtual_host(pool *p, const char *hostname,
+CORE_EXPORT(const char *) ap_init_virtual_host(ap_context_t *p, const char *hostname,
server_rec *main_server, server_rec **ps)
{
server_rec *s = (server_rec *) ap_pcalloc(p, sizeof(server_rec));
}
-static void fixup_virtual_hosts(pool *p, server_rec *main_server)
+static void fixup_virtual_hosts(ap_context_t *p, server_rec *main_server)
{
server_rec *virt;
* Getting *everything* configured...
*/
-static void init_config_globals(pool *p)
+static void init_config_globals(ap_context_t *p)
{
/* Global virtual host hash bucket pointers. Init to null. */
ap_init_vhost_config(p);
}
-static server_rec *init_server_config(pool *p)
+static server_rec *init_server_config(ap_context_t *p)
{
server_rec *s = (server_rec *) ap_pcalloc(p, sizeof(server_rec));
}
-server_rec *ap_read_config(pool *p, pool *ptemp, const char *confname)
+server_rec *ap_read_config(ap_context_t *p, ap_context_t *ptemp, const char *confname)
{
server_rec *s = init_server_config(p);
return s;
}
-void ap_single_module_configure(pool *p, server_rec *s, module *m)
+void ap_single_module_configure(ap_context_t *p, server_rec *s, module *m)
{
if (m->create_server_config)
ap_set_module_config(s->module_config, m,
(*m->create_dir_config)(p, NULL));
}
-void ap_post_config_hook(pool *pconf, pool *plog, pool *ptemp, server_rec *s)
+void ap_post_config_hook(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec *s)
{
ap_run_post_config(pconf,plog,ptemp,s);
init_handlers(pconf);
}
-void ap_child_init_hook(pool *pchild, server_rec *s)
+void ap_child_init_hook(ap_context_t *pchild, server_rec *s)
{
/* TODO: uh this seems ugly, is there a better way? */
- ap_child_init_alloc();
+ /*ap_child_init_alloc(); PUT THIS BACK IN XXXXX */
ap_run_child_init(pchild,s);
}
{
int n;
- printf("Compiled-in modules:\n");
+ printf("Compiled ap_context_t n modules:\n");
for (n = 0; ap_loaded_modules[n]; ++n)
printf(" %s\n", ap_loaded_modules[n]->name);
}
IMPLEMENT_HOOK_VOID(pre_connection,(conn_rec *c),(c))
IMPLEMENT_HOOK_RUN_FIRST(int,process_connection,(conn_rec *c),(c),DECLINED)
-/* TODO: re-implement the lingering close stuff */
+/* TODO: re ap_context_t mplement the lingering close stuff */
#define NO_LINGCLOSE
/*
structure, but for now...
*/
-conn_rec *ap_new_connection(pool *p, server_rec *server, BUFF *inout,
+conn_rec *ap_new_connection(ap_context_t *p, server_rec *server, BUFF *inout,
const struct sockaddr_in *remaddr,
const struct sockaddr_in *saddr, long id)
{
#include <stdio.h>
-/* generate a table of 256 values, where certain characters are
+/* generate a ap_table_t of 256 values, where certain characters are
* marked "interesting"... for the uri parsing process.
*/
}
-static void close_listeners_on_exec(void *v)
+static ap_status_t close_listeners_on_exec(void *v)
{
ap_listen_rec *lr;
for (lr = ap_listeners; lr; lr = lr->next) {
close(lr->fd);
}
+ return APR_SUCCESS;
}
}
-int ap_listen_open(pool *pconf, unsigned port)
+int ap_listen_open(ap_context_t *pconf, unsigned port)
{
ap_listen_rec *lr;
ap_listen_rec *next;
#define CORE_PRIVATE
+#include "apr_lib.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
{NULL, -1},
};
-static int error_log_child(void *cmd, child_info *pinfo)
+static int error_log_child(void *cmd, ap_child_info_t *pinfo)
{
/* Child process code for 'ErrorLog "|..."';
* may want a common framework for this, since I expect it will
return(child_pid);
}
-static void open_error_log(server_rec *s, pool *p)
+static void open_error_log(server_rec *s, ap_context_t *p)
{
const char *fname;
}
}
-void ap_open_logs(server_rec *s_main, pool *p)
+void ap_open_logs(server_rec *s_main, ap_context_t *p)
{
server_rec *virt, *q;
int replace_stderr;
va_end(args);
}
-void ap_log_pid(pool *p, const char *fname)
+void ap_log_pid(ap_context_t *p, const char *fname)
{
FILE *pid_file;
struct stat finfo;
}
-API_EXPORT(piped_log *) ap_open_piped_log(pool *p, const char *program)
+API_EXPORT(piped_log *) ap_open_piped_log(ap_context_t *p, const char *program)
{
piped_log *pl;
}
#else
-static int piped_log_child(void *cmd, child_info *pinfo)
+static int piped_log_child(void *cmd, ap_child_info_t *pinfo)
{
/* Child process code for 'TransferLog "|..."';
* may want a common framework for this, since I expect it will
}
-API_EXPORT(piped_log *) ap_open_piped_log(pool *p, const char *program)
+API_EXPORT(piped_log *) ap_open_piped_log(ap_context_t *p, const char *program)
{
piped_log *pl;
FILE *dummy;
API_VAR_EXPORT const char *ap_server_root;
-array_header *ap_server_pre_read_config;
-array_header *ap_server_post_read_config;
-array_header *ap_server_config_defines;
+ap_array_header_t *ap_server_pre_read_config;
+ap_array_header_t *ap_server_post_read_config;
+ap_array_header_t *ap_server_config_defines;
static void show_compile_settings(void)
{
printf(" -D SHARED_CORE\n");
#endif
-/* This list displays the compiled-in default paths: */
+/* This list displays the compiled ap_context_t n default paths: */
#ifdef HTTPD_ROOT
printf(" -D HTTPD_ROOT=\"" HTTPD_ROOT "\"\n");
#endif
fprintf(stderr, " -v : show version number\n");
fprintf(stderr, " -V : show compile settings\n");
fprintf(stderr, " -h : list available command line options (this page)\n");
- fprintf(stderr, " -l : list compiled-in modules\n");
+ fprintf(stderr, " -l : list compiled ap_context_t n modules\n");
fprintf(stderr, " -L : list available configuration directives\n");
/* TODOC: -S has been replaced by '-t -D DUMP_VHOSTS' */
/* fprintf(stderr, " -S : show parsed settings (currently only vhost settings)\n"); */
exit(1);
}
-pool *g_pHookPool;
+ap_context_t *g_pHookPool;
extern char *optarg;
const char *confname = SERVER_CONFIG_FILE;
const char *def_server_root = HTTPD_ROOT;
server_rec *server_conf;
- pool *pglobal; /* Global pool */
- pool *pconf; /* Pool for config stuff */
- pool *plog; /* Pool for error-logging files */
- pool *ptemp; /* Pool for temporart config stuff */
- pool *pcommands; /* Pool for -C and -c switches */
+ ap_context_t *pglobal; /* Global pool */
+ ap_context_t *pconf; /* Pool for config stuff */
+ ap_context_t *plog; /* Pool for error-logging files */
+ ap_context_t *ptemp; /* Pool for temporart config stuff */
+ ap_context_t *pcommands; /* Pool for -C and -c switches */
/* TODO: PATHSEPARATOR should be one of the os defines */
#define PATHSEPARATOR '/'
ap_util_init();
ap_util_uri_init();
- pglobal = ap_init_alloc();
+ ap_create_context(NULL, NULL, &pglobal);
g_pHookPool=pglobal;
- pcommands = ap_make_sub_pool(pglobal);
+ ap_create_context(pglobal, NULL, &pcommands);
ap_server_pre_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *));
ap_server_config_defines = ap_make_array(pcommands, 1, sizeof(char *));
}
}
- pconf = ap_make_sub_pool(pglobal);
- plog = ap_make_sub_pool(pglobal);
- ptemp = ap_make_sub_pool(pconf);
+ ap_create_context(pglobal, NULL, &pconf);
+ ap_create_context(pglobal, NULL, &plog);
+ ap_create_context(pconf, NULL, &ptemp);
/* for legacy reasons, we read the configuration twice before
we actually serve any requests */
for (;;) {
ap_clear_pool(pconf);
- ptemp = ap_make_sub_pool(pconf);
+ ap_create_context(pconf, NULL, &ptemp);
ap_server_root = def_server_root;
ap_run_pre_config(pconf, plog, ptemp);
server_conf = ap_read_config(pconf, ptemp, confname);
static other_child_rec *other_children;
#endif
-static pool *pconf; /* Pool for config stuff */
-static pool *pchild; /* Pool for httpd child stuff */
-static pool *thread_pool_parent; /* Parent of per-thread pools */
+static ap_context_t *pconf; /* Pool for config stuff */
+static ap_context_t *pchild; /* Pool for httpd child stuff */
+static ap_context_t *thread_pool_parent; /* Parent of per-thread pools */
static pthread_mutex_t thread_pool_create_mutex;
static int child_num;
}
}
-static int setup_listeners(pool *p, server_rec *s)
+static int setup_listeners(ap_context_t *p, server_rec *s)
{
ap_listen_rec *lr;
int num_listeners = 0;
* Child process main loop.
*/
-static void process_socket(pool *p, struct sockaddr *sa_client, int csd,
+static void process_socket(ap_context_t *p, struct sockaddr *sa_client, int csd,
int conn_id)
{
struct sockaddr sa_server; /* ZZZZ */
{
struct sockaddr sa_client;
int csd = -1;
- pool *tpool; /* Pool for this thread */
- pool *ptrans; /* Pool for per-transaction stuff */
+ ap_context_t *tpool; /* Pool for this thread */
+ ap_context_t *ptrans; /* Pool for per-transaction stuff */
int sd = -1;
int srv;
int curr_pollfd, last_pollfd = 0;
}
}
-int ap_mpm_run(pool *_pconf, pool *plog, server_rec *s)
+int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
{
int remaining_children_to_start;
int i;
return 0;
}
-static void dexter_pre_config(pool *p, pool *plog, pool *ptemp)
+static void dexter_pre_config(ap_context_t *p, ap_context_t *plog, ap_context_t *ptemp)
{
static int restart_num = 0;
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- dexter_cmds, /* command table */
+ dexter_cmds, /* command ap_table_t */
NULL, /* handlers */
dexter_hooks /* register_hooks */
};
int pid;
int tid;
int sd;
- pool *tpool; /* "pthread" would be confusing */
+ ap_context_t *tpool; /* "pthread" would be confusing */
} proc_info;
#if 0
static other_child_rec *other_children;
#endif
-static pool *pconf; /* Pool for config stuff */
-static pool *pchild; /* Pool for httpd child stuff */
+static ap_context_t *pconf; /* Pool for config stuff */
+static ap_context_t *pchild; /* Pool for httpd child stuff */
static int my_pid; /* Linux getpid() doesn't work except in main thread. Use
this instead */
}
}
-static int setup_listeners(pool *pconf, server_rec *s)
+static int setup_listeners(ap_context_t *pconf, server_rec *s)
{
ap_listen_rec *lr;
int num_listeners = 0;
* Child process main loop.
*/
-static void process_socket(pool *p, struct sockaddr *sa_client, int csd, int my_child_num, int my_thread_num)
+static void process_socket(ap_context_t *p, struct sockaddr *sa_client, int csd, int my_child_num, int my_thread_num)
{
struct sockaddr sa_server; /* ZZZZ */
size_t len = sizeof(struct sockaddr);
proc_info * ti = dummy;
int process_slot = ti->pid;
int thread_slot = ti->tid;
- pool *tpool = ti->tpool;
+ ap_context_t *tpool = ti->tpool;
struct sockaddr sa_client;
int csd = -1;
- pool *ptrans; /* Pool for per-transaction stuff */
+ ap_context_t *ptrans; /* Pool for per-transaction stuff */
int sd = -1;
int srv;
int curr_pollfd, last_pollfd = 0;
free(ti);
- ptrans = ap_make_sub_pool(tpool);
+ ap_create_context(tpool, NULL, &ptrans);
pthread_mutex_lock(&worker_thread_count_mutex);
worker_thread_count++;
ap_listen_rec *lr;
my_pid = getpid();
- pchild = ap_make_sub_pool(pconf);
+ ap_create_context(pconf, NULL, &pchild);
/*stuff to do before we switch id's, so we have permissions.*/
reopen_scoreboard(pchild);
my_info->pid = my_child_num;
my_info->tid = i;
my_info->sd = 0;
- my_info->tpool = ap_make_sub_pool(pchild);
+ ap_create_context(pchild, NULL, &my_info->tpool);
/* We are creating threads right now */
(void) ap_update_child_status(my_child_num, i, SERVER_STARTING,
}
}
-int ap_mpm_run(pool *_pconf, pool *plog, server_rec *s)
+int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
{
int remaining_children_to_start;
return 0;
}
-static void mpmt_pthread_pre_config(pool *pconf, pool *plog, pool *ptemp)
+static void mpmt_pthread_pre_config(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp)
{
static int restart_num = 0;
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- mpmt_pthread_cmds, /* command table */
+ mpmt_pthread_cmds, /* command ap_table_t */
NULL, /* handlers */
mpmt_pthread_hooks /* register_hooks */
};
scoreboard *ap_scoreboard_image = NULL;
static char *ap_server_argv0=NULL;
-extern pool * pconf;
+extern ap_context_t * pconf;
/*****************************************************************
*
* shared memory (so they use memcpy etc.)
*/
-void reinit_scoreboard(pool *p)
+void reinit_scoreboard(ap_context_t *p)
{
ap_assert(!ap_scoreboard_image);
ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE);
return BaseAddress;
}
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-API_EXPORT(void) reopen_scoreboard(pool *p)
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
{
caddr_t m;
int rc;
shm_unlink(ap_scoreboard_fname);
}
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
char buf[512];
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-API_EXPORT(void) reopen_scoreboard(pool *p)
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
{
}
#elif defined(USE_MMAP_SCOREBOARD)
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-API_EXPORT(void) reopen_scoreboard(pool *p)
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
{
}
static key_t shmkey = IPC_PRIVATE;
static int shmid = -1;
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
struct shmid_ds shmbuf;
const server_rec * server_conf = ap_get_server_conf();
ap_scoreboard_image->global.running_generation = 0;
}
-API_EXPORT(void) reopen_scoreboard(pool *p)
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
{
}
unlink(ap_scoreboard_fname);
}
-API_EXPORT(void) reopen_scoreboard(pool *p)
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p)
{
if (scoreboard_fd != -1)
ap_pclosef(p, scoreboard_fd);
#endif
/* Called by parent process */
-void reinit_scoreboard(pool *p)
+void reinit_scoreboard(ap_context_t *p)
{
int running_gen = 0;
if (ap_scoreboard_image)
#endif
API_EXPORT(int) ap_exists_scoreboard_image(void);
-void reinit_scoareboard(pool *p);
+void reinit_scoareboard(ap_context_t *p);
void cleanup_scoreboard(void);
API_EXPORT(void) ap_sync_scoreboard_image(void);
#elif defined(USE_POSIX_SCOREBOARD)
static void cleanup_shared_mem(void *d);
#else
-void reinit_scoreboard(pool *p);
+void reinit_scoreboard(ap_context_t *p);
#endif
-API_EXPORT(void) reopen_scoreboard(pool *p);
+API_EXPORT(void) reopen_scoreboard(ap_context_t *p);
ap_inline void ap_sync_scoreboard_image(void);
void increment_counts(int child_num, int thread_num, request_rec *r);
static other_child_rec *other_children;
#endif
-static pool *pconf; /* Pool for config stuff */
-static pool *pchild; /* Pool for httpd child stuff */
+static ap_context_t *pconf; /* Pool for config stuff */
+static ap_context_t *pchild; /* Pool for httpd child stuff */
static int my_pid; /* it seems silly to call getpid all the time */
#ifndef MULTITHREAD
}
#if defined(USE_FCNTL_SERIALIZED_ACCEPT) || defined(USE_FLOCK_SERIALIZED_ACCEPT)
-static void expand_lock_fname(pool *p)
+static void expand_lock_fname(ap_context_t *p)
{
/* XXXX possibly bogus cast */
ap_lock_fname = ap_psprintf(p, "%s.%lu",
#define accept_mutex_child_init(x)
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
ptrdiff_t old;
usptr_t *us;
}
}
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init(ap_context_t *p)
{
ap_register_cleanup(p, NULL, accept_mutex_child_cleanup, ap_null_cleanup);
}
accept_mutex = (void *)(caddr_t)-1;
}
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
pthread_mutexattr_t mattr;
int fd;
#define accept_mutex_child_init(x)
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
union semun ick;
struct semid_ds buf;
}
ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
- /* pre-initialize these */
+ /* pre ap_context_t nitialize these */
op_on.sem_num = 0;
op_on.sem_op = -1;
op_on.sem_flg = SEM_UNDO;
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
lock_it.l_whence = SEEK_SET; /* from current point */
* Initialize mutex lock.
* Done by each child at it's birth
*/
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init(ap_context_t *p)
{
lock_fd = ap_popenf(p, ap_lock_fname, O_WRONLY, 0600);
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
expand_lock_fname(p);
unlink(ap_lock_fname);
* Initialize mutex lock.
* Done by each child at it's birth
*/
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init(ap_context_t *p)
{
int rc = DosOpenMutexSem(NULL, &lock_sem);
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
int rc = DosCreateMutexSem(NULL, &lock_sem, DC_SEM_SHARED, FALSE);
#define accept_mutex_init(x)
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init(ap_context_t *p)
{
ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup);
tpf_core_held = 0;
return BaseAddress;
}
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-static void reopen_scoreboard(pool *p)
+static void reopen_scoreboard(ap_context_t *p)
{
caddr_t m;
int rc;
shm_unlink(ap_scoreboard_fname);
}
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
char buf[512];
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-static void reopen_scoreboard(pool *p)
+static void reopen_scoreboard(ap_context_t *p)
{
}
#elif defined(USE_MMAP_SCOREBOARD)
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
caddr_t m;
ap_scoreboard_image->global.running_generation = 0;
}
-static void reopen_scoreboard(pool *p)
+static void reopen_scoreboard(ap_context_t *p)
{
}
static key_t shmkey = IPC_PRIVATE;
static int shmid = -1;
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
struct shmid_ds shmbuf;
#ifdef MOVEBREAK
ap_scoreboard_image->global.running_generation = 0;
}
-static void reopen_scoreboard(pool *p)
+static void reopen_scoreboard(ap_context_t *p)
{
}
}
}
-static void setup_shared_mem(pool *p)
+static void setup_shared_mem(ap_context_t *p)
{
cinfc(CINFC_WRITE, CINFC_CMMCTK2);
ap_scoreboard_image = (scoreboard *) gsysc(SCOREBOARD_FRAMES, SCOREBOARD_NAME);
ap_scoreboard_image->global.running_generation = 0;
}
-static void reopen_scoreboard(pool *p)
+static void reopen_scoreboard(ap_context_t *p)
{
cinfc(CINFC_WRITE, CINFC_CMMCTK2);
}
unlink(ap_scoreboard_fname);
}
-void reopen_scoreboard(pool *p)
+void reopen_scoreboard(ap_context_t *p)
{
if (scoreboard_fd != -1)
ap_pclosef(p, scoreboard_fd);
#endif
/* Called by parent process */
-static void reinit_scoreboard(pool *p)
+static void reinit_scoreboard(ap_context_t *p)
{
int running_gen = 0;
if (ap_scoreboard_image)
ap_listen_rec *lr;
ap_listen_rec *last_lr;
ap_listen_rec *first_lr;
- pool *ptrans;
+ ap_context_t *ptrans;
conn_rec *current_conn;
ap_iol *iol;
requests_this_child = 0;
last_lr = NULL;
- /* Get a sub pool for global allocations in this child, so that
+ /* Get a sub ap_context_t for global allocations in this child, so that
* we can have cleanups occur when the child exits.
*/
- pchild = ap_make_sub_pool(pconf);
+ ap_create_context(pconf, NULL, &pchild);
- ptrans = ap_make_sub_pool(pchild);
+ ap_create_context(pchild, NULL, &ptrans);
/* needs to be done before we switch UIDs so we have permissions */
reopen_scoreboard(pchild);
}
-static int setup_listeners(pool *p, server_rec *s)
+static int setup_listeners(ap_context_t *p, server_rec *s)
{
ap_listen_rec *lr;
* Executive routines.
*/
-int ap_mpm_run(pool *_pconf, pool *plog, server_rec *s)
+int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
{
int remaining_children_to_start;
return 0;
}
-static void prefork_pre_config(pool *p, pool *plog, pool *ptemp)
+static void prefork_pre_config(ap_context_t *p, ap_context_t *plog, ap_context_t *ptemp)
{
static int restart_num = 0;
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- prefork_cmds, /* command table */
+ prefork_cmds, /* command ap_table_t */
NULL, /* handlers */
prefork_hooks, /* register hooks */
};
static other_child_rec *other_children;
#endif
-static pool *pconf; /* Pool for config stuff */
+static ap_context_t *pconf; /* Pool for config stuff */
static scoreboard *ap_scoreboard_image = NULL;
struct thread_globals {
int child_num;
- pool *pchild; /* Pool for httpd child stuff */
+ ap_context_t *pchild; /* Pool for httpd child stuff */
int usr1_just_die;
};
#define THREAD_GLOBAL(gvar) ((*ppthread_globals)->gvar)
-void reinit_scoreboard(pool *p)
+void reinit_scoreboard(ap_context_t *p)
{
if (ap_scoreboard_image == NULL) {
ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE);
* Initialize mutex lock.
* Done by each child at it's birth
*/
-static void accept_mutex_child_init(pool *p)
+static void accept_mutex_child_init(ap_context_t *p)
{
int rc = DosOpenMutexSem(NULL, &lock_sem);
* Initialize mutex lock.
* Must be safe to call this on a restart.
*/
-static void accept_mutex_init(pool *p)
+static void accept_mutex_init(ap_context_t *p)
{
int rc = DosCreateMutexSem(NULL, &lock_sem, DC_SEM_SHARED, FALSE);
struct sockaddr sa_client;
ap_listen_rec *lr = NULL;
ap_listen_rec *first_lr = NULL;
- pool *ptrans;
+ ap_context_t *ptrans;
conn_rec *current_conn;
ap_iol *iol;
- pool *pchild;
+ ap_context_t *pchild;
parent_score *sc_parent_rec;
int csd = -1, requests_this_child = 0;
fd_set main_fds;
signal(SIGUSR1, just_die);
signal(SIGTERM, just_die);
- /* Get a sub pool for global allocations in this child, so that
+ /* Get a sub ap_context_t for global allocations in this child, so that
* we can have cleanups occur when the child exits.
*/
pchild = ap_make_sub_pool(pconf);
}
-static int setup_listeners(pool *pconf, server_rec *s)
+static int setup_listeners(ap_context_t *pconf, server_rec *s)
{
ap_listen_rec *lr;
* Executive routines.
*/
-int ap_mpm_run(pool *_pconf, pool *plog, server_rec *s)
+int ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s)
{
int remaining_children_to_start;
int i;
return 0;
}
-static void spmt_os2_pre_config(pool *pconf, pool *plog, pool *ptemp)
+static void spmt_os2_pre_config(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp)
{
one_process = !!getenv("ONE_PROCESS");
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- spmt_os2_cmds, /* command table */
+ spmt_os2_cmds, /* command ap_table_t */
NULL, /* handlers */
spmt_os2_hooks, /* register_hooks */
};
static int num_listenfds = 0;
int listenmaxfd = -1;
-static pool *pconf; /* Pool for config stuff */
+static ap_context_t *pconf; /* Pool for config stuff */
static char ap_coredump_dir[MAX_STRING_LEN];
}
return NULL;
}
-static int setup_listeners(pool *pconf, server_rec *s)
+static int setup_listeners(ap_context_t *pconf, server_rec *s)
{
ap_listen_rec *lr;
int num_listeners = 0;
return num_listeners;
}
-static int setup_inherited_listeners(pool *p, server_rec *s)
+static int setup_inherited_listeners(ap_context_t *p, server_rec *s)
{
WSAPROTOCOL_INFO WSAProtocolInfo;
HANDLE pipe;
while (1) {
BUFF *conn_io;
- pool *ptrans;
+ ap_context_t *ptrans;
int csd = -1;
conn_rec *current_conn;
int rv;
time_t end_time;
int i;
- pool *pchild;
+ ap_context_t *pchild;
pchild = ap_make_sub_pool(pconf);
(*processes)--;
}
-static int create_process(pool *p, HANDLE *handles, HANDLE *events, int *processes)
+static int create_process(ap_context_t *p, HANDLE *handles, HANDLE *events, int *processes)
{
int rv;
char buf[1024];
* We are making a big assumption here that the child process, once signaled,
* will REALLY go away. Since this is a restart, we do not want to hold the
* new child process up waiting for the old child to die. Remove the old
- * child out of the process_handles table and hope for the best...
+ * child out of the process_handles ap_table_t and hope for the best...
*/
for (i = 0; i < children_to_kill; i++) {
/* APD3("master_main: signalling child #%d handle %d to die", i, process_handles[i]); */
else {
/* A child process must have exited because of MaxRequestPerChild being hit
* or a fatal error condition (seg fault, etc.). Remove the dead process
- * from the process_handles and process_kill_events table and create a new
+ * from the process_handles and process_kill_events ap_table_t and create a new
* child process.
* TODO: Consider restarting the child immediately without looping through http_main
* and without rereading the configuration. Will need this if we ever support multiple
/*
* winnt_pre_config()
*/
-static void winnt_pre_config(pool *pconf, pool *plog, pool *ptemp)
+static void winnt_pre_config(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp)
{
char *pid;
one_process=1;//!!getenv("ONE_PROCESS");
}
-static void winnt_post_config(pool *pconf, pool *plog, pool *ptemp, server_rec* server_conf)
+static void winnt_post_config(ap_context_t *pconf, ap_context_t *plog, ap_context_t *ptemp, server_rec* server_conf)
{
server_conf = server_conf;
}
-API_EXPORT(int) ap_mpm_run(pool *_pconf, pool *plog, server_rec *s )
+API_EXPORT(int) ap_mpm_run(ap_context_t *_pconf, ap_context_t *plog, server_rec *s )
{
char* exit_event_name;
NULL, /* merge per-directory config structures */
NULL, /* create per-server config structure */
NULL, /* merge per-server config structures */
- winnt_cmds, /* command table */
+ winnt_cmds, /* command ap_table_t */
NULL, /* handlers */
winnt_hooks /* register_hooks */
};
OVERLAPPED Overlapped;
SOCKET accept_socket;
BUFF* conn_io;
- pool *ptrans;
+ ap_context_t *ptrans;
struct sockaddr sa_server;
int sa_server_len;
struct sockaddr sa_client;
/*
* Get the data for registry key value. This is a generic function that
* can either get a value into a caller-supplied buffer, or it can
- * allocate space for the value from the pass-in pool. It will normally
+ * allocate space for the value from the pass ap_context_t n pool. It will normally
* be used by other functions within this file to get specific key values
* (e.g. registry_get_server_root()). This function returns a number of
* different error statuses, allowing the caller to differentiate
*
* If ppValue is NULL, allocate space for the value and return it in
* *pValue. The return value is the number of bytes in the value.
- * The first argument is the pool to use to allocate space for the value.
+ * The first argument is the ap_context_t to use to allocate space for the value.
*
* If pValue is not NULL, assume it is a buffer of nSizeValue bytes,
* and write the value into the buffer. The return value is the number
* of bytes in the value (so if the return value is greater than
* the supplied nSizeValue, the caller knows that *pValue is truncated).
- * The pool argument is ignored.
+ * The ap_context_t argument is ignored.
*
* The return value is the number of bytes in the successfully retreived
* key if everything worked, or:
* message will be logged at priority "warning".
*/
-static int ap_registry_get_key_int(pool *p, char *key, char *name, char *pBuffer, int nSizeBuffer, char **ppValue)
+static int ap_registry_get_key_int(ap_context_t *p, char *key, char *name, char *pBuffer, int nSizeBuffer, char **ppValue)
{
long rv;
HKEY hKey;
* an error getting the key.
*/
-int ap_registry_get_server_root(pool *p, char *dir, int size)
+int ap_registry_get_server_root(ap_context_t *p, char *dir, int size)
{
int rv;
return(key);
}
-int ap_registry_get_service_conf(pool *p, char *dir, int size, char *service_name)
+int ap_registry_get_service_conf(ap_context_t *p, char *dir, int size, char *service_name)
{
int rv;
char *key = ap_get_service_key(service_name);
* Examine a field value (such as a media-/content-type) string and return
* it sans any parameters; e.g., strip off any ';charset=foo' and the like.
*/
-API_EXPORT(char *) ap_field_noparam(pool *p, const char *intype)
+API_EXPORT(char *) ap_field_noparam(ap_context_t *p, const char *intype)
{
const char *semi;
}
}
-API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt)
+API_EXPORT(char *) ap_ht_time(ap_context_t *p, time_t t, const char *fmt, int gmt)
{
/* ZZZ this function can be replaced by calls to time formatting routines
in APR. */
return ap_pstrdup(p, ts);
}
-API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t sec)
+API_EXPORT(char *) ap_gm_timestr_822(ap_context_t *p, time_t sec)
{
struct tm *tms;
char *date_str = ap_palloc(p, 48 * sizeof(char));
* AT&T V8 regexp package.
*/
-API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source,
+API_EXPORT(char *) ap_pregsub(ap_context_t *p, const char *input, const char *source,
size_t nmatch, regmatch_t pmatch[])
{
const char *src = input;
/*
* return the parent directory name including trailing / of the file s
*/
-API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s)
+API_EXPORT(char *) ap_make_dirstr_parent(ap_context_t *p, const char *s)
{
char *last_slash = strrchr(s, '/');
char *d;
* This function is deprecated. Use one of the preceeding two functions
* which are faster.
*/
-API_EXPORT(char *) ap_make_dirstr(pool *p, const char *s, int n)
+API_EXPORT(char *) ap_make_dirstr(ap_context_t *p, const char *s, int n)
{
register int x, f;
char *res;
* error... ah well. */
}
-API_EXPORT(char *) ap_getword_nc(pool *atrans, char **line, char stop)
+API_EXPORT(char *) ap_getword_nc(ap_context_t *atrans, char **line, char stop)
{
return ap_getword(atrans, (const char **) line, stop);
}
-API_EXPORT(char *) ap_getword(pool *atrans, const char **line, char stop)
+API_EXPORT(char *) ap_getword(ap_context_t *atrans, const char **line, char stop)
{
char *pos = strchr(*line, stop);
char *res;
return res;
}
-API_EXPORT(char *) ap_getword_white_nc(pool *atrans, char **line)
+API_EXPORT(char *) ap_getword_white_nc(ap_context_t *atrans, char **line)
{
return ap_getword_white(atrans, (const char **) line);
}
-API_EXPORT(char *) ap_getword_white(pool *atrans, const char **line)
+API_EXPORT(char *) ap_getword_white(ap_context_t *atrans, const char **line)
{
int pos = -1, x;
char *res;
return res;
}
-API_EXPORT(char *) ap_getword_nulls_nc(pool *atrans, char **line, char stop)
+API_EXPORT(char *) ap_getword_nulls_nc(ap_context_t *atrans, char **line, char stop)
{
return ap_getword_nulls(atrans, (const char **) line, stop);
}
-API_EXPORT(char *) ap_getword_nulls(pool *atrans, const char **line, char stop)
+API_EXPORT(char *) ap_getword_nulls(ap_context_t *atrans, const char **line, char stop)
{
char *pos = strchr(*line, stop);
char *res;
* all honored
*/
-static char *substring_conf(pool *p, const char *start, int len, char quote)
+static char *substring_conf(ap_context_t *p, const char *start, int len, char quote)
{
char *result = ap_palloc(p, len + 2);
char *resp = result;
return result;
}
-API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line)
+API_EXPORT(char *) ap_getword_conf_nc(ap_context_t *p, char **line)
{
return ap_getword_conf(p, (const char **) line);
}
-API_EXPORT(char *) ap_getword_conf(pool *p, const char **line)
+API_EXPORT(char *) ap_getword_conf(ap_context_t *p, const char **line)
{
const char *str = *line, *strend;
char *res;
return (cfp->close == NULL) ? 0 : cfp->close(cfp->param);
}
-/* Common structure that holds the file and pool for ap_pcfg_openfile */
+/* Common structure that holds the file and ap_context_t for ap_pcfg_openfile */
typedef struct {
- struct pool *pool;
+ ap_context_t *pool;
FILE *file;
} poolfile_t;
}
/* Open a configfile_t as FILE, return open configfile_t struct pointer */
-API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name)
+API_EXPORT(configfile_t *) ap_pcfg_openfile(ap_context_t *p, const char *name)
{
configfile_t *new_cfg;
poolfile_t *new_pfile;
/* Allocate a configfile_t handle with user defined functions and params */
-API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr,
+API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_context_t *p, const char *descr,
void *param,
int(*getch)(void *param),
void *(*getstr) (void *buf, size_t bufsiz, void *param),
* the converted list item (or NULL if none) and the address pointed to by
* field is shifted to the next non-comma, non-whitespace.
*/
-API_EXPORT(char *) ap_get_list_item(pool *p, const char **field)
+API_EXPORT(char *) ap_get_list_item(ap_context_t *p, const char **field)
{
const char *tok_start;
const unsigned char *ptr;
* This would be much more efficient if we stored header fields as
* an array of list items as they are received instead of a plain string.
*/
-API_EXPORT(int) ap_find_list_item(pool *p, const char *line, const char *tok)
+API_EXPORT(int) ap_find_list_item(ap_context_t *p, const char *line, const char *tok)
{
const unsigned char *pos;
const unsigned char *ptr = (const unsigned char *)line;
* by whitespace at the caller's option.
*/
-API_EXPORT(char *) ap_get_token(pool *p, const char **accept_line, int accept_white)
+API_EXPORT(char *) ap_get_token(ap_context_t *p, const char **accept_line, int accept_white)
{
const char *ptr = *accept_line;
const char *tok_start;
/* find http tokens, see the definition of token from RFC2068 */
-API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok)
+API_EXPORT(int) ap_find_token(ap_context_t *p, const char *line, const char *tok)
{
const unsigned char *start_token;
const unsigned char *s;
}
-API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok)
+API_EXPORT(int) ap_find_last_token(ap_context_t *p, const char *line, const char *tok)
{
int llen, tlen, lidx;
return (strncasecmp(&line[lidx], tok, tlen) == 0);
}
-API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *str)
+API_EXPORT(char *) ap_escape_shell_cmd(ap_context_t *p, const char *str)
{
char *cmd;
unsigned char *d;
return OK;
}
-API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname,
+API_EXPORT(char *) ap_construct_server(ap_context_t *p, const char *hostname,
unsigned port, const request_rec *r)
{
if (ap_is_default_port(port, r))
* something with a '/' in it (and thus does not prefix "./").
*/
-API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *segment)
+API_EXPORT(char *) ap_escape_path_segment(ap_context_t *p, const char *segment)
{
char *copy = ap_palloc(p, 3 * strlen(segment) + 1);
const unsigned char *s = (const unsigned char *)segment;
return copy;
}
-API_EXPORT(char *) ap_os_escape_path(pool *p, const char *path, int partial)
+API_EXPORT(char *) ap_os_escape_path(ap_context_t *p, const char *path, int partial)
{
char *copy = ap_palloc(p, 3 * strlen(path) + 3);
const unsigned char *s = (const unsigned char *)path;
/* ap_escape_uri is now a macro for os_escape_path */
-API_EXPORT(char *) ap_escape_html(pool *p, const char *s)
+API_EXPORT(char *) ap_escape_html(ap_context_t *p, const char *s)
{
int i, j;
char *x;
return (S_ISDIR(finfo.st_mode));
}
-API_EXPORT(char *) ap_make_full_path(pool *a, const char *src1,
+API_EXPORT(char *) ap_make_full_path(ap_context_t *a, const char *src1,
const char *src2)
{
register int x;
}
-static char *find_fqdn(pool *a, struct hostent *p)
+static char *find_fqdn(ap_context_t *a, struct hostent *p)
{
int x;
return ap_pstrdup(a, (void *) p->h_name);
}
-char *ap_get_local_host(pool *a)
+char *ap_get_local_host(ap_context_t *a)
{
#ifndef MAXHOSTNAMELEN
#define MAXHOSTNAMELEN 256
/* simple 'pool' alloc()ing glue to ap_base64.c
*/
-API_EXPORT(char *) ap_pbase64decode(pool *p, const char *bufcoded)
+API_EXPORT(char *) ap_pbase64decode(ap_context_t *p, const char *bufcoded)
{
char *decoded;
int l;
return decoded;
}
-API_EXPORT(char *) ap_pbase64encode(pool *p, char *string)
+API_EXPORT(char *) ap_pbase64encode(ap_context_t *p, char *string)
{
char *encoded;
int l = strlen(string);
/* deprecated names for the above two functions, here for compatibility
*/
-API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded)
+API_EXPORT(char *) ap_uudecode(ap_context_t *p, const char *bufcoded)
{
return ap_pbase64decode(p, bufcoded);
}
-API_EXPORT(char *) ap_uuencode(pool *p, char *string)
+API_EXPORT(char *) ap_uuencode(ap_context_t *p, char *string)
{
return ap_pbase64encode(p, string);
}
/* quotes in the string are doubled up.
* Used to escape quotes in args passed to OS/2's cmd.exe
*/
-char *ap_double_quotes(pool *p, char *str)
+char *ap_double_quotes(ap_context_t *p, char *str)
{
int num_quotes = 0;
int len = 0;
/*
* Given a string, replace any bare " with \" .
*/
-API_EXPORT(char *) ap_escape_quotes (pool *p, const char *instring)
+API_EXPORT(char *) ap_escape_quotes (ap_context_t *p, const char *instring)
{
int newlen = 0;
const char *inchr = instring;
/*
* util_date.c: date parsing utility routines
- * These routines are (hopefully) platform-independent.
+ * These routines are (hopefully) platform ap_context_t ndependent.
*
* 27 Oct 1996 Roy Fielding
* Extracted (with many modifications) from mod_proxy.c and
#include "httpd.h"
#include "util_md5.h"
-API_EXPORT(char *) ap_md5_binary(pool *p, const unsigned char *buf, int length)
+API_EXPORT(char *) ap_md5_binary(ap_context_t *p, const unsigned char *buf, int length)
{
const char *hex = "0123456789abcdef";
AP_MD5_CTX my_md5;
return ap_pstrdup(p, result);
}
-API_EXPORT(char *) ap_md5(pool *p, const unsigned char *string)
+API_EXPORT(char *) ap_md5(ap_context_t *p, const unsigned char *string)
{
return ap_md5_binary(p, string, (int) strlen((char *)string));
}
static char basis_64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-API_EXPORT(char *) ap_md5contextTo64(pool *a, AP_MD5_CTX * context)
+API_EXPORT(char *) ap_md5contextTo64(ap_context_t *a, AP_MD5_CTX * context)
{
unsigned char digest[18];
char *encodedDigest;
#ifdef CHARSET_EBCDIC
-API_EXPORT(char *) ap_md5digest(pool *p, APRFile infile, int convert)
+API_EXPORT(char *) ap_md5digest(ap_context_t *p, APRFile infile, int convert)
{
AP_MD5_CTX context;
unsigned char buf[1000];
#else
-API_EXPORT(char *) ap_md5digest(pool *p, APRFile infile)
+API_EXPORT(char *) ap_md5digest(ap_context_t *p, APRFile infile)
{
AP_MD5_CTX context;
unsigned char buf[1000];
* are handled in create_argv.
*
*/
-static char **create_argv(pool *p, char *path, char *user, char *group,
+static char **create_argv(ap_context_t *p, char *path, char *user, char *group,
char *av0, const char *args)
{
int x, numwords;
}
-static char *http2env(pool *a, char *w)
+static char *http2env(ap_context_t *a, char *w)
{
char *res = ap_pstrcat(a, "HTTP_", w, NULL);
char *cp = res;
return res;
}
-API_EXPORT(char **) ap_create_environment(pool *p, table *t)
+API_EXPORT(char **) ap_create_environment(ap_context_t *p, ap_table_t *t)
{
- array_header *env_arr = ap_table_elts(t);
- table_entry *elts = (table_entry *) env_arr->elts;
+ ap_array_header_t *env_arr = ap_table_elts(t);
+ ap_table_entry_t *elts = (ap_table_entry_t *) env_arr->elts;
char **env = (char **) ap_palloc(p, (env_arr->nelts + 2) * sizeof(char *));
int i, j;
char *tz;
API_EXPORT(void) ap_add_common_vars(request_rec *r)
{
- table *e;
+ ap_table_t *e;
server_rec *s = r->server;
conn_rec *c = r->connection;
const char *rem_logname;
char *env_temp;
#endif
const char *host;
- array_header *hdrs_arr = ap_table_elts(r->headers_in);
- table_entry *hdrs = (table_entry *) hdrs_arr->elts;
+ ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in);
+ ap_table_entry_t *hdrs = (ap_table_entry_t *) hdrs_arr->elts;
int i;
- /* use a temporary table which we'll overlap onto
+ /* use a temporary ap_table_t which we'll overlap onto
* r->subprocess_env later
*/
e = ap_make_table(r->pool, 25 + hdrs_arr->nelts);
}
/* Obtain the Request-URI from the original request-line, returning
- * a new string from the request pool containing the URI or "".
+ * a new string from the request ap_context_t containing the URI or "".
*/
static char *original_uri(request_rec *r)
{
API_EXPORT(void) ap_add_cgi_vars(request_rec *r)
{
- table *e = r->subprocess_env;
+ ap_table_t *e = r->subprocess_env;
ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1");
ap_table_setn(e, "SERVER_PROTOCOL", r->protocol);
char *w, *l;
int p;
int cgi_status = HTTP_OK;
- table *merge;
- table *cookie_table;
+ ap_table_t *merge;
+ ap_table_t *cookie_table;
if (buffer) {
*buffer = '\0';
}
#if defined(OS2) || defined(WIN32)
-static char **create_argv_cmd(pool *p, char *av0, const char *args, char *path)
+static char **create_argv_cmd(ap_context_t *p, char *av0, const char *args, char *path)
{
register int x, n;
char **av;
/* ZZZ need to look at this in more depth and convert to an AP func so we
can get rid of OS specific code.
*/
-API_EXPORT(int) ap_call_exec(request_rec *r, child_info *pinfo, char *argv0,
+API_EXPORT(int) ap_call_exec(request_rec *r, ap_child_info_t *pinfo, char *argv0,
char **env, int shellcmd)
{
int pid = 0;
}
#else
- /* TODO: re-implement suexec */
+ /* TODO: re ap_context_t mplement suexec */
#if 0
if (ap_suexec_enabled
&& ((r->server->server_uid != ap_user_id)
* from a call to gethostbyname() and lives in static storage.
* By creating a copy we can tuck it away for later use.
*/
-API_EXPORT(struct hostent *) ap_pduphostent(pool *p, const struct hostent *hp)
+API_EXPORT(struct hostent *) ap_pduphostent(ap_context_t *p, const struct hostent *hp)
{
struct hostent *newent;
char **ptrs;
* COPY OF the hostent structure, intended to be stored and used later.
* (gethostbyname() uses static storage that would be overwritten on each call)
*/
-API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname)
+API_EXPORT(struct hostent *) ap_pgethostbyname(ap_context_t *p, const char *hostname)
{
struct hostent *hp = gethostbyname(hostname);
return (hp == NULL) ? NULL : ap_pduphostent(p, hp);
/* Unparse a uri_components structure to an URI string.
* Optionally suppress the password for security reasons.
*/
-API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr, unsigned flags)
+API_EXPORT(char *) ap_unparse_uri_components(ap_context_t *p, const uri_components *uptr, unsigned flags)
{
char *ret = "";
* - fills in fields of uri_components *uptr
* - none on any of the r->* fields
*/
-API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr)
+API_EXPORT(int) ap_parse_uri_components(ap_context_t *p, const char *uri, uri_components *uptr)
{
int ret;
regmatch_t match[10]; /* This must have at least as much elements
* that fast memchr()s use. But that would be way non-portable. -djg
*/
-/* We have a table that we can index by character and it tells us if the
+/* We have a ap_table_t that we can index by character and it tells us if the
* character is one of the interesting delimiters. Note that we even get
* compares for NUL for free -- it's just another delimiter.
*/
* - fills in fields of uri_components *uptr
* - none on any of the r->* fields
*/
-API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr)
+API_EXPORT(int) ap_parse_uri_components(ap_context_t *p, const char *uri, uri_components *uptr)
{
const char *s;
const char *s1;
* currently at http://www.mcom.com/newsref/std/tunneling_ssl.html
* for the format of the "CONNECT host:port HTTP/1.0" request
*/
-API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr)
+API_EXPORT(int) ap_parse_hostinfo_components(ap_context_t *p, const char *hostinfo, uri_components *uptr)
{
const char *s;
char *endstr;
* sharing this address */
};
-/* This defines the size of the hash table used for hashing ip addresses
+/* This defines the size of the hash ap_table_t used for hashing ip addresses
* of virtual hosts. It must be a power of two.
*/
#ifndef IPHASH_TABLE_SIZE
/* called at the beginning of the config */
-void ap_init_vhost_config(pool *p)
+void ap_init_vhost_config(ap_context_t *p)
{
memset(iphash_table, 0, sizeof(iphash_table));
default_list = NULL;
* *paddr is the variable used to keep track of **paddr between calls
* port is the default port to assume
*/
-static const char *get_addresses(pool *p, char *w, server_addr_rec ***paddr,
+static const char *get_addresses(ap_context_t *p, char *w, server_addr_rec ***paddr,
unsigned port)
{
/* ZZZ redesign to use AP funcs and types. Will see what I can do to make it
/* parse the <VirtualHost> addresses */
-const char *ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s)
+const char *ap_parse_vhost_addrs(ap_context_t *p, const char *hostname, server_rec *s)
{
server_addr_rec **addrs;
const char *err;
}
-/* hash table statistics, keep this in here for the beta period so
+/* hash ap_table_t statistics, keep this in here for the beta period so
* we can find out if the hash function is ok
*/
#ifdef IPHASH_STATISTICS
-static ipaddr_chain *new_ipaddr_chain(pool *p,
+static ipaddr_chain *new_ipaddr_chain(ap_context_t *p,
server_rec *s, server_addr_rec *sar)
{
ipaddr_chain *new;
}
-static name_chain *new_name_chain(pool *p, server_rec *s, server_addr_rec *sar)
+static name_chain *new_name_chain(ap_context_t *p, server_rec *s, server_addr_rec *sar)
{
name_chain *new;
ipaddr_chain *trav;
unsigned addr;
- /* scan the hash table for an exact match first */
+ /* scan the hash ap_table_t for an exact match first */
addr = server_ip->s_addr;
bucket = hash_inaddr(addr);
for (trav = iphash_table[bucket]; trav; trav = trav->next) {
}
/* compile the tables and such we need to do the run-time vhost lookups */
-void ap_fini_vhost_config(pool *p, server_rec *main_s)
+void ap_fini_vhost_config(ap_context_t *p, server_rec *main_s)
{
/* ZZZ need to redesign for use with AP funcs. will look into this later.
*/
iphash_table_tail[i] = &iphash_table[i];
}
- /* The first things to go into the hash table are the NameVirtualHosts
+ /* The first things to go into the hash ap_table_t are the NameVirtualHosts
* Since name_vhost_list is in the same order that the directives
* occured in the config file, we'll copy it in that order.
*/
*/
}
- /* The next things to go into the hash table are the virtual hosts
+ /* The next things to go into the hash ap_table_t are the virtual hosts
* themselves. They're listed off of main_s->next in the reverse
* order they occured in the config file, so we insert them at
* the iphash_table_tail but don't advance the tail.
static int matches_aliases(server_rec *s, const char *host)
{
int i;
- array_header *names;
+ ap_array_header_t *names;
/* match ServerName */
if (!strcasecmp(host, s->server_hostname)) {
ipaddr_chain *trav;
unsigned port = ntohs(conn->local_addr.sin_port);
- /* scan the hash table for an exact match first */
+ /* scan the hash ap_table_t for an exact match first */
trav = find_ipaddr(&conn->local_addr.sin_addr, port);
if (trav) {
/* save the name_chain for later in case this is a name-vhost */
3. All characters encoded must have Unicode scalar values <= 0xFFFF,
(ie characters that would be encoded by surrogates in UTF-16
are not allowed). Note that this restriction doesn't apply to
-the built-in support for UTF-8 and UTF-16.
+the built ap_context_t n support for UTF-8 and UTF-16.
4. No Unicode character may be encoded by more than one distinct sequence
of bytes. */
** - Enhanced by Dean Gaudet <dgaudet@apache.org>, November 1997
** - Cleaned up by Ralf S. Engelschall <rse@apache.org>, March 1998
** - POST and verbosity by Kurt Sussman <kls@merlot.com>, August 1998
- ** - HTML table output added by David N. Welton <davidw@prosa.it>, January 1999
+ ** - HTML ap_table_t output added by David N. Welton <davidw@prosa.it>, January 1999
** - Added Cookie, Arbitrary header and auth support. <dirkx@webweaving.org>, April 199
**
*/
fprintf(stderr, " -T content-type Content-type header for POSTing\n");
fprintf(stderr, " -v verbosity How much troubleshooting info to print\n");
fprintf(stderr, " -w Print out results in HTML tables\n");
- fprintf(stderr, " -x attributes String to insert as table attributes\n");
+ fprintf(stderr, " -x attributes String to insert as ap_table_t attributes\n");
fprintf(stderr, " -y attributes String to insert as tr attributes\n");
fprintf(stderr, " -z attributes String to insert as td or th attributes\n");
fprintf(stderr, " -C attribute Add cookie, eg. 'Apache=1234. (repeatable)\n");
int c, r,l;
char tmp[1024];
- /* table defaults */
+ /* ap_table_t defaults */
tablestring = "";
trstring = "";
tdstring = "bgcolor=white";
#define MAXDNAME 256
#endif
-/* number of buckets in cache hash table */
+/* number of buckets in cache hash ap_table_t */
#define BUCKETS 256
#if defined(NEED_STRDUP)
#include <stdio.h>
#include <stdlib.h>
#include "httpd.h"
-#include "alloc.h"
+#include "apr_general.h"
/*
* Dummy a bunch of stuff just to get a compile
int main (void)
{
- ap_pool *p;
+ ap_context_t *p;
char line[512];
char tok[512];
#include <stdio.h>
#include <stdlib.h>
#include "httpd.h"
-#include "alloc.h"
+#include "apr_general.h"
/*
* Dummy a bunch of stuff just to get a compile
int main (void)
{
- ap_pool *p;
+ ap_context_t *p;
const char *field;
char *newstr;
char instr[512];
unsigned long *shared_counter;
if (argc != 3) {
- fprintf (stderr, "Usage: time-sem num-child num-iter\n");
+ fprintf (stderr, "Usage: time-sem num-child num ap_context_t ter\n");
exit (1);
}