diff --git a/include/ap_listen.h b/include/ap_listen.h index 4f77721ec3..3cae0bd1b3 100644 --- a/include/ap_listen.h +++ b/include/ap_listen.h @@ -77,7 +77,7 @@ struct ap_listen_rec { /** * The actual socket */ - ap_socket_t *sd; + apr_socket_t *sd; /** * Is this socket currently active */ diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 8ef55c4c70..8b9dbc988e 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -104,7 +104,7 @@ * short_score split into parent and child pieces * os_is_absolute_path * 19971026 (1.3b3-dev) - custom config hooks in place - * 19980126 (1.3b4-dev) - ap_cpystrn(), table_addn(), table_setn(), + * 19980126 (1.3b4-dev) - apr_cpystrn(), table_addn(), table_setn(), * table_mergen() * 19980201 (1.3b4-dev) - construct_url() * prototype server_rec * -> request_rec * @@ -132,7 +132,7 @@ * 19980324 (1.3b6-dev) - API_EXPORT(index_of_response) * 19980413 (1.3b6-dev) - The BIG SYMBOL RENAMING: general ap_ prefix * (see src/include/compat.h for more details) - * ap_vformatter() API, see src/include/ap.h + * apr_vformatter() API, see src/include/ap.h * 19980507 (1.3b7-dev) - addition of ap_add_version_component() and * discontinuation of -DSERVER_SUBVERSION support * 19980519 (1.3b7-dev) - add child_info * to spawn function (as passed to @@ -168,7 +168,7 @@ * added limit_req_body to core_dir_config and * ap_get_limit_req_body() to get its value. * 19980812 (1.3.2-dev) - split off MODULE_MAGIC_NUMBER - * 19980812.2 - add ap_overlap_tables() + * 19980812.2 - add apr_overlap_tables() * 19980816 (1.3.2-dev) - change proxy to use tables for headers, change * struct cache_req to typedef cache_req. * Delete ap_proxy_get_header(), ap_proxy_add_header(), @@ -195,7 +195,7 @@ * and added vlist_validator to request_rec. * 19990101 - renamed macro escape_uri() to ap_escape_uri() * - added MODULE_MAGIC_COOKIE to identify module structs - * 19990103 (1.3.4-dev) - added ap_array_pstrcat() + * 19990103 (1.3.4-dev) - added apr_array_pstrcat() * 19990105 (1.3.4-dev) - added ap_os_is_filename_valid() * 19990106 (1.3.4-dev) - Move MODULE_MAGIC_COOKIE to the end of the * STANDARD_MODULE_STUFF macro so the version @@ -205,8 +205,8 @@ * - reordered entries in request_rec that were waiting * for a non-binary-compatible release. * (1.3.5-dev) - * 19990108.1 - add ap_MD5Encode() for MD5 password handling. - * 19990108.2 - add ap_validate_password() and change ap_MD5Encode() + * 19990108.1 - add apr_MD5Encode() for MD5 password handling. + * 19990108.2 - add apr_validate_password() and change apr_MD5Encode() * to use a stronger algorithm. * 19990108.4 - add ap_size_list_item(), ap_get_list_item(), and * ap_find_list_item() @@ -242,13 +242,13 @@ * specified value. *
* Useful for testing for features. - * For example, suppose you wish to use the ap_overlap_tables + * For example, suppose you wish to use the apr_overlap_tables * function. You can do this: * * #if MODULE_MAGIC_AT_LEAST(19980812,2) - * ... use ap_overlap_tables() + * ... use apr_overlap_tables() * #else - * ... alternative code which doesn't use ap_overlap_tables() + * ... alternative code which doesn't use apr_overlap_tables() * #endif ** @param major The major module magic number diff --git a/include/ap_mpm.h b/include/ap_mpm.h index d4ac786e32..95a9d908de 100644 --- a/include/ap_mpm.h +++ b/include/ap_mpm.h @@ -89,7 +89,7 @@ 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 ap_pool_t will be invoked at + User cleanups registered in the pchild apr_pool_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 @@ -113,9 +113,9 @@ * @param plog the log pool, reset after the config file is read * @param server_conf the global server config. * @return 1 for shutdown 0 otherwise. - * @deffunc int ap_mpm_run(ap_pool_t *pconf, ap_pool_t *plog, server_rec *server_conf) + * @deffunc int ap_mpm_run(apr_pool_t *pconf, apr_pool_t *plog, server_rec *server_conf) */ -API_EXPORT(int) ap_mpm_run(ap_pool_t *pconf, ap_pool_t *plog, server_rec *server_conf); +API_EXPORT(int) ap_mpm_run(apr_pool_t *pconf, apr_pool_t *plog, server_rec *server_conf); /** * predicate indicating if a graceful stop has been requested ... diff --git a/include/http_config.h b/include/http_config.h index b7a3930c7d..41be895732 100644 --- a/include/http_config.h +++ b/include/http_config.h @@ -294,10 +294,10 @@ struct cmd_parms_struct ap_directive_t *directive; /** Pool to allocate new storage in */ - ap_pool_t *pool; + apr_pool_t *pool; /** Pool for scratch memory; persists during configuration, but * wiped before the first request is served... */ - ap_pool_t *temp_pool; + apr_pool_t *temp_pool; /** Server_rec being configured for */ server_rec *server; /** If configuring for a directory, pathname of that directory. @@ -371,35 +371,35 @@ struct module_struct { * @param p The pool to use for all allocations. * @param dir The directory currently being processed. * @return The per-directory structure created - * @deffunc void *create_dir_config(ap_pool_t *p, char *dir) + * @deffunc void *create_dir_config(apr_pool_t *p, char *dir) */ - void *(*create_dir_config) (ap_pool_t *p, char *dir); + void *(*create_dir_config) (apr_pool_t *p, char *dir); /** Function to allow all modules to merge the per directory configuration * structures for two directories. * @param p The pool to use for all allocations. * @param base_conf The directory structure created for the parent directory. * @param new_conf The directory structure currently being processed. * @return The new per-directory structure created - * @deffunc void *merge_dir_config(ap_pool_t *p, void *base_conf, void *new_conf) + * @deffunc void *merge_dir_config(apr_pool_t *p, void *base_conf, void *new_conf) */ - void *(*merge_dir_config) (ap_pool_t *p, void *base_conf, void *new_conf); + void *(*merge_dir_config) (apr_pool_t *p, void *base_conf, void *new_conf); /** Function to allow all modules to create per server configuration * structures. * @param p The pool to use for all allocations. * @param s The server currently being processed. * @return The per-server structure created - * @deffunc void *create_server_config(ap_pool_t *p, server_rec *dir) + * @deffunc void *create_server_config(apr_pool_t *p, server_rec *dir) */ - void *(*create_server_config) (ap_pool_t *p, server_rec *s); + void *(*create_server_config) (apr_pool_t *p, server_rec *s); /** Function to allow all modules to merge the per server configuration * structures for two servers. * @param p The pool to use for all allocations. * @param base_conf The directory structure created for the parent directory. * @param new_conf The directory structure currently being processed. * @return The new per-directory structure created - * @deffunc void *merge_dir_config(ap_pool_t *p, void *base_conf, void *new_conf) + * @deffunc void *merge_dir_config(apr_pool_t *p, void *base_conf, void *new_conf) */ - void *(*merge_server_config) (ap_pool_t *p, void *base_conf, void *new_conf); + void *(*merge_server_config) (apr_pool_t *p, void *base_conf, void *new_conf); /** A command_rec table that describes all of the directives this module * defines. */ @@ -518,9 +518,9 @@ API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, const char * it relativizes it wrt server_root. * @param p pool to allocate data out of * @param fname The file name - * @deffunc const char *ap_server_root_relative(ap_pool_t *p, const char *fname) + * @deffunc const char *ap_server_root_relative(apr_pool_t *p, const char *fname) */ -API_EXPORT(const char *) ap_server_root_relative(ap_pool_t *p, const char *fname); +API_EXPORT(const char *) ap_server_root_relative(apr_pool_t *p, const char *fname); /* Finally, the hook for dynamically loading modules in... */ @@ -581,13 +581,13 @@ API_EXPORT(const char *) ap_find_module_name(module *m); API_EXPORT(module *) ap_find_linked_module(const char *name); /** - * Open a configfile_t as ap_file_t + * Open a configfile_t as apr_file_t * @param ret_cfg open configfile_t struct pointer * @param p The pool to allocate the structure out of * @param name the name of the file to open - * @deffunc ap_status_t ap_pcfg_openfile(configfile_t **ret_cfg, ap_pool_t *p, const char *name) + * @deffunc apr_status_t ap_pcfg_openfile(configfile_t **ret_cfg, apr_pool_t *p, const char *name) */ -API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **, ap_pool_t *p, const char *name); +API_EXPORT(apr_status_t) ap_pcfg_openfile(configfile_t **, apr_pool_t *p, const char *name); /** * Allocate a configfile_t handle with user defined functions and params @@ -597,9 +597,9 @@ API_EXPORT(ap_status_t) ap_pcfg_openfile(configfile_t **, ap_pool_t *p, const ch * @param getc_func The getch function * @param gets_func The getstr function * @param close_func The close function - * @deffunc configfile_t *ap_pcfg_open_custom(ap_pool_t *p, const char *descr, void *param, int(*getc_func)(void*), void *(*gets_func) (void *buf, size_t bufsiz, void *param), int(*close_func)(void *param)) + * @deffunc configfile_t *ap_pcfg_open_custom(apr_pool_t *p, const char *descr, void *param, int(*getc_func)(void*), void *(*gets_func) (void *buf, size_t bufsiz, void *param), int(*close_func)(void *param)) */ -API_EXPORT(configfile_t *) ap_pcfg_open_custom(ap_pool_t *p, const char *descr, +API_EXPORT(configfile_t *) ap_pcfg_open_custom(apr_pool_t *p, const char *descr, void *param, int(*getc_func)(void*), void *(*gets_func) (void *buf, size_t bufsiz, void *param), @@ -651,9 +651,9 @@ API_EXPORT(const char *) ap_soak_end_container(cmd_parms *cmd, char *directive); * @param curr_parent The current parent node * @param orig_directive The directive to read until hit. * @return Error string on failure, NULL on success - * @deffunc char *ap_build_cont_config(ap_pool_t *p, ap_pool_t *temp_pool, cmd_parms *parms, ap_directive_t **current, ap_directive_t **curr_parent, char *orig_directive) + * @deffunc char *ap_build_cont_config(apr_pool_t *p, apr_pool_t *temp_pool, cmd_parms *parms, ap_directive_t **current, ap_directive_t **curr_parent, char *orig_directive) */ -const char * ap_build_cont_config(ap_pool_t *p, ap_pool_t *temp_pool, +const char * ap_build_cont_config(apr_pool_t *p, apr_pool_t *temp_pool, cmd_parms *parms, ap_directive_t **current, ap_directive_t **curr_parent, @@ -666,11 +666,11 @@ const char * ap_build_cont_config(ap_pool_t *p, ap_pool_t *temp_pool, * @param temp_pool The temporary pool * @param conftree Place to store the root node of the config tree * @return Error string on erro, NULL otherwise - * @deffunc const char *ap_build_config(cmd_parms *parms, ap_pool_t *conf_pool, ap_pool_t *temp_pool, ap_directive_t **conftree) + * @deffunc const char *ap_build_config(cmd_parms *parms, apr_pool_t *conf_pool, apr_pool_t *temp_pool, ap_directive_t **conftree) */ API_EXPORT(const char *) ap_build_config(cmd_parms *parms, - ap_pool_t *conf_pool, - ap_pool_t *temp_pool, + apr_pool_t *conf_pool, + apr_pool_t *temp_pool, ap_directive_t **conftree); /** @@ -742,7 +742,7 @@ extern API_VAR_EXPORT module **ap_loaded_modules; * @param s The server to configure for. * @param m The module to configure */ -void ap_single_module_configure(ap_pool_t *p, server_rec *s, module *m); +void ap_single_module_configure(apr_pool_t *p, server_rec *s, module *m); /* For http_main.c... */ /** @@ -773,9 +773,9 @@ API_EXPORT(void) ap_show_modules(void); * @param config_name The name of the config file * @param conftree Place to store the root of the config tree * @return The setup server_rec list. - * @deffunc server_rec *ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree) + * @deffunc server_rec *ap_read_config(process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree) */ -API_EXPORT(server_rec*) ap_read_config(process_rec *process, ap_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree); +API_EXPORT(server_rec*) ap_read_config(process_rec *process, apr_pool_t *temp_pool, const char *config_name, ap_directive_t **conftree); /** * Run all post config hooks for loaded modules. @@ -783,9 +783,9 @@ API_EXPORT(server_rec*) ap_read_config(process_rec *process, ap_pool_t *temp_poo * @param plog The logging pool * @param ptemp The temporary pool * @param s The list of server_rec structures - * @deffunc void ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s) + * @deffunc void ap_post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) */ -API_EXPORT(void) ap_post_config_hook(ap_pool_t *pconf, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *s); +API_EXPORT(void) ap_post_config_hook(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s); /** * Run all rewrite args hooks for loaded modules @@ -805,9 +805,9 @@ API_EXPORT(void) ap_register_hooks(module *m); * Setup all virtual hosts * @param p The pool to allocate out of * @param main_server The head of the server_rec list - * @deffunc void ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server) + * @deffunc void ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server) */ -API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server); +API_EXPORT(void) ap_fixup_virtual_hosts(apr_pool_t *p, server_rec *main_server); /* For http_request.c... */ @@ -816,15 +816,15 @@ API_EXPORT(void) ap_fixup_virtual_hosts(ap_pool_t *p, server_rec *main_server); * @param p The pool to allocate the config vector out of * @return The config vector */ -void *ap_create_request_config(ap_pool_t *p); +void *ap_create_request_config(apr_pool_t *p); /** * Setup the config vector for per dir module configs * @param p The pool to allocate the config vector out of * @return The config vector - * @deffunc void *ap_create_per_dir_config(ap_pool_t *p) + * @deffunc void *ap_create_per_dir_config(apr_pool_t *p) */ -CORE_EXPORT(void *) ap_create_per_dir_config(ap_pool_t *p); +CORE_EXPORT(void *) ap_create_per_dir_config(apr_pool_t *p); /** * Run all of the modules merge per dir config functions @@ -832,7 +832,7 @@ CORE_EXPORT(void *) ap_create_per_dir_config(ap_pool_t *p); * @param base The base directory config structure * @param new The new directory config structure */ -void *ap_merge_per_dir_configs(ap_pool_t *p, void *base, void *new); +void *ap_merge_per_dir_configs(apr_pool_t *p, void *base, void *new); /* For http_connection.c... */ /** @@ -840,7 +840,7 @@ void *ap_merge_per_dir_configs(ap_pool_t *p, void *base, void *new); * @param p The pool to allocate the config vector out of * @return The config vector */ -void *ap_create_conn_config(ap_pool_t *p); +void *ap_create_conn_config(apr_pool_t *p); /* For http_core.c... (
\n", r); - while (!ap_eof(f)) { + while (!apr_eof(f)) { do { n = sizeof(char) * IOBUFSIZE; - stat = ap_read(f, buf, &n); + stat = apr_read(f, buf, &n); } while (stat != APR_SUCCESS && stat == EINTR); if (n == -1 || n == 0) { @@ -963,7 +963,7 @@ static void do_emit_plain(request_rec *r, ap_file_t *f) static void emit_head(request_rec *r, char *header_fname, int suppress_amble, char *title) { - ap_file_t *f = NULL; + apr_file_t *f = NULL; request_rec *rr = NULL; int emit_amble = 1; int emit_H1 = 1; @@ -1011,12 +1011,12 @@ static void emit_head(request_rec *r, char *header_fname, int suppress_amble, * the file's contents, any HTML header it had won't end up * where it belongs. */ - if (ap_open(&f, rr->filename, APR_READ, + if (apr_open(&f, rr->filename, APR_READ, APR_OS_DEFAULT, r->pool) == APR_SUCCESS) { emit_preamble(r, title); emit_amble = 0; do_emit_plain(r, f); - ap_close(f); + apr_close(f); emit_H1 = 0; } } @@ -1046,7 +1046,7 @@ static void emit_head(request_rec *r, char *header_fname, int suppress_amble, */ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble) { - ap_file_t *f = NULL; + apr_file_t *f = NULL; request_rec *rr = NULL; int suppress_post = 0; int suppress_sig = 0; @@ -1079,10 +1079,10 @@ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble) /* * If we can open the file, suppress the signature. */ - if (ap_open(&f, rr->filename, APR_READ, + if (apr_open(&f, rr->filename, APR_READ, APR_OS_DEFAULT, r->pool) == APR_SUCCESS) { do_emit_plain(r, f); - ap_close(f); + apr_close(f); suppress_sig = 1; } } @@ -1104,9 +1104,9 @@ static void emit_tail(request_rec *r, char *readme_fname, int suppress_amble) static char *find_title(request_rec *r) { char titlebuf[MAX_STRING_LEN], *find = ""; - ap_file_t *thefile = NULL; + apr_file_t *thefile = NULL; int x, y, p; - ap_ssize_t n; + apr_ssize_t n; if (r->status != HTTP_OK) { return NULL; @@ -1116,14 +1116,14 @@ static char *find_title(request_rec *r) "text/html") || !strcmp(r->content_type, INCLUDES_MAGIC_TYPE)) && !r->content_encoding) { - if (ap_open(&thefile, r->filename, APR_READ, + if (apr_open(&thefile, r->filename, APR_READ, APR_OS_DEFAULT, r->pool) != APR_SUCCESS) { return NULL; } n = sizeof(char) * (MAX_STRING_LEN - 1); - ap_read(thefile, titlebuf, &n); + apr_read(thefile, titlebuf, &n); if (n <= 0) { - ap_close(thefile); + apr_close(thefile); return NULL; } titlebuf[n] = '\0'; @@ -1144,15 +1144,15 @@ static char *find_title(request_rec *r) } } } - ap_close(thefile); - return ap_pstrdup(r->pool, &titlebuf[x]); + apr_close(thefile); + return apr_pstrdup(r->pool, &titlebuf[x]); } } else { p = 0; } } - ap_close(thefile); + apr_close(thefile); } return NULL; } @@ -1172,8 +1172,8 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts, return (NULL); } - p = (struct ent *) ap_pcalloc(r->pool, sizeof(struct ent)); - p->name = ap_pstrdup(r->pool, name); + p = (struct ent *) apr_pcalloc(r->pool, sizeof(struct ent)); + p->name = apr_pstrdup(r->pool, name); p->size = -1; p->icon = NULL; p->alt = NULL; @@ -1196,7 +1196,7 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts, p->alt = "DIR"; } p->size = -1; - p->name = ap_pstrcat(r->pool, name, "/", NULL); + p->name = apr_pstrcat(r->pool, name, "/", NULL); } else { p->icon = find_icon(d, rr, 0); @@ -1208,7 +1208,7 @@ static struct ent *make_autoindex_entry(char *name, int autoindex_opts, p->desc = find_desc(d, rr); if ((!p->desc) && (autoindex_opts & SCAN_HTML_TITLES)) { - p->desc = ap_pstrdup(r->pool, find_title(rr)); + p->desc = apr_pstrdup(r->pool, find_title(rr)); } ap_destroy_sub_req(rr); @@ -1299,16 +1299,16 @@ static void output_directories(struct ent **ar, int n, int autoindex_opts, char keyid, char direction) { int x; - ap_size_t rv; + apr_size_t rv; char *name = r->uri; char *tp; int static_columns = (autoindex_opts & SUPPRESS_COLSORT); - ap_pool_t *scratch; + apr_pool_t *scratch; int name_width; char *name_scratch; char *pad_scratch; - ap_create_pool(&scratch, r->pool); + apr_create_pool(&scratch, r->pool); if (name[0] == '\0') { name = "/"; } @@ -1322,8 +1322,8 @@ static void output_directories(struct ent **ar, int n, } } } - name_scratch = ap_palloc(r->pool, name_width + 1); - pad_scratch = ap_palloc(r->pool, name_width + 1); + name_scratch = apr_palloc(r->pool, name_width + 1); + pad_scratch = apr_palloc(r->pool, name_width + 1); memset(pad_scratch, ' ', name_width); pad_scratch[name_width] = '\0'; @@ -1372,7 +1372,7 @@ static void output_directories(struct ent **ar, int n, char *anchor, *t, *t2; int nwidth; - ap_clear_pool(scratch); + apr_clear_pool(scratch); if (is_parent(ar[x]->name)) { t = ap_make_full_path(scratch, name, "../"); @@ -1431,8 +1431,8 @@ static void output_directories(struct ent **ar, int n, if (ar[x]->lm != -1) { char time_str[MAX_STRING_LEN]; ap_exploded_time_t ts; - ap_explode_localtime(&ts, ar[x]->lm); - ap_strftime(time_str, &rv, MAX_STRING_LEN, + apr_explode_localtime(&ts, ar[x]->lm); + apr_strftime(time_str, &rv, MAX_STRING_LEN, "%d-%b-%Y %H:%M ", &ts); ap_rputs(time_str, r); } @@ -1519,7 +1519,7 @@ static int dsortf(struct ent **e1, struct ent **e2) break; case K_DESC: if (c1->version_sort) - result = ap_strnatcmp(c1->desc ? c1->desc : "", c2->desc ? c2->desc : ""); + result = apr_strnatcmp(c1->desc ? c1->desc : "", c2->desc ? c2->desc : ""); else result = strcmp(c1->desc ? c1->desc : "", c2->desc ? c2->desc : ""); if (result) { @@ -1528,7 +1528,7 @@ static int dsortf(struct ent **e1, struct ent **e2) break; } if (c1->version_sort) - return ap_strnatcmp(c1->name, c2->name); + return apr_strnatcmp(c1->name, c2->name); else return strcmp(c1->name, c2->name); } @@ -1541,8 +1541,8 @@ static int index_directory(request_rec *r, char *title_endp; char *name = r->filename; - ap_dir_t *d; - ap_status_t status; + apr_dir_t *d; + apr_status_t status; int num_ent = 0, x; struct ent *head, *p; struct ent **ar = NULL; @@ -1551,7 +1551,7 @@ static int index_directory(request_rec *r, char keyid; char direction; - if ((status = ap_opendir(&d, name, r->pool)) != APR_SUCCESS) { + if ((status = apr_opendir(&d, name, r->pool)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, "Can't open directory for index: %s", r->filename); return HTTP_FORBIDDEN; @@ -1562,7 +1562,7 @@ static int index_directory(request_rec *r, ap_send_http_header(r); if (r->header_only) { - ap_closedir(d); + apr_closedir(d); return 0; } @@ -1614,9 +1614,9 @@ static int index_directory(request_rec *r, * linked list and then arrayificate them so qsort can use them. */ head = NULL; - while (ap_readdir(d) == APR_SUCCESS) { + while (apr_readdir(d) == APR_SUCCESS) { char *d_name; - ap_get_dir_filename(&d_name, d); + apr_get_dir_filename(&d_name, d); p = make_autoindex_entry(d_name, autoindex_opts, autoindex_conf, r, keyid, direction); if (p != NULL) { @@ -1626,7 +1626,7 @@ static int index_directory(request_rec *r, } } if (num_ent > 0) { - ar = (struct ent **) ap_palloc(r->pool, + ar = (struct ent **) apr_palloc(r->pool, num_ent * sizeof(struct ent *)); p = head; x = 0; @@ -1640,7 +1640,7 @@ static int index_directory(request_rec *r, } output_directories(ar, num_ent, autoindex_conf, r, autoindex_opts, keyid, direction); - ap_closedir(d); + apr_closedir(d); if (autoindex_opts & FANCY_INDEXING) { ap_rputs("
\n", r); @@ -1675,7 +1675,7 @@ static int handle_autoindex(request_rec *r) */ if (r->filename[strlen(r->filename) - 1] != '/') { - r->filename = ap_pstrcat(r->pool, r->filename, "/", NULL); + r->filename = apr_pstrcat(r->pool, r->filename, "/", NULL); } return index_directory(r, d); } @@ -1700,7 +1700,7 @@ module MODULE_VAR_EXPORT autoindex_module = merge_autoindex_configs, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server config */ - autoindex_cmds, /* command ap_table_t */ + autoindex_cmds, /* command apr_table_t */ autoindex_handlers, /* handlers */ NULL /* register hooks */ }; diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index 3bde51f3d9..a79d2c384d 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -99,7 +99,7 @@ module MODULE_VAR_EXPORT cgi_module; static int is_scriptaliased(request_rec *r) { - const char *t = ap_table_get(r->notes, "alias-forced-type"); + const char *t = apr_table_get(r->notes, "alias-forced-type"); return t && (!strcasecmp(t, "cgi-script")); } @@ -114,10 +114,10 @@ typedef struct { int bufbytes; } cgi_server_conf; -static void *create_cgi_config(ap_pool_t *p, server_rec *s) +static void *create_cgi_config(apr_pool_t *p, server_rec *s) { cgi_server_conf *c = - (cgi_server_conf *) ap_pcalloc(p, sizeof(cgi_server_conf)); + (cgi_server_conf *) apr_pcalloc(p, sizeof(cgi_server_conf)); c->logname = NULL; c->logbytes = DEFAULT_LOGBYTES; @@ -126,7 +126,7 @@ static void *create_cgi_config(ap_pool_t *p, server_rec *s) return c; } -static void *merge_cgi_config(ap_pool_t *p, void *basev, void *overridesv) +static void *merge_cgi_config(apr_pool_t *p, void *basev, void *overridesv) { cgi_server_conf *base = (cgi_server_conf *) basev, *overrides = (cgi_server_conf *) overridesv; @@ -179,31 +179,31 @@ AP_INIT_TAKE1("ScriptLogBuffer", set_scriptlog_buffer, NULL, RSRC_CONF, static int log_scripterror(request_rec *r, cgi_server_conf * conf, int ret, int show_errno, char *error) { - ap_file_t *f = NULL; - ap_finfo_t finfo; + apr_file_t *f = NULL; + apr_finfo_t finfo; char time_str[AP_CTIME_LEN]; ap_log_rerror(APLOG_MARK, show_errno|APLOG_ERR, errno, r, "%s: %s", error, r->filename); if (!conf->logname || - ((ap_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS) + ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS) && (finfo.size > conf->logbytes)) || - (ap_open(&f, ap_server_root_relative(r->pool, conf->logname), + (apr_open(&f, ap_server_root_relative(r->pool, conf->logname), APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) { return ret; } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgi-bin/printenv HTTP/1.0" */ - ap_ctime(time_str, ap_now()); - ap_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, + apr_ctime(time_str, apr_now()); + apr_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgi-bin */ - ap_fprintf(f, "%%%% %d %s\n", ret, r->filename); + apr_fprintf(f, "%%%% %d %s\n", ret, r->filename); - ap_fprintf(f, "%%error\n%s\n", error); + apr_fprintf(f, "%%error\n%s\n", error); - ap_close(f); + apr_close(f); return ret; } @@ -227,18 +227,18 @@ static void log_script_err(request_rec *r, BUFF *script_err) static int log_script(request_rec *r, cgi_server_conf * conf, int ret, char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err) { - ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in); - ap_table_entry_t *hdrs = (ap_table_entry_t *) hdrs_arr->elts; + apr_array_header_t *hdrs_arr = ap_table_elts(r->headers_in); + apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts; char argsbuffer[HUGE_STRING_LEN]; - ap_file_t *f = NULL; + apr_file_t *f = NULL; int i; - ap_finfo_t finfo; + apr_finfo_t finfo; char time_str[AP_CTIME_LEN]; if (!conf->logname || - ((ap_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS) + ((apr_stat(&finfo, ap_server_root_relative(r->pool, conf->logname), r->pool) == APR_SUCCESS) && (finfo.size > conf->logbytes)) || - (ap_open(&f, ap_server_root_relative(r->pool, conf->logname), + (apr_open(&f, ap_server_root_relative(r->pool, conf->logname), APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) { /* Soak up script output */ while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) @@ -249,66 +249,66 @@ static int log_script(request_rec *r, cgi_server_conf * conf, int ret, } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgi-bin/printenv HTTP/1.0" */ - ap_ctime(time_str, ap_now()); - ap_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, + apr_ctime(time_str, apr_now()); + apr_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgi-bin" */ - ap_fprintf(f, "%%%% %d %s\n", ret, r->filename); + apr_fprintf(f, "%%%% %d %s\n", ret, r->filename); - ap_puts("%request\n", f); + apr_puts("%request\n", f); for (i = 0; i < hdrs_arr->nelts; ++i) { if (!hdrs[i].key) continue; - ap_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); + apr_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); } if ((r->method_number == M_POST || r->method_number == M_PUT) && *dbuf) { - ap_fprintf(f, "\n%s\n", dbuf); + apr_fprintf(f, "\n%s\n", dbuf); } - ap_puts("%response\n", f); + apr_puts("%response\n", f); hdrs_arr = ap_table_elts(r->err_headers_out); - hdrs = (ap_table_entry_t *) hdrs_arr->elts; + hdrs = (apr_table_entry_t *) hdrs_arr->elts; for (i = 0; i < hdrs_arr->nelts; ++i) { if (!hdrs[i].key) continue; - ap_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); + apr_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); } if (sbuf && *sbuf) - ap_fprintf(f, "%s\n", sbuf); + apr_fprintf(f, "%s\n", sbuf); if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { - ap_puts("%stdout\n", f); - ap_puts(argsbuffer, f); + apr_puts("%stdout\n", f); + apr_puts(argsbuffer, f); while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) - ap_puts(argsbuffer, f); - ap_puts("\n", f); + apr_puts(argsbuffer, f); + apr_puts("\n", f); } if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { - ap_puts("%stderr\n", f); - ap_puts(argsbuffer, f); + apr_puts("%stderr\n", f); + apr_puts(argsbuffer, f); while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) - ap_puts(argsbuffer, f); - ap_puts("\n", f); + apr_puts(argsbuffer, f); + apr_puts("\n", f); } ap_bclose(script_in); ap_bclose(script_err); - ap_close(f); + apr_close(f); return ret; } -static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **script_err, - char *command, char *const argv[], request_rec *r, ap_pool_t *p) +static apr_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **script_err, + char *command, char *const argv[], request_rec *r, apr_pool_t *p) { char **env; - ap_procattr_t *procattr; - ap_proc_t *procnew = ap_pcalloc(p, sizeof(*procnew)); - ap_status_t rc = APR_SUCCESS; - ap_file_t *file = NULL; + apr_procattr_t *procattr; + apr_proc_t *procnew = apr_pcalloc(p, sizeof(*procnew)); + apr_status_t rc = APR_SUCCESS; + apr_file_t *file = NULL; ap_iol *iol; #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \ defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS) @@ -345,29 +345,29 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr /* Transumute ourselves into the script. * NB only ISINDEX scripts get decoded arguments. */ - if (((rc = ap_createprocattr_init(&procattr, p)) != APR_SUCCESS) || - ((rc = ap_setprocattr_io(procattr, + if (((rc = apr_createprocattr_init(&procattr, p)) != APR_SUCCESS) || + ((rc = apr_setprocattr_io(procattr, APR_CHILD_BLOCK, APR_CHILD_BLOCK, APR_CHILD_BLOCK)) != APR_SUCCESS) || - ((rc = ap_setprocattr_dir(procattr, + ((rc = apr_setprocattr_dir(procattr, ap_make_dirstr_parent(r->pool, r->filename))) != APR_SUCCESS) || #ifdef RLIMIT_CPU - ((rc = ap_setprocattr_limit(procattr, APR_LIMIT_CPU, conf->limit_cpu)) != APR_SUCCESS) || + ((rc = apr_setprocattr_limit(procattr, APR_LIMIT_CPU, conf->limit_cpu)) != APR_SUCCESS) || #endif #if defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined(RLIMIT_AS) - ((rc = ap_setprocattr_limit(procattr, APR_LIMIT_MEM, conf->limit_mem)) != APR_SUCCESS) || + ((rc = apr_setprocattr_limit(procattr, APR_LIMIT_MEM, conf->limit_mem)) != APR_SUCCESS) || #endif #ifdef RLIMIT_NPROC - ((rc = ap_setprocattr_limit(procattr, APR_LIMIT_NPROC, conf->limit_nproc)) != APR_SUCCESS) || + ((rc = apr_setprocattr_limit(procattr, APR_LIMIT_NPROC, conf->limit_nproc)) != APR_SUCCESS) || #endif - ((rc = ap_setprocattr_cmdtype(procattr, APR_PROGRAM)) != APR_SUCCESS)) { + ((rc = apr_setprocattr_cmdtype(procattr, APR_PROGRAM)) != APR_SUCCESS)) { /* Something bad happened, tell the world. */ ap_log_rerror(APLOG_MARK, APLOG_ERR, rc, r, "couldn't set child process attributes: %s", r->filename); } else { - rc = ap_create_process(procnew, command, argv, env, procattr, p); + rc = apr_create_process(procnew, command, argv, env, procattr, p); if (rc != APR_SUCCESS) { /* Bad things happened. Everyone should have cleaned up. */ @@ -375,7 +375,7 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr "couldn't create child process: %d: %s", rc, r->filename); } else { - ap_note_subprocess(p, procnew, kill_after_timeout); + apr_note_subprocess(p, procnew, kill_after_timeout); /* Fill in BUFF structure for parents pipe to child's stdout */ file = procnew->out; @@ -407,7 +407,7 @@ static ap_status_t run_cgi_child(BUFF **script_out, BUFF **script_in, BUFF **scr } return (rc); } -static ap_status_t build_argv_list(char ***argv, request_rec *r, ap_pool_t *p) +static apr_status_t build_argv_list(char ***argv, request_rec *r, apr_pool_t *p) { int numwords, x, idx; char *w; @@ -430,7 +430,7 @@ static ap_status_t build_argv_list(char ***argv, request_rec *r, ap_pool_t *p) if (numwords > APACHE_ARG_MAX - 1) { numwords = APACHE_ARG_MAX - 1; /* Truncate args to prevent overrun */ } - *argv = (char **) ap_palloc(p, (numwords + 2) * sizeof(char *)); + *argv = (char **) apr_palloc(p, (numwords + 2) * sizeof(char *)); for (x = 1, idx = 1; x < numwords; x++) { w = ap_getword_nulls(p, &args, '+'); @@ -442,7 +442,7 @@ static ap_status_t build_argv_list(char ***argv, request_rec *r, ap_pool_t *p) return APR_SUCCESS; } -static ap_status_t build_command_line(char **cmd, request_rec *r, ap_pool_t *p) +static apr_status_t build_command_line(char **cmd, request_rec *r, apr_pool_t *p) { #ifdef WIN32 char *quoted_filename = NULL; @@ -462,24 +462,24 @@ static ap_status_t build_command_line(char **cmd, request_rec *r, ap_pool_t *p) } /* - * Build the command string to pass to ap_create_process() + * Build the command string to pass to apr_create_process() */ - quoted_filename = ap_pstrcat(p, "\"", r->filename, "\"", NULL); + quoted_filename = apr_pstrcat(p, "\"", r->filename, "\"", NULL); if (interpreter && *interpreter) { if (arguments && *arguments) - *cmd = ap_pstrcat(p, interpreter, " ", quoted_filename, " ", + *cmd = apr_pstrcat(p, interpreter, " ", quoted_filename, " ", arguments, NULL); else - *cmd = ap_pstrcat(p, interpreter, " ", quoted_filename, " ", NULL); + *cmd = apr_pstrcat(p, interpreter, " ", quoted_filename, " ", NULL); } else if (arguments && *arguments) { - *cmd = ap_pstrcat(p, quoted_filename, " ", arguments, NULL); + *cmd = apr_pstrcat(p, quoted_filename, " ", arguments, NULL); } else { - *cmd = ap_pstrcat(p, quoted_filename, NULL); + *cmd = apr_pstrcat(p, quoted_filename, NULL); } #else - *cmd = ap_pstrcat(p, r->filename, NULL); + *cmd = apr_pstrcat(p, r->filename, NULL); #endif return APR_SUCCESS; } @@ -495,7 +495,7 @@ static int cgi_handler(request_rec *r) char argsbuffer[HUGE_STRING_LEN]; int is_included = !strcmp(r->protocol, "INCLUDED"); void *sconf = r->server->module_config; - ap_pool_t *p; + apr_pool_t *p; cgi_server_conf *conf = (cgi_server_conf *) ap_get_module_config(sconf, &cgi_module); @@ -525,11 +525,11 @@ static int cgi_handler(request_rec *r) #if defined(OS2) || defined(WIN32) /* Allow for cgi files without the .EXE extension on them under OS/2 */ if (r->finfo.protection == 0) { - ap_finfo_t finfo; + apr_finfo_t finfo; char *newfile; - newfile = ap_pstrcat(r->pool, r->filename, ".EXE", NULL); - if ((ap_stat(&finfo, newfile, r->pool) != APR_SUCCESS) || + newfile = apr_pstrcat(r->pool, r->filename, ".EXE", NULL); + if ((apr_stat(&finfo, newfile, r->pool) != APR_SUCCESS) || (finfo.filetype != APR_REG)) { return log_scripterror(r, conf, HTTP_NOT_FOUND, 0, "script not found or unable to stat"); @@ -571,7 +571,7 @@ static int cgi_handler(request_rec *r) "couldn't spawn child process: %s", r->filename); return HTTP_INTERNAL_SERVER_ERROR; } - argv[0] = ap_pstrdup(p, command); + argv[0] = apr_pstrdup(p, command); /* run the script in its own process */ if (run_cgi_child(&script_out, &script_in, &script_err, command, argv, r, p) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, @@ -584,10 +584,10 @@ static int cgi_handler(request_rec *r) */ if (ap_should_client_block(r)) { int dbsize, len_read; - ap_ssize_t bytes_written; + apr_ssize_t bytes_written; if (conf->logname) { - dbuf = ap_pcalloc(r->pool, conf->bufbytes + 1); + dbuf = apr_pcalloc(r->pool, conf->bufbytes + 1); dbpos = 0; } @@ -627,7 +627,7 @@ static int cgi_handler(request_rec *r) return log_script(r, conf, ret, dbuf, sbuf, script_in, script_err); } - location = ap_table_get(r->headers_out, "Location"); + location = apr_table_get(r->headers_out, "Location"); if (location && location[0] == '/' && r->status == 200) { @@ -639,14 +639,14 @@ static int cgi_handler(request_rec *r) /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = ap_pstrdup(r->pool, "GET"); + r->method = apr_pstrdup(r->pool, "GET"); r->method_number = M_GET; /* We already read the message body (if any), so don't allow * the redirected request to think it has one. We can ignore * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR. */ - ap_table_unset(r->headers_in, "Content-Length"); + apr_table_unset(r->headers_in, "Content-Length"); ap_internal_redirect_handler(location, r); return OK; @@ -689,7 +689,7 @@ module MODULE_VAR_EXPORT cgi_module = NULL, /* dir merger --- default is to override */ create_cgi_config, /* server config */ merge_cgi_config, /* merge server config */ - cgi_cmds, /* command ap_table_t */ + cgi_cmds, /* command apr_table_t */ cgi_handlers, /* handlers */ NULL /* register hooks */ }; diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index e8b1bc537f..9e9e591e91 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -106,10 +106,10 @@ module MODULE_VAR_EXPORT cgid_module; -static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *main_server); +static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server); static int once_through = 0; -static ap_pool_t *pcgi; +static apr_pool_t *pcgi; /* KLUDGE --- for back-combatibility, we don't have to check Execcgid * in ScriptAliased directories, which means we need to know if this @@ -119,7 +119,7 @@ static ap_pool_t *pcgi; static int is_scriptaliased(request_rec *r) { - const char *t = ap_table_get(r->notes, "alias-forced-type"); + const char *t = apr_table_get(r->notes, "alias-forced-type"); return t && (!strcasecmp(t, "cgi-script")); } @@ -165,7 +165,7 @@ typedef struct { * are handled in create_argv. * */ -static char **create_argv(ap_pool_t *p, char *path, char *user, char *group, +static char **create_argv(apr_pool_t *p, char *path, char *user, char *group, char *av0, const char *args) { int x, numwords; @@ -184,7 +184,7 @@ static char **create_argv(ap_pool_t *p, char *path, char *user, char *group, if (numwords > APACHE_ARG_MAX - 5) { numwords = APACHE_ARG_MAX - 5; /* Truncate args to prevent overrun */ } - av = (char **) ap_palloc(p, (numwords + 5) * sizeof(char *)); + av = (char **) apr_palloc(p, (numwords + 5) * sizeof(char *)); if (path) { av[idx++] = path; @@ -215,7 +215,7 @@ static int call_exec(request_rec *r, char *argv0, char **env, int shellcmd) * put the error messages from the log_* functions. So, we use stderr, * since that is better than allowing errors to go unnoticed. */ - ap_put_os_file(&r->server->error_log, &errfileno, r->pool); + apr_put_os_file(&r->server->error_log, &errfileno, r->pool); /* TODO: reimplement suexec */ #if 0 if (ap_suexec_enabled @@ -229,7 +229,7 @@ static int call_exec(request_rec *r, char *argv0, char **env, int shellcmd) if (!strncmp("/~", r->uri, 2)) { gid_t user_gid; - char *username = ap_pstrdup(r->pool, r->uri + 2); + char *username = apr_pstrdup(r->pool, r->uri + 2); char *pos = strchr(username, '/'); if (pos) { @@ -241,15 +241,15 @@ static int call_exec(request_rec *r, char *argv0, char **env, int shellcmd) "getpwnam: invalid username %s", username); return (pid); } - execuser = ap_pstrcat(r->pool, "~", pw->pw_name, NULL); + execuser = apr_pstrcat(r->pool, "~", pw->pw_name, NULL); user_gid = pw->pw_gid; if ((gr = getgrgid(user_gid)) == NULL) { - if ((grpname = ap_palloc(r->pool, 16)) == NULL) { + if ((grpname = apr_palloc(r->pool, 16)) == NULL) { return (pid); } else { - ap_snprintf(grpname, 16, "%ld", (long) user_gid); + apr_snprintf(grpname, 16, "%ld", (long) user_gid); } } else { @@ -263,7 +263,7 @@ static int call_exec(request_rec *r, char *argv0, char **env, int shellcmd) (long) r->server->server_uid); return (pid); } - execuser = ap_pstrdup(r->pool, pw->pw_name); + execuser = apr_pstrdup(r->pool, pw->pw_name); if ((gr = getgrgid(r->server->server_gid)) == NULL) { ap_log_rerror(APLOG_MARK, APLOG_ERR, r, @@ -321,12 +321,12 @@ static void cgid_maint(int reason, void *data, ap_wait_t status) case APR_OC_REASON_LOST: /* stop gap to make sure everything else works. In the end, * we'll just restart the cgid server. */ - ap_destroy_pool(pcgi); + apr_destroy_pool(pcgi); kill(getppid(), SIGWINCH); break; case APR_OC_REASON_RESTART: case APR_OC_REASON_UNREGISTER: - ap_destroy_pool(pcgi); + apr_destroy_pool(pcgi); kill(*sd, SIGHUP); break; } @@ -341,11 +341,11 @@ static void get_req(int fd, request_rec *r, char **filename, char **argv0, char core_dir_config *temp_core; void **dconf; - r->server = ap_pcalloc(r->pool, sizeof(server_rec)); + r->server = apr_pcalloc(r->pool, sizeof(server_rec)); read(fd, &j, sizeof(int)); read(fd, &len, sizeof(int)); - data = ap_pcalloc(r->pool, len + 1); /* get a cleared byte for final '\0' */ + data = apr_pcalloc(r->pool, len + 1); /* get a cleared byte for final '\0' */ i = read(fd, data, len); r->filename = ap_getword(r->pool, (const char **)&data, '\n'); @@ -353,7 +353,7 @@ static void get_req(int fd, request_rec *r, char **filename, char **argv0, char r->uri = ap_getword(r->pool, (const char **)&data, '\n'); - environ = ap_pcalloc(r->pool, (j + 2) *sizeof(char *)); + environ = apr_pcalloc(r->pool, (j + 2) *sizeof(char *)); i = 0; for (i = 0; i < j; i++) { environ[i] = ap_getword(r->pool, (const char **)&data, '\n'); @@ -416,7 +416,7 @@ static void send_req(int fd, request_rec *r, char *argv0, char **env) int i = 0; char *data; - data = ap_pstrcat(r->pool, r->filename, "\n", argv0, "\n", r->uri, "\n", + data = apr_pstrcat(r->pool, r->filename, "\n", argv0, "\n", r->uri, "\n", NULL); for (i =0; env[i]; i++) { @@ -429,9 +429,9 @@ static void send_req(int fd, request_rec *r, char *argv0, char **env) } for (i = 0; env[i]; i++) { - data = ap_pstrcat(r->pool, data, env[i], "\n", NULL); + data = apr_pstrcat(r->pool, data, env[i], "\n", NULL); } - data = ap_pstrcat(r->pool, data, r->args, NULL); + data = apr_pstrcat(r->pool, data, r->args, NULL); len = strlen(data); if (write(fd, &len, sizeof(int)) < 0) { ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, @@ -497,11 +497,11 @@ static int cgid_server_child(int sd) char *argv0; char *filename; char **env; - ap_pool_t *p; + apr_pool_t *p; request_rec *r; - ap_create_pool(&p, pcgi); - r = ap_pcalloc(p, sizeof(request_rec)); + apr_create_pool(&p, pcgi); + r = apr_pcalloc(p, sizeof(request_rec)); r->pool = p; dup2(sd, STDIN_FILENO); dup2(sd, STDOUT_FILENO); @@ -521,7 +521,7 @@ static int cgid_server(void *data) cgid_server_conf *sconf = (cgid_server_conf *)ap_get_module_config( main_server->module_config, &cgid_module); - ap_signal(SIGCHLD, SIG_IGN); + apr_signal(SIGCHLD, SIG_IGN); if (unlink(sconf->sockname) < 0 && errno != ENOENT) { ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, @@ -588,7 +588,7 @@ static int cgid_server(void *data) dup2(open(sconf->logname, O_WRONLY), STDERR_FILENO); } else { - ap_get_os_file(&errfile, main_server->error_log); + apr_get_os_file(&errfile, main_server->error_log); dup2(errfile, STDERR_FILENO); } cgid_server_child(sd2); @@ -601,13 +601,13 @@ static int cgid_server(void *data) return -1; } -static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_rec *main_server) +static void cgid_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *main_server) { pid_t pid; - ap_proc_t *procnew; + apr_proc_t *procnew; if (once_through > 0) { - ap_create_pool(&pcgi, p); + apr_create_pool(&pcgi, p); if ((pid = fork()) < 0) { ap_log_error(APLOG_MARK, APLOG_ERR, errno, main_server, @@ -617,21 +617,21 @@ static void cgid_init(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, server_re cgid_server(main_server); exit(-1); } - procnew = ap_pcalloc(p, sizeof(*procnew)); + procnew = apr_pcalloc(p, sizeof(*procnew)); procnew->pid = pid; procnew->err = procnew->in = procnew->out = NULL; - ap_note_subprocess(p, procnew, kill_after_timeout); + apr_note_subprocess(p, procnew, kill_after_timeout); #if APR_HAS_OTHER_CHILD - ap_register_other_child(procnew, cgid_maint, NULL, NULL, p); + apr_register_other_child(procnew, cgid_maint, NULL, NULL, p); #endif } else once_through++; } -static void *create_cgid_config(ap_pool_t *p, server_rec *s) +static void *create_cgid_config(apr_pool_t *p, server_rec *s) { cgid_server_conf *c = - (cgid_server_conf *) ap_pcalloc(p, sizeof(cgid_server_conf)); + (cgid_server_conf *) apr_pcalloc(p, sizeof(cgid_server_conf)); c->logname = NULL; c->logbytes = DEFAULT_LOGBYTES; @@ -641,7 +641,7 @@ static void *create_cgid_config(ap_pool_t *p, server_rec *s) return c; } -static void *merge_cgid_config(ap_pool_t *p, void *basev, void *overridesv) +static void *merge_cgid_config(apr_pool_t *p, void *basev, void *overridesv) { cgid_server_conf *base = (cgid_server_conf *) basev, *overrides = (cgid_server_conf *) overridesv; @@ -705,7 +705,7 @@ static const command_rec cgid_cmds[] = static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret, int show_errno, char *error) { - ap_file_t *f = NULL; + apr_file_t *f = NULL; struct stat finfo; char time_str[AP_CTIME_LEN]; @@ -715,31 +715,31 @@ static int log_scripterror(request_rec *r, cgid_server_conf * conf, int ret, if (!conf->logname || ((stat(ap_server_root_relative(r->pool, conf->logname), &finfo) == 0) && (finfo.st_size > conf->logbytes)) || - (ap_open(&f, ap_server_root_relative(r->pool, conf->logname), + (apr_open(&f, ap_server_root_relative(r->pool, conf->logname), APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) { return ret; } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */ - ap_ctime(time_str, ap_now()); - ap_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, + apr_ctime(time_str, apr_now()); + apr_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgid-bin */ - ap_fprintf(f, "%%%% %d %s\n", ret, r->filename); + apr_fprintf(f, "%%%% %d %s\n", ret, r->filename); - ap_fprintf(f, "%%error\n%s\n", error); + apr_fprintf(f, "%%error\n%s\n", error); - ap_close(f); + apr_close(f); return ret; } static int log_script(request_rec *r, cgid_server_conf * conf, int ret, char *dbuf, const char *sbuf, BUFF *script_in, BUFF *script_err) { - ap_array_header_t *hdrs_arr = ap_table_elts(r->headers_in); - ap_table_entry_t *hdrs = (ap_table_entry_t *) hdrs_arr->elts; + apr_array_header_t *hdrs_arr = ap_table_elts(r->headers_in); + apr_table_entry_t *hdrs = (apr_table_entry_t *) hdrs_arr->elts; char argsbuffer[HUGE_STRING_LEN]; - ap_file_t *f = NULL; + apr_file_t *f = NULL; int i; struct stat finfo; char time_str[AP_CTIME_LEN]; @@ -747,7 +747,7 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret, if (!conf->logname || ((stat(ap_server_root_relative(r->pool, conf->logname), &finfo) == 0) && (finfo.st_size > conf->logbytes)) || - (ap_open(&f, ap_server_root_relative(r->pool, conf->logname), + (apr_open(&f, ap_server_root_relative(r->pool, conf->logname), APR_APPEND|APR_WRITE|APR_CREATE, APR_OS_DEFAULT, r->pool) != APR_SUCCESS)) { /* Soak up script output */ while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) @@ -760,51 +760,51 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret, } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgid-bin/printenv HTTP/1.0" */ - ap_ctime(time_str, ap_now()); - ap_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, + apr_ctime(time_str, apr_now()); + apr_fprintf(f, "%%%% [%s] %s %s%s%s %s\n", time_str, r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgid-bin" */ - ap_fprintf(f, "%%%% %d %s\n", ret, r->filename); + apr_fprintf(f, "%%%% %d %s\n", ret, r->filename); - ap_puts("%request\n", f); + apr_puts("%request\n", f); for (i = 0; i < hdrs_arr->nelts; ++i) { if (!hdrs[i].key) continue; - ap_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); + apr_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); } if ((r->method_number == M_POST || r->method_number == M_PUT) && *dbuf) { - ap_fprintf(f, "\n%s\n", dbuf); + apr_fprintf(f, "\n%s\n", dbuf); } - ap_puts("%response\n", f); + apr_puts("%response\n", f); hdrs_arr = ap_table_elts(r->err_headers_out); - hdrs = (ap_table_entry_t *) hdrs_arr->elts; + hdrs = (apr_table_entry_t *) hdrs_arr->elts; for (i = 0; i < hdrs_arr->nelts; ++i) { if (!hdrs[i].key) continue; - ap_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); + apr_fprintf(f, "%s: %s\n", hdrs[i].key, hdrs[i].val); } if (sbuf && *sbuf) - ap_fprintf(f, "%s\n", sbuf); + apr_fprintf(f, "%s\n", sbuf); if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { - ap_puts("%stdout\n", f); - ap_puts(argsbuffer, f); + apr_puts("%stdout\n", f); + apr_puts(argsbuffer, f); while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) - ap_puts(argsbuffer, f); - ap_puts("\n", f); + apr_puts(argsbuffer, f); + apr_puts("\n", f); } if (script_err) { if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { - ap_puts("%stderr\n", f); - ap_puts(argsbuffer, f); + apr_puts("%stderr\n", f); + apr_puts(argsbuffer, f); while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) - ap_puts(argsbuffer, f); - ap_puts("\n", f); + apr_puts(argsbuffer, f); + apr_puts("\n", f); } } @@ -813,7 +813,7 @@ static int log_script(request_rec *r, cgid_server_conf * conf, int ret, ap_bclose(script_err); } - ap_close(f); + apr_close(f); return ret; } @@ -835,7 +835,7 @@ static int cgid_handler(request_rec *r) int sd; char **env; struct sockaddr_un unix_addr; - ap_socket_t *tempsock = NULL; + apr_socket_t *tempsock = NULL; int nbytes; ap_iol *iol; script = ap_bcreate(r->pool, B_RDWR); @@ -872,7 +872,7 @@ static int cgid_handler(request_rec *r) struct stat statbuf; char *newfile; - newfile = ap_pstrcat(r->pool, r->filename, ".EXE", NULL); + newfile = apr_pstrcat(r->pool, r->filename, ".EXE", NULL); if ((stat(newfile, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode))) { return log_scripterror(r, conf, HTTP_NOT_FOUND, 0, @@ -915,7 +915,7 @@ static int cgid_handler(request_rec *r) send_req(sd, r, argv0, env); - ap_put_os_sock(&tempsock, &sd, pcgi); + apr_put_os_sock(&tempsock, &sd, pcgi); iol = ap_iol_attach_socket(pcgi, tempsock); @@ -937,7 +937,7 @@ static int cgid_handler(request_rec *r) int dbsize, len_read; if (conf->logname) { - dbuf = ap_pcalloc(r->pool, conf->bufbytes + 1); + dbuf = apr_pcalloc(r->pool, conf->bufbytes + 1); dbpos = 0; } @@ -979,7 +979,7 @@ static int cgid_handler(request_rec *r) return log_script(r, conf, ret, dbuf, sbuf, script, NULL); } - location = ap_table_get(r->headers_out, "Location"); + location = apr_table_get(r->headers_out, "Location"); if (location && location[0] == '/' && r->status == 200) { @@ -990,14 +990,14 @@ static int cgid_handler(request_rec *r) /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = ap_pstrdup(r->pool, "GET"); + r->method = apr_pstrdup(r->pool, "GET"); r->method_number = M_GET; /* We already read the message body (if any), so don't allow * the redirected request to think it has one. We can ignore * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR. */ - ap_table_unset(r->headers_in, "Content-Length"); + apr_table_unset(r->headers_in, "Content-Length"); ap_internal_redirect_handler(location, r); return OK; diff --git a/modules/generators/mod_info.c b/modules/generators/mod_info.c index c5dda74bbc..e8f2e9d919 100644 --- a/modules/generators/mod_info.c +++ b/modules/generators/mod_info.c @@ -94,7 +94,7 @@ typedef struct { } info_entry; typedef struct { - ap_array_header_t *more_info; + apr_array_header_t *more_info; } info_svr_conf; typedef struct info_cfg_lines { @@ -106,21 +106,21 @@ typedef struct info_cfg_lines { module MODULE_VAR_EXPORT info_module; extern module *top_module; -static void *create_info_config(ap_pool_t *p, server_rec *s) +static void *create_info_config(apr_pool_t *p, server_rec *s) { - info_svr_conf *conf = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf)); + info_svr_conf *conf = (info_svr_conf *) apr_pcalloc(p, sizeof(info_svr_conf)); - conf->more_info = ap_make_array(p, 20, sizeof(info_entry)); + conf->more_info = apr_make_array(p, 20, sizeof(info_entry)); return conf; } -static void *merge_info_config(ap_pool_t *p, void *basev, void *overridesv) +static void *merge_info_config(apr_pool_t *p, void *basev, void *overridesv) { - info_svr_conf *new = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf)); + info_svr_conf *new = (info_svr_conf *) apr_pcalloc(p, sizeof(info_svr_conf)); info_svr_conf *base = (info_svr_conf *) basev; info_svr_conf *overrides = (info_svr_conf *) overridesv; - new->more_info = ap_append_arrays(p, overrides->more_info, base->more_info); + new->more_info = apr_append_arrays(p, overrides->more_info, base->more_info); return new; } @@ -162,7 +162,7 @@ static char *mod_info_html_cmd_string(const char *string, char *buf, size_t buf_ return (buf); } -static info_cfg_lines *mod_info_load_config(ap_pool_t *p, const char *filename, +static info_cfg_lines *mod_info_load_config(apr_pool_t *p, const char *filename, request_rec *r) { char s[MAX_STRING_LEN]; @@ -183,7 +183,7 @@ static info_cfg_lines *mod_info_load_config(ap_pool_t *p, const char *filename, if (*s == '#') { continue; /* skip comments */ } - new = ap_palloc(p, sizeof(struct info_cfg_lines)); + new = apr_palloc(p, sizeof(struct info_cfg_lines)); new->next = NULL; if (!ret) { ret = new; @@ -194,7 +194,7 @@ static info_cfg_lines *mod_info_load_config(ap_pool_t *p, const char *filename, t = s; new->cmd = ap_getword_conf(p, &t); if (*t) { - new->line = ap_pstrdup(p, t); + new->line = apr_pstrdup(p, t); } else { new->line = NULL; @@ -641,7 +641,7 @@ static const char *add_module_info(cmd_parms *cmd, void *dummy, char *name, server_rec *s = cmd->server; info_svr_conf *conf = (info_svr_conf *) ap_get_module_config(s->module_config, &info_module); - info_entry *new = ap_push_array(conf->more_info); + info_entry *new = apr_push_array(conf->more_info); new->name = name; new->info = info; @@ -669,7 +669,7 @@ module MODULE_VAR_EXPORT info_module = NULL, /* dir merger --- default is to override */ create_info_config, /* server config */ merge_info_config, /* merge server config */ - info_cmds, /* command ap_table_t */ + info_cmds, /* command apr_table_t */ info_handlers, /* handlers */ NULL, /* filename translation */ NULL, /* check_user_id */ diff --git a/modules/generators/mod_status.c b/modules/generators/mod_status.c index 75009a5f20..de9dc88b89 100644 --- a/modules/generators/mod_status.c +++ b/modules/generators/mod_status.c @@ -81,7 +81,7 @@ static int print_status_value(void *data, const char *key, const char *val) static int status_handler(request_rec *r) { int i; - ap_array_header_t *server_status; + apr_array_header_t *server_status; ap_status_table_row_t *status_rows; r->allowed = (1 << M_GET); @@ -107,14 +107,14 @@ static int status_handler(request_rec *r) ap_rvputs(r, "Server Built: ", ap_get_server_built(), "
\n
\n", NULL); ap_rvputs(r, "Current Time: ", - ap_ht_time(r->pool, ap_now(), DEFAULT_TIME_FORMAT, 0), "
\n", NULL); + ap_ht_time(r->pool, apr_now(), DEFAULT_TIME_FORMAT, 0), "
\n", NULL); ap_rprintf(r, "\n%d connections currently being processed\n", server_status->nelts); status_rows = (ap_status_table_row_t *) server_status->elts; for (i = 0; i < server_status->nelts; i++) { ap_rprintf(r, "Connection %ld
\n", status_rows[i].conn_id); - ap_table_do(print_status_value, (void *) r, status_rows[i].data, NULL); + apr_table_do(print_status_value, (void *) r, status_rows[i].data, NULL); } ap_rputs("