From: Doug MacEachern Date: Wed, 2 Aug 2000 05:27:38 +0000 (+0000) Subject: prefix libapr functions and types with apr_ X-Git-Tag: APACHE_2_0_ALPHA_5~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=059d8dd2122f0a3948c2c09549159f0931a6f236;p=apache prefix libapr functions and types with apr_ git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85976 13f79535-47bb-0310-9956-ffa450edef68 --- 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... ( command and virtual hosts) */ @@ -863,9 +863,9 @@ int ap_parse_htaccess(void **result, request_rec *r, int override, * @param main_server The main server for this Apache configuration * @param ps Place to store the new server_rec * return Error string on error, NULL on success - * @deffunc const char *ap_init_virtual_host(ap_pool_t *p, const char *hostname, server_rec *main_server, server_rec **ps) + * @deffunc const char *ap_init_virtual_host(apr_pool_t *p, const char *hostname, server_rec *main_server, server_rec **ps) */ -CORE_EXPORT(const char *) ap_init_virtual_host(ap_pool_t *p, const char *hostname, +CORE_EXPORT(const char *) ap_init_virtual_host(apr_pool_t *p, const char *hostname, server_rec *main_server, server_rec **); /** @@ -877,7 +877,7 @@ CORE_EXPORT(const char *) ap_init_virtual_host(ap_pool_t *p, const char *hostnam * @param ptem Pool for temporary allocation */ void ap_process_resource_config(server_rec *s, const char *fname, - ap_directive_t **conftree, ap_pool_t *p, ap_pool_t *ptemp); + ap_directive_t **conftree, apr_pool_t *p, apr_pool_t *ptemp); /** * Process all directives in the config tree @@ -887,7 +887,7 @@ void ap_process_resource_config(server_rec *s, const char *fname, * @param ptemp The pool for temporary allocations */ API_EXPORT(void) ap_process_config_tree(server_rec *s, ap_directive_t *conftree, - ap_pool_t *p, ap_pool_t *ptemp); + apr_pool_t *p, apr_pool_t *ptemp); /* For individual MPMs... */ @@ -896,7 +896,7 @@ API_EXPORT(void) ap_process_config_tree(server_rec *s, ap_directive_t *conftree, * @param pchild The pool for child process allocations * @param s The list of all server_recs */ -void ap_child_init_hook(ap_pool_t *pchild, server_rec *s); +void ap_child_init_hook(apr_pool_t *pchild, server_rec *s); /* Module-method dispatchers, also for http_request.c */ /** @@ -954,10 +954,10 @@ AP_DECLARE_HOOK(int,header_parser,(request_rec *)) * @param pconf The config pool * @param plog The logging streams pool * @param ptemp The temporary pool - * @deffunc void ap_run_pre_config(ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp) + * @deffunc void ap_run_pre_config(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp) */ AP_DECLARE_HOOK(void,pre_config, - (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp)) + (apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp)) /** * Run the post_config function for each module @@ -965,10 +965,10 @@ AP_DECLARE_HOOK(void,pre_config, * @param plog The logging streams pool * @param ptemp The temporary pool * @param s The list of server_recs - * @deffunc void ap_run_post_config(ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp, server_rec *s) + * @deffunc void ap_run_post_config(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp, server_rec *s) */ AP_DECLARE_HOOK(void,post_config, - (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s)) + (apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec *s)) /** * Run the open_logs functions for each module @@ -976,18 +976,18 @@ AP_DECLARE_HOOK(void,post_config, * @param plog The logging streams pool * @param ptemp The temporary pool * @param s The list of server_recs - * @deffunc void ap_run_open_logs(ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp, server_rec *s) + * @deffunc void ap_run_open_logs(apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp, server_rec *s) */ AP_DECLARE_HOOK(void,open_logs, - (ap_pool_t *pconf,ap_pool_t *plog,ap_pool_t *ptemp,server_rec *s)) + (apr_pool_t *pconf,apr_pool_t *plog,apr_pool_t *ptemp,server_rec *s)) /** * Run the child_init functions for each module * @param pchild The child pool * @param s The list of server_recs in this server - * @deffunc void ap_run_child_init(ap_pool_t *pchild, server_rec *s) + * @deffunc void ap_run_child_init(apr_pool_t *pchild, server_rec *s) */ -AP_DECLARE_HOOK(void,child_init,(ap_pool_t *pchild, server_rec *s)) +AP_DECLARE_HOOK(void,child_init,(apr_pool_t *pchild, server_rec *s)) #ifdef __cplusplus } diff --git a/include/http_connection.h b/include/http_connection.h index 0fb6000fa7..2b204bd6fc 100644 --- a/include/http_connection.h +++ b/include/http_connection.h @@ -76,7 +76,7 @@ extern "C" { * @param addr The server's local address * @param id ID of this connection; unique at any point in time. */ -conn_rec *ap_new_connection(ap_pool_t *p, server_rec *server, BUFF *inout, +conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, BUFF *inout, const struct sockaddr_in *remaddr, const struct sockaddr_in *saddr, long id); @@ -89,8 +89,8 @@ conn_rec *ap_new_connection(ap_pool_t *p, server_rec *server, BUFF *inout, * @param conn_socket The socket we are creating the connection on. * @param id ID of this connection; unique at any point in time. */ -conn_rec *ap_new_apr_connection(ap_pool_t *p, server_rec *server, BUFF *inout, - ap_socket_t *conn_socket, long id); +conn_rec *ap_new_apr_connection(apr_pool_t *p, server_rec *server, BUFF *inout, + apr_socket_t *conn_socket, long id); /** * This is the protocol module driver. This calls all of the diff --git a/include/http_core.h b/include/http_core.h index 8b30c236fc..19d1813038 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -131,7 +131,7 @@ API_EXPORT(const char *) ap_get_remote_logname(request_rec *r); /* Used for constructing self-referencing URLs, and things like SERVER_PORT, * and SERVER_NAME. */ -API_EXPORT(char *) ap_construct_url(ap_pool_t *p, const char *uri, request_rec *r); +API_EXPORT(char *) ap_construct_url(apr_pool_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); @@ -155,7 +155,7 @@ typedef struct { 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 ap_array_header_t *) ap_requires (request_rec *); +API_EXPORT(const apr_array_header_t *) ap_requires (request_rec *); #ifdef WIN32 /* @@ -218,7 +218,7 @@ typedef struct { int satisfy; char *ap_auth_type; char *ap_auth_name; - ap_array_header_t *ap_requires; + apr_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, @@ -279,7 +279,7 @@ typedef struct { int loglevel; /* Access control */ - ap_array_header_t *sec; + apr_array_header_t *sec; regex_t *r; #ifdef WIN32 @@ -306,12 +306,12 @@ typedef struct { /* Access control */ char *access_name; - ap_array_header_t *sec; - ap_array_header_t *sec_url; + apr_array_header_t *sec; + apr_array_header_t *sec_url; } core_server_config; /* for http_config.c */ -void ap_core_reorder_directories(ap_pool_t *, server_rec *); +void ap_core_reorder_directories(apr_pool_t *, server_rec *); /* for mod_perl */ CORE_EXPORT(void) ap_add_per_dir_conf (server_rec *s, void *dir_config); diff --git a/include/http_log.h b/include/http_log.h index fb3cb662bc..b8f0cc5852 100644 --- a/include/http_log.h +++ b/include/http_log.h @@ -118,7 +118,7 @@ extern "C" { * @param s_main The main server * @param p The pool to allocate out of */ -void ap_open_logs (server_rec *s_main, ap_pool_t *p); +void ap_open_logs (server_rec *s_main, apr_pool_t *p); /* * The three primary logging functions, ap_log_error, ap_log_rerror, and @@ -147,10 +147,10 @@ void ap_open_logs (server_rec *s_main, ap_pool_t *p); * denial-of-service attack and other messy behavior. Instead, use a * simple format string like "%s", followed by the string containing the * untrusted data. - * @deffunc void ap_log_error(const char *file, int line, int level, ap_status_t status, const server_rec *s, const char *fmt, ...) + * @deffunc void ap_log_error(const char *file, int line, int level, apr_status_t status, const server_rec *s, const char *fmt, ...) */ API_EXPORT(void) ap_log_error(const char *file, int line, int level, - ap_status_t status, const server_rec *s, + apr_status_t status, const server_rec *s, const char *fmt, ...) __attribute__((format(printf,6,7))); @@ -171,10 +171,10 @@ API_EXPORT(void) ap_log_error(const char *file, int line, int level, * denial-of-service attack and other messy behavior. Instead, use a * simple format string like "%s", followed by the string containing the * untrusted data. - * @deffunc void ap_log_error(const char *file, int line, int level, ap_status_t status, ap_pool_t *p, const char *fmt, ...) + * @deffunc void ap_log_error(const char *file, int line, int level, apr_status_t status, apr_pool_t *p, const char *fmt, ...) */ API_EXPORT(void) ap_log_perror(const char *file, int line, int level, - ap_status_t status, ap_pool_t *p, + apr_status_t status, apr_pool_t *p, const char *fmt, ...) __attribute__((format(printf,6,7))); @@ -195,10 +195,10 @@ API_EXPORT(void) ap_log_perror(const char *file, int line, int level, * denial-of-service attack and other messy behavior. Instead, use a * simple format string like "%s", followed by the string containing the * untrusted data. - * @deffunc void ap_log_error(const char *file, int line, int level, ap_status_t status, request_rec *s, const char *fmt, ...) + * @deffunc void ap_log_error(const char *file, int line, int level, apr_status_t status, request_rec *s, const char *fmt, ...) */ API_EXPORT(void) ap_log_rerror(const char *file, int line, int level, - ap_status_t status, const request_rec *s, + apr_status_t status, const request_rec *s, const char *fmt, ...) __attribute__((format(printf,6,7))); @@ -214,7 +214,7 @@ API_EXPORT(void) ap_error_log2stderr (server_rec *); * @param p The pool to use for logging * @param fname The name of the file to log to */ -void ap_log_pid (ap_pool_t *p, const char *fname); +void ap_log_pid (apr_pool_t *p, const char *fname); /* These are for legacy code, new code should use ap_log_error, * or ap_log_rerror. */ @@ -234,16 +234,16 @@ typedef struct piped_log piped_log; */ struct piped_log { /** The pool to use for the piped log */ - ap_pool_t *p; + apr_pool_t *p; /** The pipe between the server and the logging process */ - ap_file_t *fds[2]; + apr_file_t *fds[2]; /* XXX - an #ifdef that needs to be eliminated from public view. Shouldn't * be hard */ #ifdef HAVE_RELIABLE_PIPED_LOGS /** The name of the program the logging process is running */ char *program; /** The pid of the logging process */ - ap_proc_t *pid; + apr_proc_t *pid; #endif }; @@ -252,9 +252,9 @@ struct piped_log { * @param p The pool to allocate out of * @param program The program to run in the logging process * @return The piped log structure - * @deffunc piped_log *ap_open_piped_log(ap_pool_t *p, const char *program) + * @deffunc piped_log *ap_open_piped_log(apr_pool_t *p, const char *program) */ -API_EXPORT(piped_log *) ap_open_piped_log (ap_pool_t *p, const char *program); +API_EXPORT(piped_log *) ap_open_piped_log (apr_pool_t *p, const char *program); /** * Close the piped log and kill the logging process diff --git a/include/http_main.h b/include/http_main.h index f23675bd18..2ab757764f 100644 --- a/include/http_main.h +++ b/include/http_main.h @@ -60,7 +60,7 @@ #define APACHE_HTTP_MAIN_H /* AP_SERVER_BASEARGS is the command argument list parsed by http_main.c - * in ap_getopt() format. Use this for default'ing args that the MPM + * in apr_getopt() format. Use this for default'ing args that the MPM * can safely ignore and pass on from its rewrite_args() handler. */ #define AP_SERVER_BASEARGS "C:c:D:d:f:vVlLth?" @@ -73,9 +73,9 @@ extern API_VAR_EXPORT const char *ap_server_argv0; extern API_VAR_EXPORT const char *ap_server_root; /* for -C, -c and -D switches */ -extern API_VAR_EXPORT ap_array_header_t *ap_server_pre_read_config; -extern API_VAR_EXPORT ap_array_header_t *ap_server_post_read_config; -extern API_VAR_EXPORT ap_array_header_t *ap_server_config_defines; +extern API_VAR_EXPORT apr_array_header_t *ap_server_pre_read_config; +extern API_VAR_EXPORT apr_array_header_t *ap_server_post_read_config; +extern API_VAR_EXPORT apr_array_header_t *ap_server_config_defines; #ifdef __cplusplus } diff --git a/include/http_protocol.h b/include/http_protocol.h index 5759487e77..37e40f4886 100644 --- a/include/http_protocol.h +++ b/include/http_protocol.h @@ -119,7 +119,7 @@ API_EXPORT(void) ap_send_error_response(request_rec *r, int recursive_error); API_EXPORT(int) ap_set_content_length(request_rec *r, long length); API_EXPORT(int) ap_set_keepalive(request_rec *r); -API_EXPORT(ap_time_t) ap_rationalize_mtime(request_rec *r, ap_time_t mtime); +API_EXPORT(apr_time_t) ap_rationalize_mtime(request_rec *r, apr_time_t mtime); API_EXPORT(char *) ap_make_etag(request_rec *r, int force_weak); API_EXPORT(void) ap_set_etag(request_rec *r); API_EXPORT(void) ap_set_last_modified(request_rec *r); @@ -136,13 +136,13 @@ API_EXPORT(int) ap_meets_conditions(request_rec *r); * (Ditto the send_header stuff). */ -API_EXPORT(ap_status_t) ap_send_fd(ap_file_t *fd, request_rec *r, ap_off_t offset, - ap_size_t length, ap_size_t *nbytes); +API_EXPORT(apr_status_t) ap_send_fd(apr_file_t *fd, request_rec *r, apr_off_t offset, + apr_size_t length, apr_size_t *nbytes); API_EXPORT(long) ap_send_fb(BUFF *f, request_rec *r); API_EXPORT(long) ap_send_fb_length(BUFF *f, request_rec *r, long length); -API_EXPORT(size_t) ap_send_mmap(ap_mmap_t *mm, request_rec *r, size_t offset, +API_EXPORT(size_t) ap_send_mmap(apr_mmap_t *mm, request_rec *r, size_t offset, size_t length); /* Hmmm... could macrofy these for now, and maybe forever, though the @@ -182,8 +182,8 @@ API_EXPORT(int) ap_discard_request_body(request_rec *r); /* Sending a byterange */ API_EXPORT(int) ap_set_byterange(request_rec *r); -API_EXPORT(int) ap_each_byterange(request_rec *r, ap_off_t *offset, - ap_size_t *length); +API_EXPORT(int) ap_each_byterange(request_rec *r, apr_off_t *offset, + apr_size_t *length); /* Support for the Basic authentication protocol. Note that there's * nothing that prevents these from being in mod_auth.c, except that other diff --git a/include/http_request.h b/include/http_request.h index 2071f7c834..7d5bed28f9 100644 --- a/include/http_request.h +++ b/include/http_request.h @@ -82,7 +82,7 @@ extern "C" { * (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 ap_pool_t elsewhere before doing this. + * about which was allocated in its apr_pool_t elsewhere before doing this. */ API_EXPORT(request_rec *) ap_sub_req_lookup_uri(const char *new_file, @@ -105,7 +105,7 @@ API_EXPORT(void) ap_internal_redirect(const char *new_uri, request_rec *); API_EXPORT(void) ap_internal_redirect_handler(const char *new_uri, request_rec *); API_EXPORT(int) ap_some_auth_required(request_rec *r); API_EXPORT(int) ap_is_initial_req(request_rec *r); -API_EXPORT(void) ap_update_mtime(request_rec *r, ap_time_t dependency_mtime); +API_EXPORT(void) ap_update_mtime(request_rec *r, apr_time_t dependency_mtime); #ifdef CORE_PRIVATE /* Function called by main.c to handle first-level request */ diff --git a/include/http_vhost.h b/include/http_vhost.h index 256609d6aa..b131273f3b 100644 --- a/include/http_vhost.h +++ b/include/http_vhost.h @@ -60,13 +60,13 @@ extern "C" { #endif /* called before any config is read */ -void ap_init_vhost_config(ap_pool_t *p); +void ap_init_vhost_config(apr_pool_t *p); /* called after the config has been read */ -void ap_fini_vhost_config(ap_pool_t *p, server_rec *main_server); +void ap_fini_vhost_config(apr_pool_t *p, server_rec *main_server); /* handle addresses in statement */ -const char *ap_parse_vhost_addrs(ap_pool_t *p, const char *hostname, server_rec *s); +const char *ap_parse_vhost_addrs(apr_pool_t *p, const char *hostname, server_rec *s); /* handle NameVirtualHost directive */ const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, diff --git a/include/httpd.h b/include/httpd.h index 763619bb68..420a3a194b 100644 --- a/include/httpd.h +++ b/include/httpd.h @@ -366,7 +366,7 @@ extern "C" { #define APEXIT_CHILDFATAL 0xf API_EXPORT(const char *) ap_get_server_version(void); -API_EXPORT(void) ap_add_version_component(ap_pool_t *pconf, const char *component); +API_EXPORT(void) ap_add_version_component(apr_pool_t *pconf, const char *component); API_EXPORT(const char *) ap_get_server_built(void); /* Numeric release version identifier: MMNNFFRBB: major minor fix final beta @@ -386,7 +386,7 @@ API_EXPORT(const char *) ap_get_server_built(void); /* 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 ap_table_t at startup. + * A future version should dynamically generate the apr_table_t at startup. */ #define RESPONSE_CODES 55 @@ -558,15 +558,15 @@ typedef struct request_rec request_rec; struct ap_rr_xlate { /* contents are experimental! expect it to change! */ - ap_xlate_t *to_net; + apr_xlate_t *to_net; int to_net_sb; /* whether or not write translation is single-byte-only */ - ap_xlate_t *from_net; + apr_xlate_t *from_net; }; #endif /*APACHE_XLATE*/ struct process_rec { - ap_pool_t *pool; /* Global pool. Please try to cleared on _all_ exits */ - ap_pool_t *pconf; /* aka configuration pool, cleared on restarts */ + apr_pool_t *pool; /* Global pool. Please try to cleared on _all_ exits */ + apr_pool_t *pconf; /* aka configuration pool, cleared on restarts */ int argc; char *const *argv; const char *short_name; @@ -574,7 +574,7 @@ struct process_rec { struct request_rec { - ap_pool_t *pool; + apr_pool_t *pool; conn_rec *connection; server_rec *server; @@ -602,7 +602,7 @@ struct request_rec { int proto_num; /* Number version of protocol; 1.1 = 1001 */ const char *hostname; /* Host, as set by full URI or Host: */ - ap_time_t request_time; /* When the request started */ + apr_time_t request_time; /* When the request started */ const char *status_line; /* Status line, if set by script */ int status; /* In any case */ @@ -638,7 +638,7 @@ struct request_rec { int sent_bodyct; /* byte count in stream is for body */ long bytes_sent; /* body byte count, for easy access */ - ap_time_t mtime; /* Time the resource was last modified */ + apr_time_t mtime; /* Time the resource was last modified */ /* HTTP/1.1 connection-level features */ @@ -662,15 +662,15 @@ struct request_rec { * latter are printed even on error, and persist across internal redirects * (so the headers printed for ErrorDocument handlers will have them). * - * The 'notes' ap_table_t is for notes from one module to another, with no + * The 'notes' apr_table_t is for notes from one module to another, with no * other set purpose in mind... */ - 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; + apr_table_t *headers_in; + apr_table_t *headers_out; + apr_table_t *err_headers_out; + apr_table_t *subprocess_env; + apr_table_t *notes; /* content_type, handler, content_encoding, content_language, and all * content_languages MUST be lowercased strings. They may be pointers @@ -681,7 +681,7 @@ struct request_rec { const char *content_encoding; const char *content_language; /* for back-compat. only -- do not use */ - ap_array_header_t *content_languages; /* array of (char*) */ + apr_array_header_t *content_languages; /* array of (char*) */ char *vlist_validator; /* variant list validator (if negotiated) */ @@ -702,7 +702,7 @@ struct request_rec { char *filename; char *path_info; char *args; /* QUERY_ARGS, if any */ - ap_finfo_t finfo; /* ST_MODE set to zero if no such file */ + apr_finfo_t finfo; /* ST_MODE set to zero if no such file */ uri_components parsed_uri; /* components of uri, dismantled */ /* Various other config info which may change with .htaccess files @@ -725,7 +725,7 @@ struct request_rec { struct ap_rr_xlate *rrx; #endif /*APACHE_XLATE*/ - struct ap_filter_t *filters; + struct apr_filter_t *filters; /* Things placed at the end of the record to avoid breaking binary * compatibility. It would be nice to remember to reorder the entire @@ -740,7 +740,7 @@ struct request_rec { struct conn_rec { - ap_pool_t *pool; + apr_pool_t *pool; server_rec *base_server; /* Physical vhost this conn come in on */ void *vhost_lookup_data; /* used by http_vhost.c */ @@ -776,7 +776,7 @@ struct conn_rec { long id; /* ID of this connection; unique at any * point in time */ void *conn_config; /* Notes on *this* connection */ - ap_table_t *notes; /* send note from one module to another, must + apr_table_t *notes; /* send note from one module to another, must * remain valid for all requests on this conn */ }; @@ -790,7 +790,7 @@ struct conn_rec { typedef struct server_addr_rec server_addr_rec; struct server_addr_rec { server_addr_rec *next; - ap_in_addr host_addr; /* The bound address, for this server */ + apr_in_addr host_addr; /* The bound address, for this server */ unsigned short host_port; /* The bound port, for this server */ char *virthost; /* The name given in */ }; @@ -812,7 +812,7 @@ struct server_rec { /* Log files --- note that transfer log is now in the modules... */ char *error_fname; - ap_file_t *error_log; + apr_file_t *error_log; int loglevel; /* Module-specific configuration for server, and defaults... */ @@ -835,8 +835,8 @@ struct server_rec { const char *path; /* Pathname for ServerPath */ int pathlen; /* Length of path */ - ap_array_header_t *names; /* Normal names for ServerAlias servers */ - ap_array_header_t *wild_names; /* Wildcarded names for ServerAlias servers */ + apr_array_header_t *names; /* Normal names for ServerAlias servers */ + apr_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 */ @@ -894,69 +894,69 @@ struct server_rec { /* Time */ -API_EXPORT(char *) ap_field_noparam(ap_pool_t *p, const char *intype); -API_EXPORT(char *) ap_ht_time(ap_pool_t *p, ap_time_t t, const char *fmt, int gmt); +API_EXPORT(char *) ap_field_noparam(apr_pool_t *p, const char *intype); +API_EXPORT(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, int gmt); /* 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(ap_pool_t *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nc(ap_pool_t *p, char **line, char stop); -API_EXPORT(char *) ap_getword_white(ap_pool_t *p, const char **line); -API_EXPORT(char *) ap_getword_white_nc(ap_pool_t *p, char **line); -API_EXPORT(char *) ap_getword_nulls(ap_pool_t *p, const char **line, char stop); -API_EXPORT(char *) ap_getword_nulls_nc(ap_pool_t *p, char **line, char stop); -API_EXPORT(char *) ap_getword_conf(ap_pool_t *p, const char **line); -API_EXPORT(char *) ap_getword_conf_nc(ap_pool_t *p, char **line); -API_EXPORT(const char *) ap_resolve_env(ap_pool_t *p, const char * word); +API_EXPORT(char *) ap_getword(apr_pool_t *p, const char **line, char stop); +API_EXPORT(char *) ap_getword_nc(apr_pool_t *p, char **line, char stop); +API_EXPORT(char *) ap_getword_white(apr_pool_t *p, const char **line); +API_EXPORT(char *) ap_getword_white_nc(apr_pool_t *p, char **line); +API_EXPORT(char *) ap_getword_nulls(apr_pool_t *p, const char **line, char stop); +API_EXPORT(char *) ap_getword_nulls_nc(apr_pool_t *p, char **line, char stop); +API_EXPORT(char *) ap_getword_conf(apr_pool_t *p, const char **line); +API_EXPORT(char *) ap_getword_conf_nc(apr_pool_t *p, char **line); +API_EXPORT(const char *) ap_resolve_env(apr_pool_t *p, const char * word); API_EXPORT(const char *) ap_size_list_item(const char **field, int *len); -API_EXPORT(char *) ap_get_list_item(ap_pool_t *p, const char **field); -API_EXPORT(int) ap_find_list_item(ap_pool_t *p, const char *line, const char *tok); +API_EXPORT(char *) ap_get_list_item(apr_pool_t *p, const char **field); +API_EXPORT(int) ap_find_list_item(apr_pool_t *p, const char *line, const char *tok); -API_EXPORT(char *) ap_get_token(ap_pool_t *p, const char **accept_line, int accept_white); -API_EXPORT(int) ap_find_token(ap_pool_t *p, const char *line, const char *tok); -API_EXPORT(int) ap_find_last_token(ap_pool_t *p, const char *line, const char *tok); +API_EXPORT(char *) ap_get_token(apr_pool_t *p, const char **accept_line, int accept_white); +API_EXPORT(int) ap_find_token(apr_pool_t *p, const char *line, const char *tok); +API_EXPORT(int) ap_find_last_token(apr_pool_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(ap_pool_t *p, const char *s); -API_EXPORT(char *) ap_os_escape_path(ap_pool_t *p, const char *path, int partial); +API_EXPORT(char *) ap_escape_path_segment(apr_pool_t *p, const char *s); +API_EXPORT(char *) ap_os_escape_path(apr_pool_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(ap_pool_t *p, const char *s); -API_EXPORT(char *) ap_construct_server(ap_pool_t *p, const char *hostname, +API_EXPORT(char *) ap_escape_html(apr_pool_t *p, const char *s); +API_EXPORT(char *) ap_construct_server(apr_pool_t *p, const char *hostname, unsigned port, const request_rec *r); -API_EXPORT(char *) ap_escape_shell_cmd(ap_pool_t *p, const char *s); +API_EXPORT(char *) ap_escape_shell_cmd(apr_pool_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(ap_pool_t *p, const char *s); +API_EXPORT(char *) ap_make_dirstr_parent(apr_pool_t *p, const char *s); /* deprecated. The previous two routines are preferred. */ -API_EXPORT(char *) ap_make_dirstr(ap_pool_t *a, const char *s, int n); -API_EXPORT(char *) ap_make_full_path(ap_pool_t *a, const char *dir, const char *f); +API_EXPORT(char *) ap_make_dirstr(apr_pool_t *a, const char *s, int n); +API_EXPORT(char *) ap_make_full_path(apr_pool_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_strcasestr(const char *s1, const char *s2); -API_EXPORT(char *) ap_pbase64decode(ap_pool_t *p, const char *bufcoded); -API_EXPORT(char *) ap_pbase64encode(ap_pool_t *p, char *string); -API_EXPORT(char *) ap_uudecode(ap_pool_t *p, const char *bufcoded); -API_EXPORT(char *) ap_uuencode(ap_pool_t *p, char *string); +API_EXPORT(char *) ap_pbase64decode(apr_pool_t *p, const char *bufcoded); +API_EXPORT(char *) ap_pbase64encode(apr_pool_t *p, char *string); +API_EXPORT(char *) ap_uudecode(apr_pool_t *p, const char *bufcoded); +API_EXPORT(char *) ap_uuencode(apr_pool_t *p, char *string); #include "pcreposix.h" -API_EXPORT(regex_t *) ap_pregcomp(ap_pool_t *p, const char *pattern, +API_EXPORT(regex_t *) ap_pregcomp(apr_pool_t *p, const char *pattern, int cflags); -API_EXPORT(void) ap_pregfree(ap_pool_t *p, regex_t *reg); +API_EXPORT(void) ap_pregfree(apr_pool_t *p, regex_t *reg); API_EXPORT(int) ap_regexec(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(ap_pool_t *p, const char *input, const char *source, +API_EXPORT(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[]); API_EXPORT(void) ap_content_type_tolower(char *); @@ -964,7 +964,7 @@ API_EXPORT(void) ap_str_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 (ap_pool_t *p, const char *instring); +API_EXPORT(char *) ap_escape_quotes (apr_pool_t *p, const char *instring); /* Misc system hackery */ @@ -975,14 +975,14 @@ API_EXPORT(void) ap_chdir_file(const char *file); API_EXPORT(int) ap_get_max_daemons(void); #ifdef _OSD_POSIX -extern const char *os_set_account(ap_pool_t *p, const char *account); +extern const char *os_set_account(apr_pool_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(ap_pool_t *); +char *ap_get_local_host(apr_pool_t *); unsigned long ap_get_virthost_addr(char *hostname, unsigned short *port); -API_EXPORT(char *) ap_escape_quotes(ap_pool_t *p, const char *instr); +API_EXPORT(char *) ap_escape_quotes(apr_pool_t *p, const char *instr); /* * Redefine assert() to something more useful for an Apache... diff --git a/include/mpm_common.h b/include/mpm_common.h index 3a7131ed30..af66bb4d2a 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -79,8 +79,8 @@ extern "C" { #endif void ap_reclaim_child_processes(int terminate); -void ap_wait_or_timeout(ap_wait_t *status, ap_proc_t *ret, ap_pool_t *p); -void ap_process_child_status(ap_proc_t *pid, ap_wait_t status); +void ap_wait_or_timeout(ap_wait_t *status, apr_proc_t *ret, apr_pool_t *p); +void ap_process_child_status(apr_proc_t *pid, ap_wait_t status); #if defined(TCP_NODELAY) && !defined(MPE) && !defined(TPF) void ap_sock_disable_nagle(int s); #else diff --git a/include/mpm_status.h b/include/mpm_status.h index 901fe9e28a..e02961a2a5 100644 --- a/include/mpm_status.h +++ b/include/mpm_status.h @@ -64,7 +64,7 @@ typedef struct { long conn_id; - ap_table_t *data; + apr_table_t *data; } ap_status_table_row_t; /** @@ -81,7 +81,7 @@ API_EXPORT(const char *) ap_get_connection_status(long conn_id, const char *key) * Get an array of current connection IDs. * */ -API_EXPORT(ap_array_header_t *) ap_get_connections(ap_pool_t *p); +API_EXPORT(apr_array_header_t *) ap_get_connections(apr_pool_t *p); /** * Get an array of keys from a given connection. @@ -89,7 +89,7 @@ API_EXPORT(ap_array_header_t *) ap_get_connections(ap_pool_t *p); * conn_id = Connection ID * */ -API_EXPORT(ap_array_header_t *) ap_get_connection_keys(ap_pool_t *p, +API_EXPORT(apr_array_header_t *) ap_get_connection_keys(apr_pool_t *p, long conn_id); /** @@ -122,7 +122,7 @@ API_EXPORT(void) ap_reset_connection_status(long conn_id); * p = context, generally of the request * */ -API_EXPORT(ap_array_header_t *) ap_get_status_table(ap_pool_t *p); +API_EXPORT(apr_array_header_t *) ap_get_status_table(apr_pool_t *p); #endif /* APACHE_SERVER_STATS_H */ diff --git a/include/util_charset.h b/include/util_charset.h index 663ea66070..aae24b00ca 100644 --- a/include/util_charset.h +++ b/include/util_charset.h @@ -67,8 +67,8 @@ extern "C" { #include "apr_xlate.h" -extern ap_xlate_t *ap_hdrs_to_ascii, *ap_hdrs_from_ascii; -extern ap_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii; +extern apr_xlate_t *ap_hdrs_to_ascii, *ap_hdrs_from_ascii; +extern apr_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii; /* Save & Restore the current conversion settings * @@ -85,7 +85,7 @@ extern ap_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii; */ #define AP_PUSH_INPUTCONVERSION_STATE(_buff, _newx) \ - ap_xlate_t *saved_input_xlate; \ + apr_xlate_t *saved_input_xlate; \ ap_bgetopt(_buff, BO_RXLATE, &saved_input_xlate); \ ap_bsetopt(_buff, BO_RXLATE, &(_newx)) @@ -93,7 +93,7 @@ extern ap_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii; ap_bsetopt(_buff, BO_RXLATE, &saved_input_xlate) #define AP_PUSH_OUTPUTCONVERSION_STATE(_buff, _newx) \ - ap_xlate_t *saved_output_xlate; \ + apr_xlate_t *saved_output_xlate; \ ap_bgetopt(_buff, BO_WXLATE, &saved_output_xlate); \ ap_bsetopt(_buff, BO_WXLATE, &(_newx)) @@ -103,8 +103,8 @@ extern ap_xlate_t *ap_locale_to_ascii, *ap_locale_from_ascii; /* ap_set_content_xlate() is called by Apache core or a module to set * up character set translation (a.k.a. recoding) for content. */ -API_EXPORT(ap_status_t) ap_set_content_xlate(request_rec *r, int output, - ap_xlate_t *xlate); +API_EXPORT(apr_status_t) ap_set_content_xlate(request_rec *r, int output, + apr_xlate_t *xlate); #ifdef __cplusplus } diff --git a/include/util_date.h b/include/util_date.h index 46696955de..39bd0a3459 100644 --- a/include/util_date.h +++ b/include/util_date.h @@ -69,10 +69,10 @@ extern "C" { #include "apr_time.h" -#define BAD_DATE (ap_time_t)0 +#define BAD_DATE (apr_time_t)0 API_EXPORT(int) ap_checkmask(const char *data, const char *mask); -API_EXPORT(ap_time_t) ap_parseHTTPdate(const char *date); +API_EXPORT(apr_time_t) ap_parseHTTPdate(const char *date); #ifdef __cplusplus } diff --git a/include/util_ebcdic.h b/include/util_ebcdic.h index 747da4ec59..71589c5512 100644 --- a/include/util_ebcdic.h +++ b/include/util_ebcdic.h @@ -68,9 +68,9 @@ extern "C" { #include "apr_xlate.h" #include "util_charset.h" -ap_status_t ap_init_ebcdic(ap_pool_t *); +apr_status_t ap_init_ebcdic(apr_pool_t *); -ap_xlate_t *ap_checkconv(struct request_rec *); +apr_xlate_t *ap_checkconv(struct request_rec *); #ifdef __cplusplus } diff --git a/include/util_filter.h b/include/util_filter.h index f2f564a5a2..1c523abf93 100644 --- a/include/util_filter.h +++ b/include/util_filter.h @@ -92,10 +92,10 @@ extern "C" { */ /* forward declare the filter type */ -typedef struct ap_filter_t ap_filter_t; +typedef struct apr_filter_t apr_filter_t; /* - * ap_filter_func: + * apr_filter_func: * * This function type is used for filter callbacks. It will be passed a * pointer to "this" filter, and a "bucket" containing the content to be @@ -114,7 +114,7 @@ typedef struct ap_filter_t ap_filter_t; * next/prev to insert/remove/replace elements in the bucket list, but * the types and values of the individual buckets should not be altered. */ -typedef ap_status_t (*ap_filter_func)(); +typedef apr_status_t (*apr_filter_func)(); /* * ap_filter_type: @@ -146,7 +146,7 @@ typedef enum { } ap_filter_type; /* - * ap_filter_t: + * apr_filter_t: * * This is the request-time context structure for an installed filter (in * the output filter chain). It provides the callback to use for filtering, @@ -159,13 +159,13 @@ typedef enum { * the state directly with the request. A callback should not change any of * the other fields. */ -struct ap_filter_t { - ap_filter_func filter_func; +struct apr_filter_t { + apr_filter_func filter_func; void *ctx; ap_filter_type ftype; - ap_filter_t *next; + apr_filter_t *next; }; /* @@ -178,7 +178,7 @@ struct ap_filter_t { * The filter's callback and type should be passed. */ API_EXPORT(void) ap_register_filter(const char *name, - ap_filter_func filter_func, + apr_filter_func filter_func, ap_filter_type ftype); /* @@ -198,9 +198,9 @@ API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r); /* * Things to do later: - * Add parameters to ap_filter_func type. Those parameters will be something + * Add parameters to apr_filter_func type. Those parameters will be something * like: - * (request_rec *r, ap_filter_t *filter, ap_data_list *the_data) + * (request_rec *r, apr_filter_t *filter, ap_data_list *the_data) * obviously, the request_rec is the current request, and the filter * is the current filter stack. The data_list is a bucket list or * bucket_brigade, but I am trying to keep this patch neutral. (If this diff --git a/include/util_md5.h b/include/util_md5.h index e185e3569f..7d2896d3c6 100644 --- a/include/util_md5.h +++ b/include/util_md5.h @@ -65,14 +65,14 @@ extern "C" { #include "apr_md5.h" -API_EXPORT(char *) ap_md5(ap_pool_t *a, const unsigned char *string); -API_EXPORT(char *) ap_md5_binary(ap_pool_t *a, const unsigned char *buf, int len); -API_EXPORT(char *) ap_md5contextTo64(ap_pool_t *p, ap_md5_ctx_t *context); +API_EXPORT(char *) ap_md5(apr_pool_t *a, const unsigned char *string); +API_EXPORT(char *) ap_md5_binary(apr_pool_t *a, const unsigned char *buf, int len); +API_EXPORT(char *) ap_md5contextTo64(apr_pool_t *p, ap_md5_ctx_t *context); #ifdef APACHE_XLATE -API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile, - ap_xlate_t *xlate); +API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile, + apr_xlate_t *xlate); #else -API_EXPORT(char *) ap_md5digest(ap_pool_t *p, ap_file_t *infile); +API_EXPORT(char *) ap_md5digest(apr_pool_t *p, apr_file_t *infile); #endif #ifdef __cplusplus diff --git a/include/util_script.h b/include/util_script.h index b723fe3068..2f24a55e8f 100644 --- a/include/util_script.h +++ b/include/util_script.h @@ -71,17 +71,17 @@ extern "C" { #endif #endif -API_EXPORT(char **) ap_create_environment(ap_pool_t *p, ap_table_t *t); +API_EXPORT(char **) ap_create_environment(apr_pool_t *p, apr_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); -API_EXPORT(int) ap_scan_script_header_err(request_rec *r, ap_file_t *f, char *buffer); +API_EXPORT(int) ap_scan_script_header_err(request_rec *r, apr_file_t *f, char *buffer); API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *f, char *buffer); API_EXPORT(int) ap_scan_script_header_err_core(request_rec *r, char *buffer, int (*getsfunc) (char *, int, void *), void *getsfunc_data); -API_EXPORT(void) ap_send_size(ap_ssize_t size, request_rec *r); +API_EXPORT(void) ap_send_size(apr_ssize_t size, request_rec *r); #ifdef __cplusplus } diff --git a/include/util_uri.h b/include/util_uri.h index 86e1097b16..bf1c63fa35 100644 --- a/include/util_uri.h +++ b/include/util_uri.h @@ -114,12 +114,12 @@ typedef struct { /* 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(ap_pool_t *p, const struct hostent *hp); -API_EXPORT(struct hostent *) ap_pgethostbyname(ap_pool_t *p, const char *hostname); -API_EXPORT(char *) ap_unparse_uri_components(ap_pool_t *p, const uri_components *uptr, +API_EXPORT(struct hostent *) ap_pduphostent(apr_pool_t *p, const struct hostent *hp); +API_EXPORT(struct hostent *) ap_pgethostbyname(apr_pool_t *p, const char *hostname); +API_EXPORT(char *) ap_unparse_uri_components(apr_pool_t *p, const uri_components *uptr, unsigned flags); -API_EXPORT(int) ap_parse_uri_components(ap_pool_t *p, const char *uri, uri_components *uptr); -API_EXPORT(int) ap_parse_hostinfo_components(ap_pool_t *p, const char *hostinfo, uri_components *uptr); +API_EXPORT(int) ap_parse_uri_components(apr_pool_t *p, const char *uri, uri_components *uptr); +API_EXPORT(int) ap_parse_hostinfo_components(apr_pool_t *p, const char *hostinfo, uri_components *uptr); /* called by the core in main() */ API_EXPORT(void) ap_util_uri_init(void); diff --git a/include/util_xml.h b/include/util_xml.h index f7e45d4769..7d302360cc 100644 --- a/include/util_xml.h +++ b/include/util_xml.h @@ -80,7 +80,7 @@ typedef struct ap_text *last; } ap_text_header; -API_EXPORT(void) ap_text_append(ap_pool_t *p, ap_text_header *hdr, +API_EXPORT(void) ap_text_append(apr_pool_t *p, ap_text_header *hdr, const char *text); @@ -186,15 +186,15 @@ typedef struct ap_xml_elem typedef struct ap_xml_doc { ap_xml_elem *root; /* root element */ - ap_array_header_t *namespaces; /* array of namespaces used */ + apr_array_header_t *namespaces; /* array of namespaces used */ } ap_xml_doc; API_EXPORT(int) ap_xml_parse_input(request_rec *r, ap_xml_doc **pdoc); /* Converts an XML element tree to flat text */ -API_EXPORT(void) ap_xml_to_text(ap_pool_t *p, const ap_xml_elem *elem, - int style, ap_array_header_t *namespaces, +API_EXPORT(void) ap_xml_to_text(apr_pool_t *p, const ap_xml_elem *elem, + int style, apr_array_header_t *namespaces, int *ns_map, const char **pbuf, size_t *psize); /* style argument values: */ @@ -203,17 +203,17 @@ API_EXPORT(void) ap_xml_to_text(ap_pool_t *p, const ap_xml_elem *elem, #define AP_XML_X2T_LANG_INNER 2 /* xml:lang + inner contents */ #define AP_XML_X2T_FULL_NS_LANG 3 /* FULL + ns defns + xml:lang */ -API_EXPORT(const char *) ap_xml_empty_elem(ap_pool_t *p, +API_EXPORT(const char *) ap_xml_empty_elem(apr_pool_t *p, const ap_xml_elem *elem); -API_EXPORT(const char *) ap_xml_quote_string(ap_pool_t *p, const char *s, +API_EXPORT(const char *) ap_xml_quote_string(apr_pool_t *p, const char *s, int quotes); -API_EXPORT(void) ap_xml_quote_elem(ap_pool_t *p, ap_xml_elem *elem); +API_EXPORT(void) ap_xml_quote_elem(apr_pool_t *p, ap_xml_elem *elem); /* manage an array of unique URIs: ap_xml_insert_uri() and AP_XML_URI_ITEM() */ /* return the URI's (existing) index, or insert it and return a new index */ -API_EXPORT(int) ap_xml_insert_uri(ap_array_header_t *uri_array, +API_EXPORT(int) ap_xml_insert_uri(apr_array_header_t *uri_array, const char *uri); #define AP_XML_GET_URI_ITEM(ary, i) (((const char * const *)(ary)->elts)[i]) diff --git a/modules/aaa/mod_access.c b/modules/aaa/mod_access.c index 592d9260fa..c299b4ff96 100644 --- a/modules/aaa/mod_access.c +++ b/modules/aaa/mod_access.c @@ -113,22 +113,22 @@ typedef struct { typedef struct { int order[METHODS]; - ap_array_header_t *allows; - ap_array_header_t *denys; + apr_array_header_t *allows; + apr_array_header_t *denys; } access_dir_conf; module MODULE_VAR_EXPORT access_module; -static void *create_access_dir_config(ap_pool_t *p, char *dummy) +static void *create_access_dir_config(apr_pool_t *p, char *dummy) { access_dir_conf *conf = - (access_dir_conf *) ap_pcalloc(p, sizeof(access_dir_conf)); + (access_dir_conf *) apr_pcalloc(p, sizeof(access_dir_conf)); int i; for (i = 0; i < METHODS; ++i) conf->order[i] = DENY_THEN_ALLOW; - conf->allows = ap_make_array(p, 1, sizeof(allowdeny)); - conf->denys = ap_make_array(p, 1, sizeof(allowdeny)); + conf->allows = apr_make_array(p, 1, sizeof(allowdeny)); + conf->denys = apr_make_array(p, 1, sizeof(allowdeny)); return (void *) conf; } @@ -167,12 +167,12 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from, access_dir_conf *d = (access_dir_conf *) dv; allowdeny *a; char *s; - char *where = ap_pstrdup(cmd->pool, where_c); + char *where = apr_pstrdup(cmd->pool, where_c); if (strcasecmp(from, "from")) return "allow and deny must be followed by 'from'"; - a = (allowdeny *) ap_push_array(cmd->info ? d->allows : d->denys); + a = (allowdeny *) apr_push_array(cmd->info ? d->allows : d->denys); a->x.from = where; a->limited = cmd->limited; @@ -311,7 +311,7 @@ static int in_domain(const char *domain, const char *what) return 0; } -static int find_allowdeny(request_rec *r, ap_array_header_t *a, int method) +static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method) { allowdeny *ap = (allowdeny *) a->elts; int mmask = (1 << method); @@ -325,7 +325,7 @@ static int find_allowdeny(request_rec *r, ap_array_header_t *a, int method) switch (ap[i].type) { case T_ENV: - if (ap_table_get(r->subprocess_env, ap[i].x.from)) { + if (apr_table_get(r->subprocess_env, ap[i].x.from)) { return 1; } break; diff --git a/modules/aaa/mod_auth.c b/modules/aaa/mod_auth.c index e09ea87cb3..e2e84aba7c 100644 --- a/modules/aaa/mod_auth.c +++ b/modules/aaa/mod_auth.c @@ -86,10 +86,10 @@ typedef struct auth_config_struct { int auth_authoritative; } auth_config_rec; -static void *create_auth_dir_config(ap_pool_t *p, char *d) +static void *create_auth_dir_config(apr_pool_t *p, char *d) { auth_config_rec *sec = - (auth_config_rec *) ap_pcalloc(p, sizeof(auth_config_rec)); + (auth_config_rec *) apr_pcalloc(p, sizeof(auth_config_rec)); sec->auth_pwfile = NULL; /* just to illustrate the default really */ sec->auth_grpfile = NULL; /* unless you have a broken HP cc */ sec->auth_authoritative = 1; /* keep the fortress secure by default */ @@ -100,7 +100,7 @@ static const char *set_auth_slot(cmd_parms *cmd, void *offset, const char *f, const char *t) { if (t && strcmp(t, "standard")) - return ap_pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); + return apr_pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); return ap_set_file_slot(cmd, offset, f); } @@ -128,7 +128,7 @@ static char *get_pw(request_rec *r, char *user, char *auth_pwfile) configfile_t *f; char l[MAX_STRING_LEN]; const char *rpw, *w; - ap_status_t status; + apr_status_t status; if ((status = ap_pcfg_openfile(&f, r->pool, auth_pwfile)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, @@ -150,14 +150,14 @@ static char *get_pw(request_rec *r, char *user, char *auth_pwfile) return NULL; } -static ap_table_t *groups_for_user(ap_pool_t *p, char *user, char *grpfile) +static apr_table_t *groups_for_user(apr_pool_t *p, char *user, char *grpfile) { configfile_t *f; - ap_table_t *grps = ap_make_table(p, 15); - ap_pool_t *sp; + apr_table_t *grps = apr_make_table(p, 15); + apr_pool_t *sp; char l[MAX_STRING_LEN]; const char *group_name, *ll, *w; - ap_status_t status; + apr_status_t status; if ((status = ap_pcfg_openfile(&f, p, grpfile)) != APR_SUCCESS) { /*add? aplog_error(APLOG_MARK, APLOG_ERR, NULL, @@ -165,26 +165,26 @@ static ap_table_t *groups_for_user(ap_pool_t *p, char *user, char *grpfile) return NULL; } - ap_create_pool(&sp, p); + apr_create_pool(&sp, p); while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { if ((l[0] == '#') || (!l[0])) continue; ll = l; - ap_clear_pool(sp); + apr_clear_pool(sp); group_name = ap_getword(sp, &ll, ':'); while (ll[0]) { w = ap_getword_conf(sp, &ll); if (!strcmp(w, user)) { - ap_table_setn(grps, ap_pstrdup(p, group_name), "in"); + apr_table_setn(grps, apr_pstrdup(p, group_name), "in"); break; } } } ap_cfg_closefile(f); - ap_destroy_pool(sp); + apr_destroy_pool(sp); return grps; } @@ -208,7 +208,7 @@ static int authenticate_basic_user(request_rec *r) (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module); const char *sent_pw; char *real_pw; - ap_status_t invalid_pw; + apr_status_t invalid_pw; int res; if ((res = ap_get_basic_auth_pw(r, &sent_pw))) @@ -225,7 +225,7 @@ static int authenticate_basic_user(request_rec *r) ap_note_basic_auth_failure(r); return HTTP_UNAUTHORIZED; } - invalid_pw = ap_validate_password(sent_pw, real_pw); + invalid_pw = apr_validate_password(sent_pw, real_pw); if (invalid_pw != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, "user %s: authentication failure for \"%s\": " @@ -248,8 +248,8 @@ static int check_user_access(request_rec *r) int method_restricted = 0; register int x; const char *t, *w; - ap_table_t *grpstatus; - const ap_array_header_t *reqs_arr = ap_requires(r); + apr_table_t *grpstatus; + const apr_array_header_t *reqs_arr = ap_requires(r); require_line *reqs; /* BUG FIX: tadc, 11-Nov-1995. If there is no "requires" directive, @@ -288,7 +288,7 @@ static int check_user_access(request_rec *r) while (t[0]) { w = ap_getword_conf(r->pool, &t); - if (ap_table_get(grpstatus, w)) + if (apr_table_get(grpstatus, w)) return OK; } } else if (sec->auth_authoritative) { @@ -331,7 +331,7 @@ module MODULE_VAR_EXPORT auth_module = NULL, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server config */ - auth_cmds, /* command ap_table_t */ + auth_cmds, /* command apr_table_t */ NULL, /* handlers */ register_hooks /* register hooks */ }; diff --git a/modules/aaa/mod_auth_anon.c b/modules/aaa/mod_auth_anon.c index a0397adc56..22af52654e 100644 --- a/modules/aaa/mod_auth_anon.c +++ b/modules/aaa/mod_auth_anon.c @@ -117,10 +117,10 @@ typedef struct { } anon_auth_config_rec; -static void *create_anon_auth_dir_config(ap_pool_t *p, char *d) +static void *create_anon_auth_dir_config(apr_pool_t *p, char *d) { anon_auth_config_rec *sec = (anon_auth_config_rec *) - ap_pcalloc(p, sizeof(anon_auth_config_rec)); + apr_pcalloc(p, sizeof(anon_auth_config_rec)); if (!sec) return NULL; /* no memory... */ @@ -181,7 +181,7 @@ static const char *anon_set_string_slots(cmd_parms *cmd, first = sec->auth_anon_passwords; if ( - (!(sec->auth_anon_passwords = (auth_anon *) ap_palloc(cmd->pool, sizeof(auth_anon)))) || + (!(sec->auth_anon_passwords = (auth_anon *) apr_palloc(cmd->pool, sizeof(auth_anon)))) || (!(sec->auth_anon_passwords->password = arg)) ) return "Failed to claim memory for an anonymous password..."; @@ -302,7 +302,7 @@ module MODULE_VAR_EXPORT auth_anon_module = NULL, /* dir merger ensure strictness */ NULL, /* server config */ NULL, /* merge server config */ - anon_auth_cmds, /* command ap_table_t */ + anon_auth_cmds, /* command apr_table_t */ NULL, /* handlers */ register_hooks /* register hooks */ }; diff --git a/modules/aaa/mod_auth_db.c b/modules/aaa/mod_auth_db.c index d8ff16a07f..1b2f71cb88 100644 --- a/modules/aaa/mod_auth_db.c +++ b/modules/aaa/mod_auth_db.c @@ -119,10 +119,10 @@ typedef struct { int auth_dbauthoritative; } db_auth_config_rec; -static void *create_db_auth_dir_config(ap_pool_t *p, char *d) +static void *create_db_auth_dir_config(apr_pool_t *p, char *d) { db_auth_config_rec *sec - = (db_auth_config_rec *) ap_pcalloc(p, sizeof(db_auth_config_rec)); + = (db_auth_config_rec *) apr_pcalloc(p, sizeof(db_auth_config_rec)); sec->auth_dbpwfile = NULL; sec->auth_dbgrpfile = NULL; sec->auth_dbauthoritative = 1; /* fortress is secure by default */ @@ -242,7 +242,7 @@ static char *get_db_pw(request_rec *r, char *user, const char *auth_dbpwfile) #else if (!((f->get) (f, &q, &d, 0))) { #endif - pw = ap_palloc(r->pool, d.size + 1); + pw = apr_palloc(r->pool, d.size + 1); strncpy(pw, d.data, d.size); pw[d.size] = '\0'; /* Terminate the string */ } @@ -291,7 +291,7 @@ static int db_authenticate_basic_user(request_rec *r) &auth_db_module); const char *sent_pw; char *real_pw, *colon_pw; - ap_status_t invalid_pw; + apr_status_t invalid_pw; int res; if ((res = ap_get_basic_auth_pw(r, &sent_pw))) @@ -317,7 +317,7 @@ static int db_authenticate_basic_user(request_rec *r) *colon_pw = '\0'; } - invalid_pw = ap_validate_password(sent_pw, real_pw); + invalid_pw = apr_validate_password(sent_pw, real_pw); if (invalid_pw != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, @@ -340,7 +340,7 @@ static int db_check_auth(request_rec *r) char *user = r->user; int m = r->method_number; - const ap_array_header_t *reqs_arr = ap_requires(r); + const apr_array_header_t *reqs_arr = ap_requires(r); require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL; register int x; @@ -406,7 +406,7 @@ module auth_db_module = NULL, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server config */ - db_auth_cmds, /* command ap_table_t */ + db_auth_cmds, /* command apr_table_t */ NULL, /* handlers */ register_hooks /* register hooks */ }; diff --git a/modules/aaa/mod_auth_dbm.c b/modules/aaa/mod_auth_dbm.c index 215bde71c3..253b7e3bc6 100644 --- a/modules/aaa/mod_auth_dbm.c +++ b/modules/aaa/mod_auth_dbm.c @@ -105,10 +105,10 @@ typedef struct { } dbm_auth_config_rec; -static void *create_dbm_auth_dir_config(ap_pool_t *p, char *d) +static void *create_dbm_auth_dir_config(apr_pool_t *p, char *d) { dbm_auth_config_rec *sec - = (dbm_auth_config_rec *) ap_pcalloc(p, sizeof(dbm_auth_config_rec)); + = (dbm_auth_config_rec *) apr_pcalloc(p, sizeof(dbm_auth_config_rec)); sec->auth_dbmpwfile = NULL; sec->auth_dbmgrpfile = NULL; @@ -170,7 +170,7 @@ static char *get_dbm_pw(request_rec *r, char *user, char *auth_dbmpwfile) d = dbm_fetch(f, q); if (d.dptr) { - pw = ap_palloc(r->pool, d.dsize + 1); + pw = apr_palloc(r->pool, d.dsize + 1); strncpy(pw, d.dptr, d.dsize); pw[d.dsize] = '\0'; /* Terminate the string */ } @@ -215,7 +215,7 @@ static int dbm_authenticate_basic_user(request_rec *r) &auth_dbm_module); const char *sent_pw; char *real_pw, *colon_pw; - ap_status_t invalid_pw; + apr_status_t invalid_pw; int res; if ((res = ap_get_basic_auth_pw(r, &sent_pw))) @@ -237,7 +237,7 @@ static int dbm_authenticate_basic_user(request_rec *r) if (colon_pw) { *colon_pw = '\0'; } - invalid_pw = ap_validate_password(sent_pw, real_pw); + invalid_pw = apr_validate_password(sent_pw, real_pw); if (invalid_pw != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r, "DBM user %s: authentication failure for \"%s\": " @@ -259,7 +259,7 @@ static int dbm_check_auth(request_rec *r) char *user = r->user; int m = r->method_number; - const ap_array_header_t *reqs_arr = ap_requires(r); + const apr_array_header_t *reqs_arr = ap_requires(r); require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL; register int x; @@ -326,7 +326,7 @@ module auth_dbm_module = NULL, /* dir merger --- default is to override */ NULL, /* server config */ NULL, /* merge server config */ - dbm_auth_cmds, /* command ap_table_t */ + dbm_auth_cmds, /* command apr_table_t */ NULL, /* handlers */ register_hooks /* register hooks */ }; diff --git a/modules/aaa/mod_auth_digest.c b/modules/aaa/mod_auth_digest.c index ca7d31017b..f261ec9e94 100644 --- a/modules/aaa/mod_auth_digest.c +++ b/modules/aaa/mod_auth_digest.c @@ -121,34 +121,34 @@ #include "apr_shmem.h" #else /* just provide dummies - the code does run-time checks anyway */ -typedef void ap_shmem_t; -typedef void ap_shm_name_t; +typedef void apr_shmem_t; +typedef void apr_shm_name_t; -ap_status_t ap_shm_init(ap_shmem_t **m, ap_size_t reqsize, const char *file, ap_pool_t *cont) { +apr_status_t apr_shm_init(apr_shmem_t **m, apr_size_t reqsize, const char *file, apr_pool_t *cont) { return APR_ENOTIMPL; } -ap_status_t ap_shm_destroy(ap_shmem_t *m) { +apr_status_t apr_shm_destroy(apr_shmem_t *m) { return APR_ENOTIMPL; } -void *ap_shm_malloc(ap_shmem_t *c, ap_size_t reqsize) { +void *apr_shm_malloc(apr_shmem_t *c, apr_size_t reqsize) { return NULL; } -void *ap_shm_calloc(ap_shmem_t *shared, ap_size_t size) { +void *apr_shm_calloc(apr_shmem_t *shared, apr_size_t size) { return NULL; } -ap_status_t ap_shm_free(ap_shmem_t *shared, void *free) { +apr_status_t apr_shm_free(apr_shmem_t *shared, void *free) { return APR_ENOTIMPL; } -ap_status_t ap_get_shm_name(ap_shmem_t *c, ap_shm_name_t **name) { +apr_status_t apr_get_shm_name(apr_shmem_t *c, apr_shm_name_t **name) { return APR_ENOTIMPL; } -ap_status_t ap_set_shm_name(ap_shmem_t *c, ap_shm_name_t *name) { +apr_status_t apr_set_shm_name(apr_shmem_t *c, apr_shm_name_t *name) { return APR_ENOTIMPL; } -ap_status_t ap_open_shmem(ap_shmem_t *c) { +apr_status_t apr_open_shmem(apr_shmem_t *c) { return APR_ENOTIMPL; } -ap_status_t ap_shm_avail(ap_shmem_t *c, ap_size_t *avail) { +apr_status_t apr_shm_avail(apr_shmem_t *c, apr_size_t *avail) { return APR_ENOTIMPL; } #endif @@ -163,7 +163,7 @@ typedef struct digest_config_struct { const char *realm; const char **qop_list; AP_SHA1_CTX nonce_ctx; - ap_time_t nonce_lifetime; + apr_time_t nonce_lifetime; const char *nonce_format; int check_nc; const char *algorithm; @@ -178,7 +178,7 @@ typedef struct digest_config_struct { #define NEXTNONCE_DELTA (30*AP_USEC_PER_SEC) -#define NONCE_TIME_LEN (((sizeof(ap_time_t)+2)/3)*4) +#define NONCE_TIME_LEN (((sizeof(apr_time_t)+2)/3)*4) #define NONCE_HASH_LEN (2*SHA_DIGESTSIZE) #define NONCE_LEN (NONCE_TIME_LEN + NONCE_HASH_LEN) @@ -223,7 +223,7 @@ typedef struct digest_header_struct { const char *message_qop; const char *nonce_count; /* the following fields are not (directly) from the header */ - ap_time_t nonce_time; + apr_time_t nonce_time; enum hdr_sts auth_hdr_sts; const char *raw_request_uri; uri_components *psd_request_uri; @@ -235,8 +235,8 @@ typedef struct digest_header_struct { /* (mostly) nonce stuff */ typedef union time_union { - ap_time_t time; - unsigned char arr[sizeof(ap_time_t)]; + apr_time_t time; + unsigned char arr[sizeof(apr_time_t)]; } time_rec; @@ -246,11 +246,11 @@ static int call_cnt = 0; /* client-list, opaque, and one-time-nonce stuff */ -static ap_shmem_t *client_shm = NULL; +static apr_shmem_t *client_shm = NULL; static unsigned long *opaque_cntr; -static ap_time_t *otn_counter; /* one-time-nonce counter */ -static ap_lock_t *client_lock = NULL; -static ap_lock_t *opaque_lock = NULL; +static apr_time_t *otn_counter; /* one-time-nonce counter */ +static apr_lock_t *client_lock = NULL; +static apr_lock_t *opaque_lock = NULL; static char client_lock_name[L_tmpnam]; static char opaque_lock_name[L_tmpnam]; @@ -268,24 +268,24 @@ module MODULE_VAR_EXPORT auth_digest_module; * initialization code */ -static ap_status_t cleanup_tables(void *not_used) +static apr_status_t cleanup_tables(void *not_used) { ap_log_rerror(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Digest: cleaning up shared memory"); fflush(stderr); if (client_shm) { - ap_shm_destroy(client_shm); + apr_shm_destroy(client_shm); client_shm = NULL; } if (client_lock) { - ap_destroy_lock(client_lock); + apr_destroy_lock(client_lock); client_lock = NULL; } if (opaque_lock) { - ap_destroy_lock(opaque_lock); + apr_destroy_lock(opaque_lock); opaque_lock = NULL; } @@ -294,26 +294,26 @@ static ap_status_t cleanup_tables(void *not_used) static void initialize_secret(server_rec *s) { - ap_status_t status; + apr_status_t status; ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, s, "Digest: generating secret for digest authentication ..."); /* TODO - make sure this func works (compiles?) on win32 */ - status = ap_generate_random_bytes(secret, sizeof(secret)); + status = apr_generate_random_bytes(secret, sizeof(secret)); if(!(status == APR_SUCCESS)) { char buf[120]; ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, 0, s, "Digest: error generating secret: %s", - ap_strerror(status, buf, sizeof(buf))); + apr_strerror(status, buf, sizeof(buf))); exit(1); } ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, 0, s, "Digest: done"); } -static void log_error_and_cleanup(char *msg, ap_status_t sts, server_rec *s) +static void log_error_and_cleanup(char *msg, apr_status_t sts, server_rec *s) { ap_log_error(APLOG_MARK, APLOG_ERR, sts, s, "Digest: %s - all nonce-count checking, one-time nonces, and " @@ -322,20 +322,20 @@ static void log_error_and_cleanup(char *msg, ap_status_t sts, server_rec *s) cleanup_tables(NULL); } -static void initialize_tables(server_rec *s, ap_pool_t *ctx) +static void initialize_tables(server_rec *s, apr_pool_t *ctx) { unsigned long idx; - ap_status_t sts; + apr_status_t sts; /* set up client list */ - sts = ap_shm_init(&client_shm, shmem_size, tmpnam(NULL), ctx); + sts = apr_shm_init(&client_shm, shmem_size, tmpnam(NULL), ctx); if (sts != APR_SUCCESS) { log_error_and_cleanup("failed to create shared memory segments", sts, s); return; } - client_list = ap_shm_malloc(client_shm, sizeof(*client_list) + + client_list = apr_shm_malloc(client_shm, sizeof(*client_list) + sizeof(client_entry*)*num_buckets); if (!client_list) { log_error_and_cleanup("failed to allocate shared memory", -1, s); @@ -348,7 +348,7 @@ static void initialize_tables(server_rec *s, ap_pool_t *ctx) client_list->num_entries = 0; tmpnam(client_lock_name); - sts = ap_create_lock(&client_lock, APR_READWRITE, APR_LOCKALL, + sts = apr_create_lock(&client_lock, APR_READWRITE, APR_LOCKALL, client_lock_name, ctx); if (sts != APR_SUCCESS) { log_error_and_cleanup("failed to create lock", sts, s); @@ -358,7 +358,7 @@ static void initialize_tables(server_rec *s, ap_pool_t *ctx) /* setup opaque */ - opaque_cntr = ap_shm_malloc(client_shm, sizeof(*opaque_cntr)); + opaque_cntr = apr_shm_malloc(client_shm, sizeof(*opaque_cntr)); if (opaque_cntr == NULL) { log_error_and_cleanup("failed to allocate shared memory", -1, s); return; @@ -366,7 +366,7 @@ static void initialize_tables(server_rec *s, ap_pool_t *ctx) *opaque_cntr = 1UL; tmpnam(opaque_lock_name); - sts = ap_create_lock(&opaque_lock, APR_MUTEX, APR_LOCKALL, + sts = apr_create_lock(&opaque_lock, APR_MUTEX, APR_LOCKALL, opaque_lock_name, ctx); if (sts != APR_SUCCESS) { log_error_and_cleanup("failed to create lock", sts, s); @@ -376,7 +376,7 @@ static void initialize_tables(server_rec *s, ap_pool_t *ctx) /* setup one-time-nonce counter */ - otn_counter = ap_shm_malloc(client_shm, sizeof(*otn_counter)); + otn_counter = apr_shm_malloc(client_shm, sizeof(*otn_counter)); if (otn_counter == NULL) { log_error_and_cleanup("failed to allocate shared memory", -1, s); return; @@ -389,8 +389,8 @@ static void initialize_tables(server_rec *s, ap_pool_t *ctx) return; } -static void initialize_module(ap_pool_t *p, ap_pool_t *plog, - ap_pool_t *ptemp, server_rec *s) +static void initialize_module(apr_pool_t *p, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) { /* keep from doing the init more than once at startup, and delay * the init until the second round @@ -411,26 +411,26 @@ static void initialize_module(ap_pool_t *p, ap_pool_t *plog, * configuration changes are ignored, and B) certain optimizations, * such as only allocating the smallest necessary entry for each * client, can't be done. However, the alternative is a nightmare: - * we can't call ap_shm_destroy on a graceful restart because there + * we can't call apr_shm_destroy on a graceful restart because there * will be children using the tables, and we also don't know when the * last child dies. Therefore we can never clean up the old stuff, * creating a creeping memory leak. */ initialize_tables(s, p); - ap_register_cleanup(p, NULL, cleanup_tables, ap_null_cleanup); + apr_register_cleanup(p, NULL, cleanup_tables, apr_null_cleanup); #endif /* APR_HAS_SHARED_MEMORY */ } -static void initialize_child(ap_pool_t *p, server_rec *s) +static void initialize_child(apr_pool_t *p, server_rec *s) { - ap_status_t sts; + apr_status_t sts; if (!client_shm) return; - if ((sts = ap_child_init_lock(&client_lock, client_lock_name, p)) + if ((sts = apr_child_init_lock(&client_lock, client_lock_name, p)) != APR_SUCCESS - || (sts = ap_child_init_lock(&opaque_lock, opaque_lock_name, p)) + || (sts = apr_child_init_lock(&opaque_lock, opaque_lock_name, p)) != APR_SUCCESS) { log_error_and_cleanup("failed to create lock", sts, s); return; @@ -441,18 +441,18 @@ static void initialize_child(ap_pool_t *p, server_rec *s) * configuration code */ -static void *create_digest_dir_config(ap_pool_t *p, char *dir) +static void *create_digest_dir_config(apr_pool_t *p, char *dir) { digest_config_rec *conf; if (dir == NULL) return NULL; - conf = (digest_config_rec *) ap_pcalloc(p, sizeof(digest_config_rec)); + conf = (digest_config_rec *) apr_pcalloc(p, sizeof(digest_config_rec)); if (conf) { - conf->qop_list = ap_palloc(p, sizeof(char*)); + conf->qop_list = apr_palloc(p, sizeof(char*)); conf->qop_list[0] = NULL; conf->nonce_lifetime = DFLT_NONCE_LIFE; - conf->dir_name = ap_pstrdup(p, dir); + conf->dir_name = apr_pstrdup(p, dir); conf->algorithm = DFLT_ALGORITHM; } @@ -504,7 +504,7 @@ static const char *set_qop(cmd_parms *cmd, void *config, const char *op) if (!strcasecmp(op, "none")) { if (conf->qop_list[0] == NULL) { - conf->qop_list = ap_palloc(cmd->pool, 2 * sizeof(char*)); + conf->qop_list = apr_palloc(cmd->pool, 2 * sizeof(char*)); conf->qop_list[1] = NULL; } conf->qop_list[0] = "none"; @@ -516,13 +516,13 @@ static const char *set_qop(cmd_parms *cmd, void *config, const char *op) "Digest: WARNING: qop `auth-int' currently only works " "correctly for responses with no entity"); else if (strcasecmp(op, "auth")) - return ap_pstrcat(cmd->pool, "Unrecognized qop: ", op, NULL); + return apr_pstrcat(cmd->pool, "Unrecognized qop: ", op, NULL); for (cnt=0; conf->qop_list[cnt] != NULL; cnt++) ; - tmp = ap_palloc(cmd->pool, (cnt+2)*sizeof(char*)); + tmp = apr_palloc(cmd->pool, (cnt+2)*sizeof(char*)); memcpy(tmp, conf->qop_list, cnt*sizeof(char*)); - tmp[cnt] = ap_pstrdup(cmd->pool, op); + tmp[cnt] = apr_pstrdup(cmd->pool, op); tmp[cnt+1] = NULL; conf->qop_list = tmp; @@ -537,7 +537,7 @@ static const char *set_nonce_lifetime(cmd_parms *cmd, void *config, lifetime = strtol(t, &endptr, 10); if (endptr < (t+strlen(t)) && !ap_isspace(*endptr)) - return ap_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", t, NULL); + return apr_pstrcat(cmd->pool, "Invalid time in AuthDigestNonceLifetime: ", t, NULL); ((digest_config_rec *) config)->nonce_lifetime = lifetime * AP_USEC_PER_SEC; return NULL; @@ -574,7 +574,7 @@ static const char *set_algorithm(cmd_parms *cmd, void *config, const char *alg) } } else if (strcasecmp(alg, "MD5")) - return ap_pstrcat(cmd->pool, "Invalid algorithm in AuthDigestAlgorithm: ", alg, NULL); + return apr_pstrcat(cmd->pool, "Invalid algorithm in AuthDigestAlgorithm: ", alg, NULL); ((digest_config_rec *) config)->algorithm = alg; return NULL; @@ -585,10 +585,10 @@ static const char *set_uri_list(cmd_parms *cmd, void *config, const char *uri) digest_config_rec *c = (digest_config_rec *) config; if (c->uri_list) { c->uri_list[strlen(c->uri_list)-1] = '\0'; - c->uri_list = ap_pstrcat(cmd->pool, c->uri_list, " ", uri, "\"", NULL); + c->uri_list = apr_pstrcat(cmd->pool, c->uri_list, " ", uri, "\"", NULL); } else - c->uri_list = ap_pstrcat(cmd->pool, ", domain=\"", uri, "\"", NULL); + c->uri_list = apr_pstrcat(cmd->pool, ", domain=\"", uri, "\"", NULL); return NULL; } @@ -607,12 +607,12 @@ static const char *set_shmem_size(cmd_parms *cmd, void *config, else if (*endptr == 'm' || *endptr == 'M') size *= 1048576; else - return ap_pstrcat(cmd->pool, "Invalid size in AuthDigestShmemSize: ", + return apr_pstrcat(cmd->pool, "Invalid size in AuthDigestShmemSize: ", size_str, NULL); min = sizeof(*client_list) + sizeof(client_entry*) + sizeof(client_entry); if (size < min) - return ap_psprintf(cmd->pool, "size in AuthDigestShmemSize too small: " + return apr_psprintf(cmd->pool, "size in AuthDigestShmemSize too small: " "%ld < %ld", size, min, NULL); shmem_size = size; @@ -720,7 +720,7 @@ static client_entry *get_client(unsigned long key, const request_rec *r) bucket = key % client_list->tbl_len; entry = client_list->table[bucket]; - ap_lock(client_lock /*, MM_LOCK_RD */); + apr_lock(client_lock /*, MM_LOCK_RD */); while(entry && key != entry->key) { prev = entry; @@ -733,7 +733,7 @@ static client_entry *get_client(unsigned long key, const request_rec *r) client_list->table[bucket] = entry; } - ap_unlock(client_lock); + apr_unlock(client_lock); if (entry) ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r, @@ -767,7 +767,7 @@ static long gc(void) if (prev) prev->next = NULL; /* cut list */ else client_list->table[idx] = NULL; if (entry) { /* remove entry */ - ap_shm_free(client_shm, entry); + apr_shm_free(client_shm, entry); num_removed++; } } @@ -797,11 +797,11 @@ static client_entry *add_client(unsigned long key, client_entry *info, bucket = key % client_list->tbl_len; entry = client_list->table[bucket]; - ap_lock(client_lock /*, MM_LOCK_RW */); + apr_lock(client_lock /*, MM_LOCK_RW */); /* try to allocate a new entry */ - entry = ap_shm_malloc(client_shm, sizeof(client_entry)); + entry = apr_shm_malloc(client_shm, sizeof(client_entry)); if (!entry) { long num_removed = gc(); ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, 0, s, @@ -810,7 +810,7 @@ static client_entry *add_client(unsigned long key, client_entry *info, "%ld", num_removed, client_list->num_created - client_list->num_renewed, client_list->num_removed, client_list->num_renewed); - entry = ap_shm_malloc(client_shm, sizeof(client_entry)); + entry = apr_shm_malloc(client_shm, sizeof(client_entry)); if (!entry) return NULL; /* give up */ } @@ -823,7 +823,7 @@ static client_entry *add_client(unsigned long key, client_entry *info, client_list->num_created++; client_list->num_entries++; - ap_unlock(client_lock); + apr_unlock(client_lock); ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, s, "allocated new client %lu", key); @@ -844,7 +844,7 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp) int vk = 0, vv = 0; char *key, *value; - auth_line = ap_table_get(r->headers_in, + auth_line = apr_table_get(r->headers_in, r->proxyreq ? "Proxy-Authorization" : "Authorization"); if (!auth_line) { @@ -860,8 +860,8 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp) l = strlen(auth_line); - key = ap_palloc(r->pool, l+1); - value = ap_palloc(r->pool, l+1); + key = apr_palloc(r->pool, l+1); + value = apr_palloc(r->pool, l+1); while (auth_line[0] != '\0') { @@ -903,25 +903,25 @@ static int get_digest_rec(request_rec *r, digest_header_rec *resp) if (auth_line[0] != '\0') auth_line++; if (!strcasecmp(key, "username")) - resp->username = ap_pstrdup(r->pool, value); + resp->username = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "realm")) - resp->realm = ap_pstrdup(r->pool, value); + resp->realm = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "nonce")) - resp->nonce = ap_pstrdup(r->pool, value); + resp->nonce = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "uri")) - resp->uri = ap_pstrdup(r->pool, value); + resp->uri = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "response")) - resp->digest = ap_pstrdup(r->pool, value); + resp->digest = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "algorithm")) - resp->algorithm = ap_pstrdup(r->pool, value); + resp->algorithm = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "cnonce")) - resp->cnonce = ap_pstrdup(r->pool, value); + resp->cnonce = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "opaque")) - resp->opaque = ap_pstrdup(r->pool, value); + resp->opaque = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "qop")) - resp->message_qop = ap_pstrdup(r->pool, value); + resp->message_qop = apr_pstrdup(r->pool, value); else if (!strcasecmp(key, "nc")) - resp->nonce_count = ap_pstrdup(r->pool, value); + resp->nonce_count = apr_pstrdup(r->pool, value); } if (!resp->username || !resp->realm || !resp->nonce || !resp->uri @@ -958,7 +958,7 @@ static int parse_hdr_and_update_nc(request_rec *r) if (!ap_is_initial_req(r)) return DECLINED; - resp = ap_pcalloc(r->pool, sizeof(digest_header_rec)); + resp = apr_pcalloc(r->pool, sizeof(digest_header_rec)); resp->raw_request_uri = r->unparsed_uri; resp->psd_request_uri = &r->parsed_uri; resp->needed_auth = 0; @@ -1013,11 +1013,11 @@ static void gen_nonce_hash(char *hash, const char *timestr, const char *opaque, /* The nonce has the format b64(time)+hash . */ -static const char *gen_nonce(ap_pool_t *p, ap_time_t now, const char *opaque, +static const char *gen_nonce(apr_pool_t *p, apr_time_t now, const char *opaque, const server_rec *server, const digest_config_rec *conf) { - char *nonce = ap_palloc(p, NONCE_LEN+1); + char *nonce = apr_palloc(p, NONCE_LEN+1); int len; time_rec t; @@ -1052,9 +1052,9 @@ static client_entry *gen_client(const request_rec *r) if (!opaque_cntr) return NULL; - ap_lock(opaque_lock /*, MM_LOCK_RW */); + apr_lock(opaque_lock /*, MM_LOCK_RW */); op = (*opaque_cntr)++; - ap_unlock(opaque_lock); + apr_unlock(opaque_lock); if (!(entry = add_client(op, &new_entry, r->server))) { ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, @@ -1081,9 +1081,9 @@ static client_entry *gen_client(const request_rec *r) * generated and is expected to return the equivalent of * * h_urp = ap_md5(r->pool, - * ap_pstrcat(r->pool, username, ":", ap_auth_name(r), ":", passwd)) + * apr_pstrcat(r->pool, username, ":", ap_auth_name(r), ":", passwd)) * ap_md5(r->pool, - * (unsigned char *) ap_pstrcat(r->pool, h_urp, ":", resp->nonce, ":", + * (unsigned char *) apr_pstrcat(r->pool, h_urp, ":", resp->nonce, ":", * resp->cnonce, NULL)); * * or put differently, it must return @@ -1105,7 +1105,7 @@ static const char *get_userpw_hash(const request_rec *r, const digest_config_rec *conf) { return ap_md5(r->pool, - (unsigned char *) ap_pstrcat(r->pool, conf->ha1, ":", resp->nonce, + (unsigned char *) apr_pstrcat(r->pool, conf->ha1, ":", resp->nonce, ":", resp->cnonce, NULL)); } @@ -1153,7 +1153,7 @@ static void clear_session(const digest_header_rec *resp) * Authorization challenge generation code (for WWW-Authenticate) */ -static const char *guess_domain(ap_pool_t *p, const char *uri, +static const char *guess_domain(apr_pool_t *p, const char *uri, const char *filename, const char *dir) { size_t u_len = strlen(uri), f_len = strlen(filename), d_len = strlen(dir); @@ -1209,7 +1209,7 @@ static const char *guess_domain(ap_pool_t *p, const char *uri, * take the uri with the same reach. */ if ((unsigned long) (f-filename) < d_len) { - char *tmp = ap_pstrdup(p, uri); + char *tmp = apr_pstrdup(p, uri); tmp[(u-uri)+(d_len-(f-filename))] = '\0'; return tmp; } @@ -1218,10 +1218,10 @@ static const char *guess_domain(ap_pool_t *p, const char *uri, } -static const char *ltox(ap_pool_t *p, unsigned long num) +static const char *ltox(apr_pool_t *p, unsigned long num) { if (num != 0) - return ap_psprintf(p, "%lx", num); + return apr_psprintf(p, "%lx", num); else return ""; } @@ -1240,10 +1240,10 @@ static void note_digest_auth_failure(request_rec *r, } else if (!strcasecmp(conf->qop_list[0], "none")) { qop = ""; } else { - qop = ap_pstrcat(r->pool, ", qop=\"", conf->qop_list[0], NULL); + qop = apr_pstrcat(r->pool, ", qop=\"", conf->qop_list[0], NULL); for (cnt=1; conf->qop_list[cnt] != NULL; cnt++) - qop = ap_pstrcat(r->pool, qop, ",", conf->qop_list[cnt], NULL); - qop = ap_pstrcat(r->pool, qop, "\"", NULL); + qop = apr_pstrcat(r->pool, qop, ",", conf->qop_list[cnt], NULL); + qop = apr_pstrcat(r->pool, qop, "\"", NULL); } /* Setup opaque */ @@ -1275,7 +1275,7 @@ static void note_digest_auth_failure(request_rec *r, } if (opaque[0]) - opaque_param = ap_pstrcat(r->pool, ", opaque=\"", opaque, "\"", NULL); + opaque_param = apr_pstrcat(r->pool, ", opaque=\"", opaque, "\"", NULL); else opaque_param = NULL; @@ -1309,12 +1309,12 @@ static void note_digest_auth_failure(request_rec *r, if (domain[0] == '/' && domain[1] == '\0') domain = NULL; /* "/" is the default, so no need to send it */ else - domain = ap_pstrcat(r->pool, ", domain=\"", domain, "\"", NULL); + domain = apr_pstrcat(r->pool, ", domain=\"", domain, "\"", NULL); } - ap_table_mergen(r->err_headers_out, + apr_table_mergen(r->err_headers_out, r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", - ap_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%s\", " + apr_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%s\", " "algorithm=%s%s%s%s%s", ap_auth_name(r), nonce, conf->algorithm, opaque_param ? opaque_param : "", @@ -1335,7 +1335,7 @@ static const char *get_hash(request_rec *r, const char *user, char l[MAX_STRING_LEN]; const char *rpw; char *w, *x; - ap_status_t sts; + apr_status_t sts; if ((sts = ap_pcfg_openfile(&f, r->pool, auth_pwfile)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, @@ -1351,7 +1351,7 @@ static const char *get_hash(request_rec *r, const char *user, if (x && w && !strcmp(user, w) && !strcmp(realm, x)) { ap_cfg_closefile(f); - return ap_pstrdup(r->pool, rpw); + return apr_pstrdup(r->pool, rpw); } } ap_cfg_closefile(f); @@ -1461,10 +1461,10 @@ static const char *old_digest(const request_rec *r, { const char *ha2; - ha2 = ap_md5(r->pool, (unsigned char *)ap_pstrcat(r->pool, r->method, ":", + ha2 = ap_md5(r->pool, (unsigned char *)apr_pstrcat(r->pool, r->method, ":", resp->uri, NULL)); return ap_md5(r->pool, - (unsigned char *)ap_pstrcat(r->pool, ha1, ":", resp->nonce, + (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce, ":", ha2, NULL)); } @@ -1484,14 +1484,14 @@ static const char *new_digest(const request_rec *r, ha1 = conf->ha1; if (resp->message_qop && !strcasecmp(resp->message_qop, "auth-int")) - a2 = ap_pstrcat(r->pool, r->method, ":", resp->uri, ":", + a2 = apr_pstrcat(r->pool, r->method, ":", resp->uri, ":", ap_md5(r->pool, (const unsigned char*) ""), NULL); /* TBD */ else - a2 = ap_pstrcat(r->pool, r->method, ":", resp->uri, NULL); + a2 = apr_pstrcat(r->pool, r->method, ":", resp->uri, NULL); ha2 = ap_md5(r->pool, (const unsigned char *)a2); return ap_md5(r->pool, - (unsigned char *)ap_pstrcat(r->pool, ha1, ":", resp->nonce, + (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce, ":", resp->nonce_count, ":", resp->cnonce, ":", resp->message_qop, ":", ha2, @@ -1507,7 +1507,7 @@ static void copy_uri_components(uri_components *dst, uri_components *src, dst->scheme = (char *) "http"; if (src->hostname && src->hostname[0] != '\0') { - dst->hostname = ap_pstrdup(r->pool, src->hostname); + dst->hostname = apr_pstrdup(r->pool, src->hostname); ap_unescape_url(dst->hostname); } else @@ -1519,14 +1519,14 @@ static void copy_uri_components(uri_components *dst, uri_components *src, dst->port = ap_get_server_port(r); if (src->path && src->path[0] != '\0') { - dst->path = ap_pstrdup(r->pool, src->path); + dst->path = apr_pstrdup(r->pool, src->path); ap_unescape_url(dst->path); } else dst->path = src->path; if (src->query && src->query[0] != '\0') { - dst->query = ap_pstrdup(r->pool, src->query); + dst->query = apr_pstrdup(r->pool, src->query); ap_unescape_url(dst->query); } else @@ -1763,15 +1763,15 @@ static int authenticate_digest_user(request_rec *r) * Checking ID */ -static ap_table_t *groups_for_user(request_rec *r, const char *user, +static apr_table_t *groups_for_user(request_rec *r, const char *user, const char *grpfile) { configfile_t *f; - ap_table_t *grps = ap_make_table(r->pool, 15); - ap_pool_t *sp; + apr_table_t *grps = apr_make_table(r->pool, 15); + apr_pool_t *sp; char l[MAX_STRING_LEN]; const char *group_name, *ll, *w; - ap_status_t sts; + apr_status_t sts; if ((sts = ap_pcfg_openfile(&f, r->pool, grpfile)) != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, errno, r, @@ -1779,28 +1779,28 @@ static ap_table_t *groups_for_user(request_rec *r, const char *user, return NULL; } - if (ap_create_pool(&sp, r->pool) != APR_SUCCESS) + if (apr_create_pool(&sp, r->pool) != APR_SUCCESS) return NULL; while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { if ((l[0] == '#') || (!l[0])) continue; ll = l; - ap_clear_pool(sp); + apr_clear_pool(sp); group_name = ap_getword(sp, &ll, ':'); while (ll[0]) { w = ap_getword_conf(sp, &ll); if (!strcmp(w, user)) { - ap_table_setn(grps, ap_pstrdup(r->pool, group_name), "in"); + apr_table_setn(grps, apr_pstrdup(r->pool, group_name), "in"); break; } } } ap_cfg_closefile(f); - ap_destroy_pool(sp); + apr_destroy_pool(sp); return grps; } @@ -1815,8 +1815,8 @@ static int digest_check_auth(request_rec *r) int method_restricted = 0; register int x; const char *t, *w; - ap_table_t *grpstatus; - const ap_array_header_t *reqs_arr; + apr_table_t *grpstatus; + const apr_array_header_t *reqs_arr; require_line *reqs; if (!(t = ap_auth_type(r)) || strcasecmp(t, "Digest")) @@ -1858,7 +1858,7 @@ static int digest_check_auth(request_rec *r) while (t[0]) { w = ap_getword_conf(r->pool, &t); - if (ap_table_get(grpstatus, w)) + if (apr_table_get(grpstatus, w)) return OK; } } @@ -1890,9 +1890,9 @@ static int digest_check_auth(request_rec *r) */ #ifdef SEND_DIGEST -static const char *hdr(const ap_table_t *tbl, const char *name) +static const char *hdr(const apr_table_t *tbl, const char *name) { - const char *val = ap_table_get(tbl, name); + const char *val = apr_table_get(tbl, name); if (val) return val; else @@ -1929,22 +1929,22 @@ static int add_auth_info(request_rec *r) * calc the entity hash) it's best to just leave this #def'd out. */ char date[AP_RFC822_DATE_LEN]; - ap_rfc822_date(date, r->request_time); + apr_rfc822_date(date, r->request_time); char *entity_info = ap_md5(r->pool, - (unsigned char *) ap_pstrcat(r->pool, resp->raw_request_uri, + (unsigned char *) apr_pstrcat(r->pool, resp->raw_request_uri, ":", r->content_type ? r->content_type : ap_default_type(r), ":", hdr(r->headers_out, "Content-Length"), ":", r->content_encoding ? r->content_encoding : "", ":", hdr(r->headers_out, "Last-Modified"), ":", - r->no_cache && !ap_table_get(r->headers_out, "Expires") ? + r->no_cache && !apr_table_get(r->headers_out, "Expires") ? date : hdr(r->headers_out, "Expires"), NULL)); digest = ap_md5(r->pool, - (unsigned char *)ap_pstrcat(r->pool, conf->ha1, ":", + (unsigned char *)apr_pstrcat(r->pool, conf->ha1, ":", resp->nonce, ":", r->method, ":", date, ":", @@ -1960,7 +1960,7 @@ static int add_auth_info(request_rec *r) if (conf->nonce_lifetime > 0) { /* send nextnonce if current nonce will expire in less than 30 secs */ if ((r->request_time - resp->nonce_time) > (conf->nonce_lifetime-NEXTNONCE_DELTA)) { - nextnonce = ap_pstrcat(r->pool, ", nextnonce=\"", + nextnonce = apr_pstrcat(r->pool, ", nextnonce=\"", gen_nonce(r->pool, r->request_time, resp->opaque, r->server, conf), "\"", NULL); @@ -1971,7 +1971,7 @@ static int add_auth_info(request_rec *r) else if (conf->nonce_lifetime == 0 && resp->client) { const char *nonce = gen_nonce(r->pool, 0, resp->opaque, r->server, conf); - nextnonce = ap_pstrcat(r->pool, ", nextnonce=\"", nonce, "\"", NULL); + nextnonce = apr_pstrcat(r->pool, ", nextnonce=\"", nonce, "\"", NULL); memcpy(resp->client->last_nonce, nonce, NONCE_LEN+1); } /* else nonce never expires, hence no nextnonce */ @@ -1983,7 +1983,7 @@ static int add_auth_info(request_rec *r) && resp->message_qop == NULL) { /* use only RFC-2069 format */ if (digest) - ai = ap_pstrcat(r->pool, "digest=\"", digest, "\"", nextnonce,NULL); + ai = apr_pstrcat(r->pool, "digest=\"", digest, "\"", nextnonce,NULL); else ai = nextnonce; } @@ -2005,14 +2005,14 @@ static int add_auth_info(request_rec *r) ha1 = conf->ha1; if (resp->message_qop && !strcasecmp(resp->message_qop, "auth-int")) - a2 = ap_pstrcat(r->pool, ":", resp->uri, ":", + a2 = apr_pstrcat(r->pool, ":", resp->uri, ":", ap_md5(r->pool, (const unsigned char *) ""), NULL); /* TBD */ else - a2 = ap_pstrcat(r->pool, ":", resp->uri, NULL); + a2 = apr_pstrcat(r->pool, ":", resp->uri, NULL); ha2 = ap_md5(r->pool, (const unsigned char *)a2); resp_dig = ap_md5(r->pool, - (unsigned char *)ap_pstrcat(r->pool, ha1, ":", + (unsigned char *)apr_pstrcat(r->pool, ha1, ":", resp->nonce, ":", resp->nonce_count, ":", resp->cnonce, ":", @@ -2022,7 +2022,7 @@ static int add_auth_info(request_rec *r) /* assemble Authentication-Info header */ - ai = ap_pstrcat(r->pool, + ai = apr_pstrcat(r->pool, "rspauth=\"", resp_dig, "\"", nextnonce, resp->cnonce ? ", cnonce=\"" : "", @@ -2040,7 +2040,7 @@ static int add_auth_info(request_rec *r) } if (ai && ai[0]) - ap_table_mergen(r->headers_out, + apr_table_mergen(r->headers_out, r->proxyreq ? "Proxy-Authentication-Info" : "Authentication-Info", ai); diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index 592643c452..e61cb476af 100644 --- a/modules/arch/win32/mod_isapi.c +++ b/modules/arch/win32/mod_isapi.c @@ -144,12 +144,12 @@ typedef struct { PFN_HSE_IO_COMPLETION completion; PVOID completion_arg; HANDLE complete; - ap_status_t retval; + apr_status_t retval; } isapi_cid; -ap_status_t isapi_handler (request_rec *r) +apr_status_t isapi_handler (request_rec *r) { - ap_table_t *e = r->subprocess_env; + apr_table_t *e = r->subprocess_env; isapi_loaded *isa; isapi_cid *cid; @@ -177,8 +177,8 @@ ap_status_t isapi_handler (request_rec *r) * should only be performed on the first isapi dll invocation, * not with every HttpExtensionProc() */ - isa = ap_pcalloc(r->pool, sizeof(isapi_module)); - isa->pVer = ap_pcalloc(r->pool, sizeof(HSE_VERSION_INFO)); + isa = apr_pcalloc(r->pool, sizeof(isapi_module)); + isa->pVer = apr_pcalloc(r->pool, sizeof(HSE_VERSION_INFO)); isa->refcount = 0; /* TODO: These may need to become overrideable, so that we @@ -239,8 +239,8 @@ ap_status_t isapi_handler (request_rec *r) ap_add_cgi_vars(r); /* Set up connection structure and ecb */ - cid = ap_pcalloc(r->pool, sizeof(isapi_cid)); - cid->ecb = ap_pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK)); + cid = apr_pcalloc(r->pool, sizeof(isapi_cid)); + cid->ecb = apr_pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK)); cid->ecb->ConnID = (HCONN)cid; /* TODO: Critical section */ ++isa->refcount; @@ -256,15 +256,15 @@ ap_status_t isapi_handler (request_rec *r) cid->ecb->dwHttpStatusCode = 0; strcpy(cid->ecb->lpszLogData, ""); // TODO: are copies really needed here? - cid->ecb->lpszMethod = ap_pstrdup(r->pool, (char*) r->method); - cid->ecb->lpszQueryString = ap_pstrdup(r->pool, - (char*) ap_table_get(e, "QUERY_STRING")); - cid->ecb->lpszPathInfo = ap_pstrdup(r->pool, - (char*) ap_table_get(e, "PATH_INFO")); - cid->ecb->lpszPathTranslated = ap_pstrdup(r->pool, - (char*) ap_table_get(e, "PATH_TRANSLATED")); - cid->ecb->lpszContentType = ap_pstrdup(r->pool, - (char*) ap_table_get(e, "CONTENT_TYPE")); + cid->ecb->lpszMethod = apr_pstrdup(r->pool, (char*) r->method); + cid->ecb->lpszQueryString = apr_pstrdup(r->pool, + (char*) apr_table_get(e, "QUERY_STRING")); + cid->ecb->lpszPathInfo = apr_pstrdup(r->pool, + (char*) apr_table_get(e, "PATH_INFO")); + cid->ecb->lpszPathTranslated = apr_pstrdup(r->pool, + (char*) apr_table_get(e, "PATH_TRANSLATED")); + cid->ecb->lpszContentType = apr_pstrdup(r->pool, + (char*) apr_table_get(e, "CONTENT_TYPE")); /* Set up the callbacks */ cid->ecb->GetServerVariable = &GetServerVariable; cid->ecb->WriteClient = &WriteClient; @@ -291,7 +291,7 @@ ap_status_t isapi_handler (request_rec *r) * But we can be smarter and read up to our 48k and then allow * the ISAPI app to read further blocks as desired. */ - long to_read = atol(ap_table_get(e, "CONTENT_LENGTH")); + long to_read = atol(apr_table_get(e, "CONTENT_LENGTH")); long read; /* Actually, let's cap it at 48k, until we figure out what @@ -306,7 +306,7 @@ ap_status_t isapi_handler (request_rec *r) return HTTP_REQUEST_ENTITY_TOO_LARGE; } - cid->ecb->lpbData = ap_pcalloc(r->pool, 1 + to_read); + cid->ecb->lpbData = apr_pcalloc(r->pool, 1 + to_read); if ((read = ap_get_client_block(r, cid->ecb->lpbData, to_read)) < 0) { if (isa->TerminateExtension) @@ -417,7 +417,7 @@ BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName, LPVOID lpvBuffer, LPDWORD lpdwSizeofBuffer) { request_rec *r = ((isapi_cid *)hConn)->r; - ap_table_t *e = r->subprocess_env; + apr_table_t *e = r->subprocess_env; const char *result; /* Mostly, we just grab it from the environment, but there are @@ -428,7 +428,7 @@ BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName, /* We don't support NT users, so this is always the same as * REMOTE_USER */ - result = ap_table_get(e, "REMOTE_USER"); + result = apr_table_get(e, "REMOTE_USER"); } else if (!strcasecmp(lpszVariableName, "SERVER_PORT_SECURE")) { /* Apache doesn't support secure requests inherently, so @@ -441,7 +441,7 @@ BOOL WINAPI GetServerVariable (HCONN hConn, LPSTR lpszVariableName, result = r->uri; } else { - result = ap_table_get(e, lpszVariableName); + result = apr_table_get(e, lpszVariableName); } if (result) { @@ -549,21 +549,21 @@ static char* ComposeHeaders(request_rec *r, char* data) while (endp > value && ap_isspace(*endp)) *endp-- = '\0'; - tmp = ap_pstrdup (r->pool, value); + tmp = apr_pstrdup (r->pool, value); ap_str_tolower(tmp); r->content_type = tmp; } else if (!strcasecmp(data, "Content-Length")) { - ap_table_set(r->headers_out, data, value); + apr_table_set(r->headers_out, data, value); } else if (!strcasecmp(data, "Transfer-Encoding")) { - ap_table_set(r->headers_out, data, value); + apr_table_set(r->headers_out, data, value); } else if (!strcasecmp(data, "Set-Cookie")) { - ap_table_add(r->err_headers_out, data, value); + apr_table_add(r->err_headers_out, data, value); } else { - ap_table_merge(r->err_headers_out, data, value); + apr_table_merge(r->err_headers_out, data, value); } /* Reset data */ @@ -594,7 +594,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, /* Set the status to be returned when the HttpExtensionProc() * is done. */ - ap_table_set (r->headers_out, "Location", lpvBuffer); + apr_table_set (r->headers_out, "Location", lpvBuffer); cid->r->status = cid->ecb->dwHttpStatusCode = HTTP_MOVED_TEMPORARILY; return TRUE; @@ -609,17 +609,17 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, } /* Reset the method to GET */ - r->method = ap_pstrdup(r->pool, "GET"); + r->method = apr_pstrdup(r->pool, "GET"); r->method_number = M_GET; /* Don't let anyone think there's still data */ - ap_table_unset(r->headers_in, "Content-Length"); + apr_table_unset(r->headers_in, "Content-Length"); ap_internal_redirect((char *)lpvBuffer, r); return TRUE; case HSE_REQ_SEND_RESPONSE_HEADER: - r->status_line = lpvBuffer ? lpvBuffer : ap_pstrdup(r->pool, "200 OK"); + r->status_line = lpvBuffer ? lpvBuffer : apr_pstrdup(r->pool, "200 OK"); sscanf(r->status_line, "%d", &r->status); cid->ecb->dwHttpStatusCode = r->status; @@ -636,7 +636,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, } /* Make a copy - don't disturb the original */ - data = ap_pstrdup(r->pool, (char *)lpdwDataType); + data = apr_pstrdup(r->pool, (char *)lpdwDataType); /* Parse them out, or die trying */ data = ComposeHeaders(r, data); @@ -661,7 +661,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, case HSE_REQ_MAP_URL_TO_PATH: /* Map a URL to a filename */ - subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer, + subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize), r); GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL); @@ -738,7 +738,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, /* TODO: Not quite ready for prime time yet */ /* Map a URL to a filename */ - subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer, + subreq = ap_sub_req_lookup_uri(apr_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize), r); GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL); @@ -752,7 +752,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, ((char *)lpvBuffer)[l + 1] = '\0'; } - lpdwDataType = (LPDWORD) ap_palloc(r->pool, sizeof(HSE_URL_MAPEX_INFO)); + lpdwDataType = (LPDWORD) apr_palloc(r->pool, sizeof(HSE_URL_MAPEX_INFO)); strncpy(((LPHSE_URL_MAPEX_INFO)lpdwDataType)->lpszPath, (char *) lpvBuffer, MAX_PATH); ((LPHSE_URL_MAPEX_INFO)lpdwDataType)->dwFlags = 0; @@ -790,12 +790,12 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, if (((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus && ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus) { - r->status_line = ap_pstrndup(r->pool, + r->status_line = apr_pstrndup(r->pool, ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszStatus, ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchStatus); } else { - r->status_line = ap_pstrdup(r->pool, "200 OK"); + r->status_line = apr_pstrdup(r->pool, "200 OK"); } sscanf(r->status_line, "%d", &r->status); cid->ecb->dwHttpStatusCode = r->status; @@ -804,7 +804,7 @@ BOOL WINAPI ServerSupportFunction (HCONN hConn, DWORD dwHSERequest, && ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchHeader) { /* Make a copy - don't disturb the original */ - data = ap_pstrndup(r->pool, + data = apr_pstrndup(r->pool, ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->pszHeader, ((LPHSE_SEND_HEADER_EX_INFO)lpvBuffer)->cchHeader); @@ -864,7 +864,7 @@ module isapi_module = { NULL, /* merge per-dir config */ NULL, /* server config */ NULL, /* merge server config */ - NULL, /* command ap_table_t */ + NULL, /* command apr_table_t */ isapi_handlers, /* handlers */ NULL /* register hooks */ }; diff --git a/modules/cache/mod_file_cache.c b/modules/cache/mod_file_cache.c index 08cf6dd7ac..aec0affb92 100644 --- a/modules/cache/mod_file_cache.c +++ b/modules/cache/mod_file_cache.c @@ -135,33 +135,33 @@ static int once_through = 0; typedef struct { #if APR_HAS_SENDFILE - ap_file_t *file; + apr_file_t *file; #endif char *filename; - ap_finfo_t finfo; + apr_finfo_t finfo; int is_mmapped; #if APR_HAS_MMAP - ap_mmap_t *mm; + apr_mmap_t *mm; #endif } a_file; typedef struct { - ap_array_header_t *files; + apr_array_header_t *files; } a_server_config; -static void *create_server_config(ap_pool_t *p, server_rec *s) +static void *create_server_config(apr_pool_t *p, server_rec *s) { - a_server_config *sconf = ap_palloc(p, sizeof(*sconf)); + a_server_config *sconf = apr_palloc(p, sizeof(*sconf)); - sconf->files = ap_make_array(p, 20, sizeof(a_file)); + sconf->files = apr_make_array(p, 20, sizeof(a_file)); return sconf; } -static ap_status_t open_file(ap_file_t **file, const char *filename, int flg1, int flg2, - ap_pool_t *p) +static apr_status_t open_file(apr_file_t **file, const char *filename, int flg1, int flg2, + apr_pool_t *p) { - ap_status_t rv; + apr_status_t rv; #ifdef WIN32 /* The Windows file needs to be opened for overlapped i/o, which APR doesn't * support. @@ -175,20 +175,20 @@ static ap_status_t open_file(ap_file_t **file, const char *filename, int flg1, i FILE_FLAG_OVERLAPPED | FILE_FLAG_SEQUENTIAL_SCAN, /* file attributes */ NULL); /* handle to file with attributes to copy */ if (hFile != INVALID_HANDLE_VALUE) { - rv = ap_put_os_file(file, &hFile, p); + rv = apr_put_os_file(file, &hFile, p); } else { rv = GetLastError(); *file = NULL; } #else - rv = ap_open(file, filename, flg1, flg2, p); + rv = apr_open(file, filename, flg1, flg2, p); #endif return rv; } -static ap_status_t cleanup_file_cache(void *sconfv) +static apr_status_t cleanup_file_cache(void *sconfv) { a_server_config *sconf = sconfv; size_t n; @@ -199,12 +199,12 @@ static ap_status_t cleanup_file_cache(void *sconfv) while(n) { #if APR_HAS_MMAP if (file->is_mmapped) { - ap_mmap_delete(file->mm); + apr_mmap_delete(file->mm); } else #endif #if APR_HAS_SENDFILE - ap_close(file->file); + apr_close(file->file); #endif ++file; --n; @@ -219,12 +219,12 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename) a_server_config *sconf; a_file *new_file; a_file tmp; - ap_file_t *fd = NULL; - ap_status_t rc; + apr_file_t *fd = NULL; + apr_status_t rc; /* canonicalize the file name? */ /* os_canonical... */ - if (ap_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) { + if (apr_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server, "file_cache: unable to stat(%s), skipping", filename); return NULL; @@ -235,7 +235,7 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename) return NULL; } - /* Note: open_file should call ap_open for Unix and CreateFile for Windows. + /* Note: open_file should call apr_open for Unix and CreateFile for Windows. * The Windows file needs to be opened for async I/O to allow multiple threads * to serve it up at once. */ @@ -246,13 +246,13 @@ static const char *cachefile(cmd_parms *cmd, void *dummy, const char *filename) return NULL; } tmp.file = fd; - tmp.filename = ap_pstrdup(cmd->pool, filename); + tmp.filename = apr_pstrdup(cmd->pool, filename); sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module); - new_file = ap_push_array(sconf->files); + new_file = apr_push_array(sconf->files); *new_file = tmp; if (sconf->files->nelts == 1) { /* first one, register the cleanup */ - ap_register_cleanup(cmd->pool, sconf, cleanup_file_cache, ap_null_cleanup); + apr_register_cleanup(cmd->pool, sconf, cleanup_file_cache, apr_null_cleanup); } new_file->is_mmapped = FALSE; @@ -272,9 +272,9 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename) a_server_config *sconf; a_file *new_file; a_file tmp; - ap_file_t *fd = NULL; + apr_file_t *fd = NULL; - if (ap_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) { + if (apr_stat(&tmp.finfo, filename, cmd->temp_pool) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server, "mod_file_cache: unable to stat(%s), skipping", filename); return NULL; @@ -284,28 +284,28 @@ static const char *mmapfile(cmd_parms *cmd, void *dummy, const char *filename) "mod_file_cache: %s isn't a regular file, skipping", filename); return NULL; } - if (ap_open(&fd, filename, APR_READ, APR_OS_DEFAULT, cmd->temp_pool) + if (apr_open(&fd, filename, APR_READ, APR_OS_DEFAULT, cmd->temp_pool) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server, "mod_file_cache: unable to open(%s, O_RDONLY), skipping", filename); return NULL; } - if (ap_mmap_create(&tmp.mm, fd, 0, tmp.finfo.size, cmd->pool) != APR_SUCCESS) { + if (apr_mmap_create(&tmp.mm, fd, 0, tmp.finfo.size, cmd->pool) != APR_SUCCESS) { int save_errno = errno; - ap_close(fd); + apr_close(fd); errno = save_errno; ap_log_error(APLOG_MARK, APLOG_WARNING, errno, cmd->server, "mod_file_cache: unable to mmap %s, skipping", filename); return NULL; } - ap_close(fd); - tmp.filename = ap_pstrdup(cmd->pool, filename); + apr_close(fd); + tmp.filename = apr_pstrdup(cmd->pool, filename); sconf = ap_get_module_config(cmd->server->module_config, &file_cache_module); - new_file = ap_push_array(sconf->files); + new_file = apr_push_array(sconf->files); *new_file = tmp; if (sconf->files->nelts == 1) { /* first one, register the cleanup */ - ap_register_cleanup(cmd->pool, sconf, cleanup_file_cache, ap_null_cleanup); + apr_register_cleanup(cmd->pool, sconf, cleanup_file_cache, apr_null_cleanup); } new_file->is_mmapped = TRUE; @@ -326,8 +326,8 @@ static int file_compare(const void *av, const void *bv) return strcmp(a->filename, b->filename); } -static void file_cache_post_config(ap_pool_t *p, ap_pool_t *plog, - ap_pool_t *ptemp, server_rec *s) +static void file_cache_post_config(apr_pool_t *p, apr_pool_t *plog, + apr_pool_t *ptemp, server_rec *s) { a_server_config *sconf; a_file *elts; @@ -391,8 +391,8 @@ static int mmap_handler(request_rec *r, a_file *file, int rangestatus) ap_send_mmap (file->mm, r, 0, file->finfo.size); } else { - ap_size_t length; - ap_off_t offset; + apr_size_t length; + apr_off_t offset; while (ap_each_byterange(r, &offset, &length)) { ap_send_mmap(file->mm, r, offset, length); } @@ -404,9 +404,9 @@ static int mmap_handler(request_rec *r, a_file *file, int rangestatus) static int sendfile_handler(request_rec *r, a_file *file, int rangestatus) { #if APR_HAS_SENDFILE - ap_size_t length, nbytes; - ap_off_t offset = 0; - ap_status_t rv = APR_EINIT; + apr_size_t length, nbytes; + apr_off_t offset = 0; + apr_status_t rv = APR_EINIT; if (!rangestatus) { rv = ap_send_fd(file->file, r, 0, file->finfo.size, &nbytes); @@ -430,12 +430,12 @@ static int sendfile_handler(request_rec *r, a_file *file, int rangestatus) { #if APR_HAS_SENDFILE long length; - ap_off_t offset = 0; + apr_off_t offset = 0; struct iovec iov; - ap_hdtr_t hdtr; - ap_hdtr_t *phdtr = &hdtr; - ap_status_t rv; - ap_int32_t flags = 0; + apr_hdtr_t hdtr; + apr_hdtr_t *phdtr = &hdtr; + apr_status_t rv; + apr_int32_t flags = 0; /* * We want to send any data held in the client buffer on the @@ -448,7 +448,7 @@ static int sendfile_handler(request_rec *r, a_file *file, int rangestatus) iov.iov_len = r->connection->client->outcnt; r->connection->client->outcnt = 0; - /* initialize the ap_hdtr_t struct */ + /* initialize the apr_hdtr_t struct */ phdtr->headers = &iov; phdtr->numheaders = 1; phdtr->trailers = NULL; diff --git a/modules/dav/fs/dbm.c b/modules/dav/fs/dbm.c index 7be9f533bb..99755ad21c 100644 --- a/modules/dav/fs/dbm.c +++ b/modules/dav/fs/dbm.c @@ -73,14 +73,14 @@ #include "repos.h" struct dav_db { - ap_pool_t *pool; + apr_pool_t *pool; SDBM *file; }; #define D2G(d) (*(sdbm_datum*)&(d)) -void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname, +void dav_dbm_get_statefiles(apr_pool_t *p, const char *fname, const char **state1, const char **state2) { char *work; @@ -89,11 +89,11 @@ void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname, if (fname == NULL) fname = DAV_FS_STATE_FILE_FOR_DIR; - fname = ap_pstrcat(p, fname, SDBM_DIRFEXT, NULL); + fname = apr_pstrcat(p, fname, SDBM_DIRFEXT, NULL); *state1 = fname; - work = ap_pstrdup(p, fname); + work = apr_pstrdup(p, fname); /* we know the extension is 4 characters -- len(DIRFEXT) */ extension = strlen(work) - 4; @@ -102,7 +102,7 @@ void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname, } -static dav_error * dav_fs_dbm_error(dav_db *db, ap_pool_t *p) +static dav_error * dav_fs_dbm_error(dav_db *db, apr_pool_t *p) { int save_errno = errno; int errcode; @@ -125,20 +125,20 @@ static dav_error * dav_fs_dbm_error(dav_db *db, ap_pool_t *p) /* ensure that our state subdirectory is present */ /* ### does this belong here or in dav_fs_repos.c ?? */ -void dav_fs_ensure_state_dir(ap_pool_t * p, const char *dirname) +void dav_fs_ensure_state_dir(apr_pool_t * p, const char *dirname) { - const char *pathname = ap_pstrcat(p, dirname, "/" DAV_FS_STATE_DIR, NULL); + const char *pathname = apr_pstrcat(p, dirname, "/" DAV_FS_STATE_DIR, NULL); /* ### do we need to deal with the umask? */ /* just try to make it, ignoring any resulting errors */ - (void) ap_make_dir(pathname, APR_OS_DEFAULT, p); + (void) apr_make_dir(pathname, APR_OS_DEFAULT, p); } /* dav_dbm_open_direct: Opens a *dbm database specified by path. * ro = boolean read-only flag. */ -dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro, +dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, dav_db **pdb) { SDBM *file; @@ -157,7 +157,7 @@ dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro, /* may be NULL if we tried to open a non-existent db as read-only */ if (file != NULL) { /* we have an open database... return it */ - *pdb = ap_pcalloc(p, sizeof(**pdb)); + *pdb = apr_pcalloc(p, sizeof(**pdb)); (*pdb)->pool = p; (*pdb)->file = file; } @@ -165,7 +165,7 @@ dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro, return NULL; } -static dav_error * dav_dbm_open(ap_pool_t * p, const dav_resource *resource, +static dav_error * dav_dbm_open(apr_pool_t * p, const dav_resource *resource, int ro, dav_db **pdb) { const char *dirpath; @@ -181,7 +181,7 @@ static dav_error * dav_dbm_open(ap_pool_t * p, const dav_resource *resource, dav_fs_ensure_state_dir(p, dirpath); } - pathname = ap_pstrcat(p, + pathname = apr_pstrcat(p, dirpath, "/" DAV_FS_STATE_DIR "/", fname ? fname : DAV_FS_STATE_FILE_FOR_DIR, @@ -212,7 +212,7 @@ static dav_error * dav_dbm_fetch(dav_db *db, dav_datum key, dav_datum *pvalue) static dav_error * dav_dbm_store(dav_db *db, dav_datum key, dav_datum value) { - ap_status_t status; + apr_status_t status; status = sdbm_store(db->file, D2G(key), D2G(value), SDBM_REPLACE); diff --git a/modules/dav/fs/lock.c b/modules/dav/fs/lock.c index 1d2837fb48..7d2f83c675 100644 --- a/modules/dav/fs/lock.c +++ b/modules/dav/fs/lock.c @@ -119,7 +119,7 @@ /* ack. forward declare. */ -static dav_error * dav_fs_remove_locknull_member(ap_pool_t *p, +static dav_error * dav_fs_remove_locknull_member(apr_pool_t *p, const char *filename, dav_buffer *pbuf); @@ -208,7 +208,7 @@ typedef struct dav_lock_indirect struct dav_lockdb_private { request_rec *r; /* for accessing the uuid state */ - ap_pool_t *pool; /* a pool to use */ + apr_pool_t *pool; /* a pool to use */ const char *lockdb_path; /* where is the lock database? */ int opened; /* we opened the database */ @@ -246,7 +246,7 @@ static dav_lock *dav_fs_alloc_lock(dav_lockdb *lockdb, dav_datum key, { dav_lock_combined *comb; - comb = ap_pcalloc(lockdb->info->pool, sizeof(*comb)); + comb = apr_pcalloc(lockdb->info->pool, sizeof(*comb)); comb->pub.rectype = DAV_LOCKREC_DIRECT; comb->pub.info = &comb->priv; comb->priv.key = key; @@ -269,7 +269,7 @@ static dav_lock *dav_fs_alloc_lock(dav_lockdb *lockdb, dav_datum key, ** Parse an opaquelocktoken URI into a locktoken. */ static dav_error * dav_fs_parse_locktoken( - ap_pool_t *p, + apr_pool_t *p, const char *char_token, dav_locktoken **locktoken_p) { @@ -283,7 +283,7 @@ static dav_error * dav_fs_parse_locktoken( } char_token += 16; - locktoken = ap_pcalloc(p, sizeof(*locktoken)); + locktoken = apr_pcalloc(p, sizeof(*locktoken)); if (dav_parse_opaquelocktoken(char_token, &locktoken->uuid)) { return dav_new_error(p, HTTP_BAD_REQUEST, DAV_ERR_LOCK_PARSE_TOKEN, "The opaquelocktoken has an incorrect format " @@ -300,11 +300,11 @@ static dav_error * dav_fs_parse_locktoken( ** Generate the URI for a locktoken */ static const char *dav_fs_format_locktoken( - ap_pool_t *p, + apr_pool_t *p, const dav_locktoken *locktoken) { const char *uuid_token = dav_format_opaquelocktoken(p, &locktoken->uuid); - return ap_pstrcat(p, "opaquelocktoken:", uuid_token, NULL); + return apr_pstrcat(p, "opaquelocktoken:", uuid_token, NULL); } /* @@ -362,7 +362,7 @@ static dav_error * dav_fs_open_lockdb(request_rec *r, int ro, int force, { dav_lockdb_combined *comb; - comb = ap_pcalloc(r->pool, sizeof(*comb)); + comb = apr_pcalloc(r->pool, sizeof(*comb)); comb->pub.hooks = &dav_hooks_locks_fs; comb->pub.ro = ro; comb->pub.info = &comb->priv; @@ -405,7 +405,7 @@ static void dav_fs_close_lockdb(dav_lockdb *lockdb) ** ** Given a pathname, build a DAV_TYPE_FNAME lock database key. */ -static dav_datum dav_fs_build_fname_key(ap_pool_t *p, const char *pathname) +static dav_datum dav_fs_build_fname_key(apr_pool_t *p, const char *pathname) { dav_datum key; @@ -414,7 +414,7 @@ static dav_datum dav_fs_build_fname_key(ap_pool_t *p, const char *pathname) /* size is TYPE + pathname + null */ key.dsize = strlen(pathname) + 2; - key.dptr = ap_palloc(p, key.dsize); + key.dptr = apr_palloc(p, key.dsize); *key.dptr = DAV_TYPE_FNAME; memcpy(key.dptr + 1, pathname, key.dsize - 1); if (key.dptr[key.dsize - 2] == '/') @@ -432,19 +432,19 @@ static dav_datum dav_fs_build_fname_key(ap_pool_t *p, const char *pathname) ** (non-Win32 and file exists ): ** dav_datum->dvalue = inode, dev_major, dev_minor */ -static dav_datum dav_fs_build_key(ap_pool_t *p, const dav_resource *resource) +static dav_datum dav_fs_build_key(apr_pool_t *p, const dav_resource *resource) { const char *file = dav_fs_pathname(resource); #ifndef WIN32 dav_datum key; - ap_finfo_t finfo; + apr_finfo_t finfo; /* ### use lstat() ?? */ - if (ap_stat(&finfo, file, p) == 0) { + if (apr_stat(&finfo, file, p) == 0) { /* ### can we use a buffer for this? */ key.dsize = 1 + sizeof(finfo.inode) + sizeof(finfo.device); - key.dptr = ap_palloc(p, key.dsize); + key.dptr = apr_palloc(p, key.dsize); *key.dptr = DAV_TYPE_INODE; memcpy(key.dptr + 1, &finfo.inode, sizeof(finfo.inode)); memcpy(key.dptr + 1 + sizeof(finfo.inode), &finfo.device, @@ -514,9 +514,9 @@ static dav_error * dav_fs_save_lock_record(dav_lockdb *lockdb, dav_datum key, ip = ip->next; } - /* ### can this be ap_palloc() ? */ + /* ### can this be apr_palloc() ? */ /* ### hmmm.... investigate the use of a buffer here */ - ptr = val.dptr = ap_pcalloc(lockdb->info->pool, val.dsize); + ptr = val.dptr = apr_pcalloc(lockdb->info->pool, val.dsize); dp = direct; ip = indirect; @@ -585,7 +585,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, dav_lock_discovery **direct, dav_lock_indirect **indirect) { - ap_pool_t *p = lockdb->info->pool; + apr_pool_t *p = lockdb->info->pool; dav_error *err; size_t offset = 0; int need_save = DAV_FALSE; @@ -622,17 +622,17 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, case DAV_LOCK_DIRECT: /* Create and fill a dav_lock_discovery structure */ - dp = ap_pcalloc(p, sizeof(*dp)); + dp = apr_pcalloc(p, sizeof(*dp)); memcpy(dp, val.dptr + offset, sizeof(dp->f)); offset += sizeof(dp->f); - dp->locktoken = ap_palloc(p, sizeof(*dp->locktoken)); + dp->locktoken = apr_palloc(p, sizeof(*dp->locktoken)); memcpy(dp->locktoken, val.dptr + offset, sizeof(*dp->locktoken)); offset += sizeof(*dp->locktoken); if (*(val.dptr + offset) == '\0') { ++offset; } else { - dp->owner = ap_pstrdup(p, val.dptr + offset); + dp->owner = apr_pstrdup(p, val.dptr + offset); offset += strlen(dp->owner) + 1; } @@ -640,7 +640,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, ++offset; } else { - dp->auth_user = ap_pstrdup(p, val.dptr + offset); + dp->auth_user = apr_pstrdup(p, val.dptr + offset); offset += strlen(dp->auth_user) + 1; } @@ -654,10 +654,10 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, /* Remove timed-out locknull fm .locknull list */ if (*key.dptr == DAV_TYPE_FNAME) { const char *fname = key.dptr + 1; - ap_finfo_t finfo; + apr_finfo_t finfo; /* if we don't see the file, then it's a locknull */ - if (ap_lstat(&finfo, fname, p) != 0) { + if (apr_lstat(&finfo, fname, p) != 0) { if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) { /* ### push a higher-level description? */ return err; @@ -670,15 +670,15 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, case DAV_LOCK_INDIRECT: /* Create and fill a dav_lock_indirect structure */ - ip = ap_pcalloc(p, sizeof(*ip)); - ip->locktoken = ap_palloc(p, sizeof(*ip->locktoken)); + ip = apr_pcalloc(p, sizeof(*ip)); + ip->locktoken = apr_palloc(p, sizeof(*ip->locktoken)); memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken)); offset += sizeof(*ip->locktoken); memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout)); offset += sizeof(ip->timeout); ip->key.dsize = *((int *) (val.dptr + offset)); /* length of datum */ offset += sizeof(ip->key.dsize); - ip->key.dptr = ap_palloc(p, ip->key.dsize); + ip->key.dptr = apr_palloc(p, ip->key.dsize); memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize); offset += ip->key.dsize; @@ -701,7 +701,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, dav_datum key, return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, DAV_ERR_LOCK_CORRUPT_DB, - ap_psprintf(p, + apr_psprintf(p, "The lock database was found to " "be corrupt. offset %i, c=%02x", offset, val.dptr[offset])); @@ -805,13 +805,13 @@ static const char *dav_fs_get_supportedlock(void) ** dav_fs_load_locknull_list: Returns a dav_buffer dump of the locknull file ** for the given directory. */ -static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath, +static dav_error * dav_fs_load_locknull_list(apr_pool_t *p, const char *dirpath, dav_buffer *pbuf) { - ap_finfo_t finfo; - ap_file_t *file = NULL; + apr_finfo_t finfo; + apr_file_t *file = NULL; dav_error *err = NULL; - ap_ssize_t amt; + apr_ssize_t amt; dav_buffer_init(p, pbuf, dirpath); @@ -823,14 +823,14 @@ static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath, /* reset this in case we leave w/o reading into the buffer */ pbuf->cur_len = 0; - if (ap_open(&file, pbuf->buf, APR_READ | APR_BINARY, APR_OS_DEFAULT, + if (apr_open(&file, pbuf->buf, APR_READ | APR_BINARY, APR_OS_DEFAULT, p) != APR_SUCCESS) { return NULL; } - if (ap_getfileinfo(&finfo, file) != APR_SUCCESS) { + if (apr_getfileinfo(&finfo, file) != APR_SUCCESS) { err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(p, + apr_psprintf(p, "Opened but could not stat file %s", pbuf->buf)); goto loaderror; @@ -838,10 +838,10 @@ static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath, dav_set_bufsize(p, pbuf, finfo.size); amt = finfo.size; - if (ap_read(file, pbuf->buf, &amt) != APR_SUCCESS + if (apr_read(file, pbuf->buf, &amt) != APR_SUCCESS || amt != finfo.size) { err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(p, + apr_psprintf(p, "Failure reading locknull file " "for %s", dirpath)); @@ -851,7 +851,7 @@ static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath, } loaderror: - ap_close(file); + apr_close(file); return err; } @@ -859,19 +859,19 @@ static dav_error * dav_fs_load_locknull_list(ap_pool_t *p, const char *dirpath, ** dav_fs_save_locknull_list: Saves contents of pbuf into the ** locknull file for dirpath. */ -static dav_error * dav_fs_save_locknull_list(ap_pool_t *p, const char *dirpath, +static dav_error * dav_fs_save_locknull_list(apr_pool_t *p, const char *dirpath, dav_buffer *pbuf) { const char *pathname; - ap_file_t *file = NULL; + apr_file_t *file = NULL; dav_error *err = NULL; - ap_ssize_t amt; + apr_ssize_t amt; if (pbuf->buf == NULL) return NULL; dav_fs_ensure_state_dir(p, dirpath); - pathname = ap_pstrcat(p, + pathname = apr_pstrcat(p, dirpath, dirpath[strlen(dirpath) - 1] == '/' ? "" : "/", DAV_FS_STATE_DIR "/" DAV_FS_LOCK_NULL_FILE, @@ -881,31 +881,31 @@ static dav_error * dav_fs_save_locknull_list(ap_pool_t *p, const char *dirpath, /* delete the file if cur_len == 0 */ if (remove(pathname) != 0) { return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(p, + apr_psprintf(p, "Error removing %s", pathname)); } return NULL; } - if (ap_open(&file, pathname, + if (apr_open(&file, pathname, APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY, APR_OS_DEFAULT, p) != APR_SUCCESS) { return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(p, + apr_psprintf(p, "Error opening %s for writing", pathname)); } amt = pbuf->cur_len; - if (ap_write(file, pbuf->buf, &amt) != APR_SUCCESS + if (apr_write(file, pbuf->buf, &amt) != APR_SUCCESS || amt != pbuf->cur_len) { err = dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(p, + apr_psprintf(p, "Error writing %i bytes to %s", pbuf->cur_len, pathname)); } - ap_close(file); + apr_close(file); return err; } @@ -913,7 +913,7 @@ static dav_error * dav_fs_save_locknull_list(ap_pool_t *p, const char *dirpath, ** dav_fs_remove_locknull_member: Removes filename from the locknull list ** for directory path. */ -static dav_error * dav_fs_remove_locknull_member(ap_pool_t *p, +static dav_error * dav_fs_remove_locknull_member(apr_pool_t *p, const char *filename, dav_buffer *pbuf) { @@ -922,7 +922,7 @@ static dav_error * dav_fs_remove_locknull_member(ap_pool_t *p, size_t scanlen; char *scan; const char *scanend; - char *dirpath = ap_pstrdup(p, filename); + char *dirpath = apr_pstrdup(p, filename); char *fname = strrchr(dirpath, '/'); int dirty = 0; @@ -977,7 +977,7 @@ static dav_error * dav_fs_add_locknull_state( const dav_resource *resource) { dav_buffer buf = { 0 }; - ap_pool_t *p = lockdb->info->pool; + apr_pool_t *p = lockdb->info->pool; const char *dirpath; const char *fname; dav_error *err; @@ -1016,7 +1016,7 @@ static dav_error * dav_fs_remove_locknull_state( { dav_buffer buf = { 0 }; dav_error *err; - ap_pool_t *p = lockdb->info->pool; + apr_pool_t *p = lockdb->info->pool; const char *pathname = dav_fs_pathname(resource); if ((err = dav_fs_remove_locknull_member(p, pathname, &buf)) != NULL) { @@ -1080,7 +1080,7 @@ static dav_error * dav_fs_get_locks(dav_lockdb *lockdb, int calltype, dav_lock **locks) { - ap_pool_t *p = lockdb->info->pool; + apr_pool_t *p = lockdb->info->pool; dav_datum key; dav_error *err; dav_lock *lock = NULL; @@ -1251,7 +1251,7 @@ static dav_error * dav_fs_append_locks(dav_lockdb *lockdb, int make_indirect, const dav_lock *lock) { - ap_pool_t *p = lockdb->info->pool; + apr_pool_t *p = lockdb->info->pool; dav_error *err; dav_lock_indirect *ip; dav_lock_discovery *dp; @@ -1272,7 +1272,7 @@ static dav_error * dav_fs_append_locks(dav_lockdb *lockdb, for (; lock != NULL; lock = lock->next) { /* ### this works for any rectype */ - dav_lock_indirect *newi = ap_pcalloc(p, sizeof(*newi)); + dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi)); /* ### shut off the const warning for now */ newi->locktoken = (dav_locktoken *)lock->locktoken; @@ -1287,7 +1287,7 @@ static dav_error * dav_fs_append_locks(dav_lockdb *lockdb, /* create and link in the right kind of lock */ if (lock->rectype == DAV_LOCKREC_DIRECT) { - dav_lock_discovery *newd = ap_pcalloc(p, sizeof(*newd)); + dav_lock_discovery *newd = apr_pcalloc(p, sizeof(*newd)); newd->f.scope = lock->scope; newd->f.type = lock->type; @@ -1303,7 +1303,7 @@ static dav_error * dav_fs_append_locks(dav_lockdb *lockdb, else { /* DAV_LOCKREC_INDIRECT(_PARTIAL) */ - dav_lock_indirect *newi = ap_pcalloc(p, sizeof(*newi)); + dav_lock_indirect *newi = apr_pcalloc(p, sizeof(*newi)); /* ### shut off the const warning for now */ newi->locktoken = (dav_locktoken *)lock->locktoken; diff --git a/modules/dav/fs/mod_dav_fs.c b/modules/dav/fs/mod_dav_fs.c index 3c89853a38..6a4f5eb985 100644 --- a/modules/dav/fs/mod_dav_fs.c +++ b/modules/dav/fs/mod_dav_fs.c @@ -74,19 +74,19 @@ const char *dav_get_lockdb_path(const request_rec *r) return conf->lockdb_path; } -static void *dav_fs_create_server_config(ap_pool_t *p, server_rec *s) +static void *dav_fs_create_server_config(apr_pool_t *p, server_rec *s) { - return ap_pcalloc(p, sizeof(dav_fs_server_conf)); + return apr_pcalloc(p, sizeof(dav_fs_server_conf)); } -static void *dav_fs_merge_server_config(ap_pool_t *p, +static void *dav_fs_merge_server_config(apr_pool_t *p, void *base, void *overrides) { dav_fs_server_conf *parent = base; dav_fs_server_conf *child = overrides; dav_fs_server_conf *newconf; - newconf = ap_pcalloc(p, sizeof(*newconf)); + newconf = apr_pcalloc(p, sizeof(*newconf)); newconf->lockdb_path = child->lockdb_path ? child->lockdb_path : parent->lockdb_path; diff --git a/modules/dav/fs/repos.c b/modules/dav/fs/repos.c index d0647bbb9b..9101034866 100644 --- a/modules/dav/fs/repos.c +++ b/modules/dav/fs/repos.c @@ -77,9 +77,9 @@ /* context needed to identify a resource */ struct dav_resource_private { - ap_pool_t *pool; /* memory storage pool associated with request */ + apr_pool_t *pool; /* memory storage pool associated with request */ const char *pathname; /* full pathname to resource */ - ap_finfo_t finfo; /* filesystem info */ + apr_finfo_t finfo; /* filesystem info */ }; /* private context for doing a filesystem walk */ @@ -174,8 +174,8 @@ static const dav_fs_liveprop_name dav_fs_props[] = /* define the dav_stream structure for our use */ struct dav_stream { - ap_pool_t *p; - ap_file_t *f; + apr_pool_t *p; + apr_file_t *f; const char *pathname; /* we may need to remove it at close time */ }; @@ -186,7 +186,7 @@ static dav_error * dav_fs_walk(dav_walker_ctx *wctx, int depth); ** ** PRIVATE REPOSITORY FUNCTIONS */ -ap_pool_t *dav_fs_pool(const dav_resource *resource) +apr_pool_t *dav_fs_pool(const dav_resource *resource) { return resource->info->pool; } @@ -226,12 +226,12 @@ void dav_fs_dir_file_name( /* Note: picked up from ap_gm_timestr_822() */ /* NOTE: buf must be at least DAV_TIMEBUF_SIZE chars in size */ -static void dav_format_time(int style, ap_time_t sec, char *buf) +static void dav_format_time(int style, apr_time_t sec, char *buf) { ap_exploded_time_t tms; /* ### what to do if fails? */ - (void) ap_explode_gmt(&tms, sec); + (void) apr_explode_gmt(&tms, sec); if (style == DAV_STYLE_ISO8601) { /* ### should we use "-00:00" instead of "Z" ?? */ @@ -256,21 +256,21 @@ static void dav_format_time(int style, ap_time_t sec, char *buf) static dav_error * dav_fs_copymove_file( int is_move, - ap_pool_t * p, + apr_pool_t * p, const char *src, const char *dst, dav_buffer *pbuf) { dav_buffer work_buf = { 0 }; - ap_file_t *inf = NULL; - ap_file_t *outf = NULL; + apr_file_t *inf = NULL; + apr_file_t *outf = NULL; if (pbuf == NULL) pbuf = &work_buf; dav_set_bufsize(p, pbuf, DAV_FS_COPY_BLOCKSIZE); - if ((ap_open(&inf, src, APR_READ | APR_BINARY, APR_OS_DEFAULT, p)) + if ((apr_open(&inf, src, APR_READ | APR_BINARY, APR_OS_DEFAULT, p)) != APR_SUCCESS) { /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -278,9 +278,9 @@ static dav_error * dav_fs_copymove_file( } /* ### do we need to deal with the umask? */ - if ((ap_open(&outf, dst, APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY, + if ((apr_open(&outf, dst, APR_WRITE | APR_CREATE | APR_TRUNCATE | APR_BINARY, APR_OS_DEFAULT, p)) != APR_SUCCESS) { - ap_close(inf); + apr_close(inf); /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -288,15 +288,15 @@ static dav_error * dav_fs_copymove_file( } while (1) { - ap_ssize_t len = DAV_FS_COPY_BLOCKSIZE; - ap_status_t status; + apr_ssize_t len = DAV_FS_COPY_BLOCKSIZE; + apr_status_t status; - status = ap_read(inf, pbuf->buf, &len); + status = apr_read(inf, pbuf->buf, &len); if (status != APR_SUCCESS && status != APR_EOF) { - ap_close(inf); - ap_close(outf); + apr_close(inf); + apr_close(outf); - if (ap_remove_file(dst, p) != APR_SUCCESS) { + if (apr_remove_file(dst, p) != APR_SUCCESS) { /* ### ACK! Inconsistent state... */ /* ### use something besides 500? */ @@ -312,11 +312,11 @@ static dav_error * dav_fs_copymove_file( } /* write any bytes that were read (applies to APR_EOF, too) */ - if (ap_full_write(outf, pbuf->buf, len, NULL) != APR_SUCCESS) { + if (apr_full_write(outf, pbuf->buf, len, NULL) != APR_SUCCESS) { int save_errno = errno; - ap_close(inf); - ap_close(outf); + apr_close(inf); + apr_close(outf); if (remove(dst) != 0) { /* ### ACK! Inconsistent state... */ @@ -343,8 +343,8 @@ static dav_error * dav_fs_copymove_file( break; } - ap_close(inf); - ap_close(outf); + apr_close(inf); + apr_close(outf); if (is_move && remove(src) != 0) { dav_error *err; @@ -376,31 +376,31 @@ static dav_error * dav_fs_copymove_file( /* ### need more buffers to replace the pool argument */ static dav_error * dav_fs_copymove_state( int is_move, - ap_pool_t * p, + apr_pool_t * p, const char *src_dir, const char *src_file, const char *dst_dir, const char *dst_file, dav_buffer *pbuf) { - ap_finfo_t src_finfo; /* finfo for source file */ - ap_finfo_t dst_state_finfo; /* finfo for STATE directory */ + apr_finfo_t src_finfo; /* finfo for source file */ + apr_finfo_t dst_state_finfo; /* finfo for STATE directory */ const char *src; const char *dst; /* build the propset pathname for the source file */ - src = ap_pstrcat(p, src_dir, "/" DAV_FS_STATE_DIR "/", src_file, NULL); + src = apr_pstrcat(p, src_dir, "/" DAV_FS_STATE_DIR "/", src_file, NULL); /* the source file doesn't exist */ - if (ap_stat(&src_finfo, src, p) != 0) { + if (apr_stat(&src_finfo, src, p) != 0) { return NULL; } /* build the pathname for the destination state dir */ - dst = ap_pstrcat(p, dst_dir, "/" DAV_FS_STATE_DIR, NULL); + dst = apr_pstrcat(p, dst_dir, "/" DAV_FS_STATE_DIR, NULL); /* ### do we need to deal with the umask? */ /* ensure that it exists */ - if (ap_make_dir(dst, APR_OS_DEFAULT, p) != 0) { + if (apr_make_dir(dst, APR_OS_DEFAULT, p) != 0) { if (errno != EEXIST) { /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -409,7 +409,7 @@ static dav_error * dav_fs_copymove_state( } /* get info about the state directory */ - if (ap_stat(&dst_state_finfo, dst, p) != 0) { + if (apr_stat(&dst_state_finfo, dst, p) != 0) { /* Ack! Where'd it go? */ /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -425,12 +425,12 @@ static dav_error * dav_fs_copymove_state( } /* append the target file to the state directory pathname */ - dst = ap_pstrcat(p, dst, "/", dst_file, NULL); + dst = apr_pstrcat(p, dst, "/", dst_file, NULL); /* copy/move the file now */ if (is_move && src_finfo.device == dst_state_finfo.device) { /* simple rename is possible since it is on the same device */ - if (ap_rename_file(src, dst, p) != APR_SUCCESS) { + if (apr_rename_file(src, dst, p) != APR_SUCCESS) { /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, "Could not move state file."); @@ -445,7 +445,7 @@ static dav_error * dav_fs_copymove_state( return NULL; } -static dav_error *dav_fs_copymoveset(int is_move, ap_pool_t *p, +static dav_error *dav_fs_copymoveset(int is_move, apr_pool_t *p, const dav_resource *src, const dav_resource *dst, dav_buffer *pbuf) @@ -503,7 +503,7 @@ static dav_error *dav_fs_copymoveset(int is_move, ap_pool_t *p, return err; } -static dav_error *dav_fs_deleteset(ap_pool_t *p, const dav_resource *resource) +static dav_error *dav_fs_deleteset(apr_pool_t *p, const dav_resource *resource) { const char *dirpath; const char *fname; @@ -516,7 +516,7 @@ static dav_error *dav_fs_deleteset(ap_pool_t *p, const dav_resource *resource) dav_dbm_get_statefiles(p, fname, &state1, &state2); /* build the propset pathname for the file */ - pathname = ap_pstrcat(p, + pathname = apr_pstrcat(p, dirpath, "/" DAV_FS_STATE_DIR "/", state1, @@ -530,7 +530,7 @@ static dav_error *dav_fs_deleteset(ap_pool_t *p, const dav_resource *resource) if (state2 != NULL) { /* build the propset pathname for the file */ - pathname = ap_pstrcat(p, + pathname = apr_pstrcat(p, dirpath, "/" DAV_FS_STATE_DIR "/", state2, @@ -567,7 +567,7 @@ static dav_resource * dav_fs_get_resource( /* ### optimize this into a single allocation! */ /* Create private resource context descriptor */ - ctx = ap_pcalloc(r->pool, sizeof(*ctx)); + ctx = apr_pcalloc(r->pool, sizeof(*ctx)); ctx->pool = r->pool; ctx->finfo = r->finfo; @@ -585,7 +585,7 @@ static dav_resource * dav_fs_get_resource( ** it onto the filename so that we get a "valid" pathname for null ** resources. */ - s = ap_pstrcat(r->pool, filename, r->path_info, NULL); + s = apr_pstrcat(r->pool, filename, r->path_info, NULL); /* make sure the pathname does not have a trailing "/" */ len = strlen(s); @@ -595,7 +595,7 @@ static dav_resource * dav_fs_get_resource( ctx->pathname = s; /* Create resource descriptor */ - resource = ap_pcalloc(r->pool, sizeof(*resource)); + resource = apr_pcalloc(r->pool, sizeof(*resource)); resource->type = DAV_RESOURCE_TYPE_REGULAR; resource->info = ctx; resource->hooks = &dav_hooks_repository_fs; @@ -603,7 +603,7 @@ static dav_resource * dav_fs_get_resource( /* make sure the URI does not have a trailing "/" */ len = strlen(r->uri); if (len > 1 && r->uri[len - 1] == '/') { - s = ap_pstrdup(r->pool, r->uri); + s = apr_pstrdup(r->pool, r->uri); s[len - 1] = '\0'; resource->uri = s; } @@ -670,7 +670,7 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource) /* ### optimize this into a single allocation! */ /* Create private resource context descriptor */ - parent_ctx = ap_pcalloc(ctx->pool, sizeof(*parent_ctx)); + parent_ctx = apr_pcalloc(ctx->pool, sizeof(*parent_ctx)); parent_ctx->pool = ctx->pool; dirpath = ap_make_dirstr_parent(ctx->pool, ctx->pathname); @@ -678,7 +678,7 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource) dirpath[strlen(dirpath) - 1] = '\0'; parent_ctx->pathname = dirpath; - parent_resource = ap_pcalloc(ctx->pool, sizeof(*parent_resource)); + parent_resource = apr_pcalloc(ctx->pool, sizeof(*parent_resource)); parent_resource->info = parent_ctx; parent_resource->collection = 1; parent_resource->hooks = &dav_hooks_repository_fs; @@ -690,7 +690,7 @@ static dav_resource * dav_fs_get_parent_resource(const dav_resource *resource) parent_resource->uri = uri; } - if (ap_stat(&parent_ctx->finfo, parent_ctx->pathname, ctx->pool) == 0) { + if (apr_stat(&parent_ctx->finfo, parent_ctx->pathname, ctx->pool) == 0) { parent_resource->exists = 1; } @@ -741,9 +741,9 @@ static dav_error * dav_fs_open_stream(const dav_resource *resource, dav_stream_mode mode, dav_stream **stream) { - ap_pool_t *p = resource->info->pool; - dav_stream *ds = ap_pcalloc(p, sizeof(*ds)); - ap_int32_t flags; + apr_pool_t *p = resource->info->pool; + dav_stream *ds = apr_pcalloc(p, sizeof(*ds)); + apr_int32_t flags; switch (mode) { case DAV_MODE_READ: @@ -762,7 +762,7 @@ static dav_error * dav_fs_open_stream(const dav_resource *resource, ds->p = p; ds->pathname = resource->info->pathname; - if (ap_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, + if (apr_open(&ds->f, ds->pathname, flags, APR_OS_DEFAULT, ds->p) != APR_SUCCESS) { /* ### use something besides 500? */ return dav_new_error(p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -777,10 +777,10 @@ static dav_error * dav_fs_open_stream(const dav_resource *resource, static dav_error * dav_fs_close_stream(dav_stream *stream, int commit) { - ap_close(stream->f); + apr_close(stream->f); if (!commit) { - if (ap_remove_file(stream->pathname, stream->p) != 0) { + if (apr_remove_file(stream->pathname, stream->p) != 0) { /* ### use a better description? */ return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, 0, "There was a problem removing (rolling " @@ -793,9 +793,9 @@ static dav_error * dav_fs_close_stream(dav_stream *stream, int commit) } static dav_error * dav_fs_read_stream(dav_stream *stream, - void *buf, ap_size_t *bufsize) + void *buf, apr_size_t *bufsize) { - if (ap_read(stream->f, buf, (ap_ssize_t *)bufsize) != APR_SUCCESS) { + if (apr_read(stream->f, buf, (apr_ssize_t *)bufsize) != APR_SUCCESS) { /* ### use something besides 500? */ return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, 0, "An error occurred while reading from a " @@ -805,11 +805,11 @@ static dav_error * dav_fs_read_stream(dav_stream *stream, } static dav_error * dav_fs_write_stream(dav_stream *stream, - const void *buf, ap_size_t bufsize) + const void *buf, apr_size_t bufsize) { - ap_status_t status; + apr_status_t status; - status = ap_full_write(stream->f, buf, bufsize, NULL); + status = apr_full_write(stream->f, buf, bufsize, NULL); if (status == APR_ENOSPC) { return dav_new_error(stream->p, HTTP_INSUFFICIENT_STORAGE, 0, "There is not enough storage to write to " @@ -824,10 +824,10 @@ static dav_error * dav_fs_write_stream(dav_stream *stream, return NULL; } -static dav_error * dav_fs_seek_stream(dav_stream *stream, ap_off_t abs_pos) +static dav_error * dav_fs_seek_stream(dav_stream *stream, apr_off_t abs_pos) { - if (ap_seek(stream->f, APR_SET, &abs_pos) != APR_SUCCESS) { - /* ### should check whether ap_seek set abs_pos was set to the + if (apr_seek(stream->f, APR_SET, &abs_pos) != APR_SUCCESS) { + /* ### should check whether apr_seek set abs_pos was set to the * correct position? */ /* ### use something besides 500? */ return dav_new_error(stream->p, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -853,7 +853,7 @@ static dav_error * dav_fs_set_headers(request_rec *r, ap_set_etag(r); /* we accept byte-ranges */ - ap_table_setn(r->headers_out, "Accept-Ranges", "bytes"); + apr_table_setn(r->headers_out, "Accept-Ranges", "bytes"); /* set up the Content-Length header */ ap_set_content_length(r, resource->info->finfo.size); @@ -880,12 +880,12 @@ static void dav_fs_free_file(void *free_handle) /* nothing to free ... */ } -static dav_error * dav_fs_create_collection(ap_pool_t *p, dav_resource *resource) +static dav_error * dav_fs_create_collection(apr_pool_t *p, dav_resource *resource) { dav_resource_private *ctx = resource->info; - ap_status_t status; + apr_status_t status; - status = ap_make_dir(ctx->pathname, APR_OS_DEFAULT, p); + status = apr_make_dir(ctx->pathname, APR_OS_DEFAULT, p); if (status == ENOSPC) { return dav_new_error(p, HTTP_INSUFFICIENT_STORAGE, 0, "There is not enough storage to create " @@ -920,7 +920,7 @@ static dav_error * dav_fs_copymove_walker(dav_walker_ctx *ctx, int calltype) } else { /* copy/move of a collection. Create the new, target collection */ - if (ap_make_dir(dstinfo->pathname, APR_OS_DEFAULT, ctx->pool) + if (apr_make_dir(dstinfo->pathname, APR_OS_DEFAULT, ctx->pool) != APR_SUCCESS) { /* ### assume it was a permissions problem */ /* ### need a description here */ @@ -1081,13 +1081,13 @@ static dav_error * dav_fs_move_resource( } else { const char *dirpath; - ap_finfo_t finfo; + apr_finfo_t finfo; /* destination does not exist, but the parent directory should, * so try it */ dirpath = ap_make_dirstr_parent(dstinfo->pool, dstinfo->pathname); - if (ap_stat(&finfo, dirpath, dstinfo->pool) == 0 + if (apr_stat(&finfo, dirpath, dstinfo->pool) == 0 && finfo.device == srcinfo->finfo.device) { can_rename = 1; } @@ -1113,7 +1113,7 @@ static dav_error * dav_fs_move_resource( *response = NULL; /* ### APR has no rename? */ - if (ap_rename_file(srcinfo->pathname, dstinfo->pathname, + if (apr_rename_file(srcinfo->pathname, dstinfo->pathname, srcinfo->pool) != APR_SUCCESS) { /* ### should have a better error than this. */ return dav_new_error(srcinfo->pool, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -1133,7 +1133,7 @@ static dav_error * dav_fs_move_resource( } /* error occurred during properties move; try to put resource back */ - if (ap_rename_file(dstinfo->pathname, srcinfo->pathname, + if (apr_rename_file(dstinfo->pathname, srcinfo->pathname, srcinfo->pool) != APR_SUCCESS) { /* couldn't put it back! */ return dav_push_error(srcinfo->pool, @@ -1261,7 +1261,7 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth) dav_error *err = NULL; dav_walker_ctx *wctx = fsctx->wctx; int isdir = wctx->resource->collection; - ap_dir_t *dirp; + apr_dir_t *dirp; /* ensure the context is prepared properly, then call the func */ err = (*wctx->func)(wctx, @@ -1299,15 +1299,15 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth) fsctx->res2.collection = 0; /* open and scan the directory */ - if ((ap_opendir(&dirp, fsctx->path1.buf, wctx->pool)) != APR_SUCCESS) { + if ((apr_opendir(&dirp, fsctx->path1.buf, wctx->pool)) != APR_SUCCESS) { /* ### need a better error */ return dav_new_error(wctx->pool, HTTP_NOT_FOUND, 0, NULL); } - while ((ap_readdir(dirp)) == APR_SUCCESS) { + while ((apr_readdir(dirp)) == APR_SUCCESS) { char *name; size_t len; - ap_get_dir_filename(&name, dirp); + apr_get_dir_filename(&name, dirp); len = strlen(name); /* avoid recursing into our current, parent, or state directories */ @@ -1333,7 +1333,7 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth) /* append this file onto the path buffer (copy null term) */ dav_buffer_place_mem(wctx->pool, &fsctx->path1, name, len + 1, 0); - if (ap_lstat(&fsctx->info1.finfo, fsctx->path1.buf, wctx->pool) != 0) { + if (apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, wctx->pool) != 0) { /* woah! where'd it go? */ /* ### should have a better error here */ err = dav_new_error(wctx->pool, HTTP_NOT_FOUND, 0, NULL); @@ -1402,7 +1402,7 @@ static dav_error * dav_fs_walker(dav_fs_walker_context *fsctx, int depth) } /* ### check the return value of this? */ - ap_closedir(dirp); + apr_closedir(dirp); if (err != NULL) return err; @@ -1603,16 +1603,16 @@ static const char *dav_fs_getetag(const dav_resource *resource) dav_resource_private *ctx = resource->info; if (!resource->exists) - return ap_pstrdup(ctx->pool, ""); + return apr_pstrdup(ctx->pool, ""); if (ctx->finfo.protection != 0) { - return ap_psprintf(ctx->pool, "\"%lx-%lx-%lx\"", + return apr_psprintf(ctx->pool, "\"%lx-%lx-%lx\"", (unsigned long) ctx->finfo.inode, (unsigned long) ctx->finfo.size, (unsigned long) ctx->finfo.mtime); } - return ap_psprintf(ctx->pool, "\"%lx\"", (unsigned long) ctx->finfo.mtime); + return apr_psprintf(ctx->pool, "\"%lx\"", (unsigned long) ctx->finfo.mtime); } static const dav_hooks_repository dav_hooks_repository_fs = @@ -1673,7 +1673,7 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource, const char *value; const char *s; dav_prop_insert which; - ap_pool_t *p = resource->info->pool; + apr_pool_t *p = resource->info->pool; const dav_fs_liveprop_name *scan; int ns; @@ -1774,13 +1774,13 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource, if (insvalue) { /* use D: prefix to refer to the DAV: namespace URI */ - s = ap_psprintf(p, "%s" DEBUG_CR, + s = apr_psprintf(p, "%s" DEBUG_CR, ns, scan->name, value, ns, scan->name); which = DAV_PROP_INSERT_VALUE; } else { /* use D: prefix to refer to the DAV: namespace URI */ - s = ap_psprintf(p, "" DEBUG_CR, ns, scan->name); + s = apr_psprintf(p, "" DEBUG_CR, ns, scan->name); which = DAV_PROP_INSERT_NAME; } ap_text_append(p, phdr, s); @@ -1914,7 +1914,7 @@ static dav_error *dav_fs_patch_exec(dav_resource *resource, dav_liveprop_rollback **rollback_ctx) { int value = context != NULL; - ap_fileperms_t perms = resource->info->finfo.protection; + apr_fileperms_t perms = resource->info->finfo.protection; int old_value = (perms & APR_UEXECUTE) != 0; /* assert: prop == executable. operation == SET. */ @@ -1928,7 +1928,7 @@ static dav_error *dav_fs_patch_exec(dav_resource *resource, if (value) perms |= APR_UEXECUTE; - if (ap_setfileperms(resource->info->pathname, perms) != APR_SUCCESS) { + if (apr_setfileperms(resource->info->pathname, perms) != APR_SUCCESS) { return dav_new_error(resource->info->pool, HTTP_INTERNAL_SERVER_ERROR, 0, "Could not set the executable flag of the " @@ -1955,7 +1955,7 @@ static dav_error *dav_fs_patch_rollback(dav_resource *resource, void *context, dav_liveprop_rollback *rollback_ctx) { - ap_fileperms_t perms = resource->info->finfo.protection & ~APR_UEXECUTE; + apr_fileperms_t perms = resource->info->finfo.protection & ~APR_UEXECUTE; int value = rollback_ctx != NULL; /* assert: prop == executable. operation == SET. */ @@ -1964,7 +1964,7 @@ static dav_error *dav_fs_patch_rollback(dav_resource *resource, if (value) perms |= APR_UEXECUTE; - if (ap_setfileperms(resource->info->pathname, perms) != APR_SUCCESS) { + if (apr_setfileperms(resource->info->pathname, perms) != APR_SUCCESS) { return dav_new_error(resource->info->pool, HTTP_INTERNAL_SERVER_ERROR, 0, "After a failure occurred, the resource's " @@ -2005,7 +2005,7 @@ int dav_fs_hook_get_resource(request_rec *r, const char *root_dir, if (resource == NULL) return DECLINED; - (void) ap_set_userdata(resource, DAV_KEY_RESOURCE, ap_null_cleanup, + (void) apr_set_userdata(resource, DAV_KEY_RESOURCE, apr_null_cleanup, r->pool); return OK; } @@ -2020,10 +2020,10 @@ const dav_hooks_propdb *dav_fs_get_propdb_hooks(request_rec *r) return &dav_hooks_db_dbm; } -void dav_fs_gather_propsets(ap_array_header_t *uris) +void dav_fs_gather_propsets(apr_array_header_t *uris) { #ifndef WIN32 - *(const char **)ap_push_array(uris) = + *(const char **)apr_push_array(uris) = ""; #endif } @@ -2046,7 +2046,7 @@ void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource, dav_fs_insert_all(resource, insvalue, phdr); } -void dav_fs_register_uris(ap_pool_t *p) +void dav_fs_register_uris(apr_pool_t *p) { const char * const * uris = dav_fs_namespace_uris; diff --git a/modules/dav/fs/repos.h b/modules/dav/fs/repos.h index 2ecf314f59..a580487748 100644 --- a/modules/dav/fs/repos.h +++ b/modules/dav/fs/repos.h @@ -66,10 +66,10 @@ /* ensure that our state subdirectory is present */ -void dav_fs_ensure_state_dir(ap_pool_t *p, const char *dirname); +void dav_fs_ensure_state_dir(apr_pool_t *p, const char *dirname); /* return the storage pool associated with a resource */ -ap_pool_t *dav_fs_pool(const dav_resource *resource); +apr_pool_t *dav_fs_pool(const dav_resource *resource); /* return the full pathname for a resource */ const char *dav_fs_pathname(const dav_resource *resource); @@ -87,9 +87,9 @@ dav_error * dav_fs_get_locknull_members(const dav_resource *resource, /* DBM functions used by the repository and locking providers */ extern const dav_hooks_db dav_hooks_db_dbm; -dav_error * dav_dbm_open_direct(ap_pool_t *p, const char *pathname, int ro, +dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, dav_db **pdb); -void dav_dbm_get_statefiles(ap_pool_t *p, const char *fname, +void dav_dbm_get_statefiles(apr_pool_t *p, const char *fname, const char **state1, const char **state2); /* where is the lock database located? */ @@ -100,12 +100,12 @@ int dav_fs_hook_get_resource(request_rec *r, const char *root_dir, const dav_hooks_locks *dav_fs_get_lock_hooks(request_rec *r); const dav_hooks_propdb *dav_fs_get_propdb_hooks(request_rec *r); -void dav_fs_gather_propsets(ap_array_header_t *uris); +void dav_fs_gather_propsets(apr_array_header_t *uris); int dav_fs_find_liveprop(request_rec *r, const char *ns_uri, const char *name, const dav_hooks_liveprop **hooks); void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource, int insvalue, ap_text_header *phdr); -void dav_fs_register_uris(ap_pool_t *p); +void dav_fs_register_uris(apr_pool_t *p); #endif /* _DAV_FS_REPOS_H_ */ diff --git a/modules/dav/main/liveprop.c b/modules/dav/main/liveprop.c index cd720feb22..2db0956d7e 100644 --- a/modules/dav/main/liveprop.c +++ b/modules/dav/main/liveprop.c @@ -62,18 +62,18 @@ #include "mod_dav.h" -static ap_hash_t *dav_liveprop_uris = NULL; +static apr_hash_t *dav_liveprop_uris = NULL; static int dav_liveprop_count = 0; -static ap_status_t dav_cleanup_liveprops(void *ctx) +static apr_status_t dav_cleanup_liveprops(void *ctx) { dav_liveprop_uris = NULL; dav_liveprop_count = 0; return APR_SUCCESS; } -void dav_register_liveprop_namespace(ap_pool_t *p, const char *uri) +void dav_register_liveprop_namespace(apr_pool_t *p, const char *uri) { int value; @@ -81,23 +81,23 @@ void dav_register_liveprop_namespace(ap_pool_t *p, const char *uri) p = ap_global_hook_pool; if (dav_liveprop_uris == NULL) { - dav_liveprop_uris = ap_make_hash(p); - ap_register_cleanup(p, NULL, dav_cleanup_liveprops, ap_null_cleanup); + dav_liveprop_uris = apr_make_hash(p); + apr_register_cleanup(p, NULL, dav_cleanup_liveprops, apr_null_cleanup); } - value = (int)ap_hash_get(dav_liveprop_uris, uri, 0); + value = (int)apr_hash_get(dav_liveprop_uris, uri, 0); if (value != 0) { /* already registered */ return; } /* start at 1, and count up */ - ap_hash_set(dav_liveprop_uris, uri, 0, (void *)++dav_liveprop_count); + apr_hash_set(dav_liveprop_uris, uri, 0, (void *)++dav_liveprop_count); } int dav_get_liveprop_ns_index(const char *uri) { - return (int)ap_hash_get(dav_liveprop_uris, uri, 0); + return (int)apr_hash_get(dav_liveprop_uris, uri, 0); } int dav_get_liveprop_ns_count(void) @@ -105,18 +105,18 @@ int dav_get_liveprop_ns_count(void) return dav_liveprop_count; } -void dav_add_all_liveprop_xmlns(ap_pool_t *p, ap_text_header *phdr) +void dav_add_all_liveprop_xmlns(apr_pool_t *p, ap_text_header *phdr) { - ap_hash_index_t *idx = ap_hash_first(dav_liveprop_uris); + apr_hash_index_t *idx = apr_hash_first(dav_liveprop_uris); - for ( ; idx != NULL; idx = ap_hash_next(idx) ) { + for ( ; idx != NULL; idx = apr_hash_next(idx) ) { const void *key; void *val; const char *s; - ap_hash_this(idx, &key, NULL, &val); + apr_hash_this(idx, &key, NULL, &val); - s = ap_psprintf(p, " xmlns:lp%d=\"%s\"", (int)val, key); + s = apr_psprintf(p, " xmlns:lp%d=\"%s\"", (int)val, key); ap_text_append(p, phdr, s); } } diff --git a/modules/dav/main/mod_dav.c b/modules/dav/main/mod_dav.c index 01b6a067d1..a74aa0de63 100644 --- a/modules/dav/main/mod_dav.c +++ b/modules/dav/main/mod_dav.c @@ -108,7 +108,7 @@ typedef struct { int handle_get; /* cached from repository hook structure */ int allow_depthinfinity; - ap_table_t *d_params; /* per-directory DAV config parameters */ + apr_table_t *d_params; /* per-directory DAV config parameters */ } dav_dir_conf; @@ -125,7 +125,7 @@ typedef struct { /* forward-declare for use in configuration lookup */ extern module MODULE_VAR_EXPORT dav_module; -static void dav_init_handler(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, +static void dav_init_handler(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { /* DBG0("dav_init_handler"); */ @@ -133,23 +133,23 @@ static void dav_init_handler(ap_pool_t *p, ap_pool_t *plog, ap_pool_t *ptemp, ap_add_version_component(p, "DAV/" DAV_VERSION); } -static void *dav_create_server_config(ap_pool_t *p, server_rec *s) +static void *dav_create_server_config(apr_pool_t *p, server_rec *s) { dav_server_conf *newconf; - newconf = (dav_server_conf *) ap_pcalloc(p, sizeof(*newconf)); + newconf = (dav_server_conf *) apr_pcalloc(p, sizeof(*newconf)); dav_create_uuid_state(&newconf->st); return newconf; } -static void *dav_merge_server_config(ap_pool_t *p, void *base, void *overrides) +static void *dav_merge_server_config(apr_pool_t *p, void *base, void *overrides) { dav_server_conf *child = overrides; dav_server_conf *newconf; - newconf = (dav_server_conf *) ap_pcalloc(p, sizeof(*newconf)); + newconf = (dav_server_conf *) apr_pcalloc(p, sizeof(*newconf)); /* ### hmm. we should share the uuid state rather than copy it. if we ### do another merge, then we'll just get the old one, rather than @@ -161,24 +161,24 @@ static void *dav_merge_server_config(ap_pool_t *p, void *base, void *overrides) return newconf; } -static void *dav_create_dir_config(ap_pool_t *p, char *dir) +static void *dav_create_dir_config(apr_pool_t *p, char *dir) { /* NOTE: dir==NULL creates the default per-dir config */ dav_dir_conf *conf; - conf = (dav_dir_conf *) ap_pcalloc(p, sizeof(*conf)); - conf->dir = ap_pstrdup(p, dir); - conf->d_params = ap_make_table(p, 1); + conf = (dav_dir_conf *) apr_pcalloc(p, sizeof(*conf)); + conf->dir = apr_pstrdup(p, dir); + conf->d_params = apr_make_table(p, 1); return conf; } -static void *dav_merge_dir_config(ap_pool_t *p, void *base, void *overrides) +static void *dav_merge_dir_config(apr_pool_t *p, void *base, void *overrides) { dav_dir_conf *parent = base; dav_dir_conf *child = overrides; - dav_dir_conf *newconf = (dav_dir_conf *) ap_pcalloc(p, sizeof(*newconf)); + dav_dir_conf *newconf = (dav_dir_conf *) apr_pcalloc(p, sizeof(*newconf)); /* DBG3("dav_merge_dir_config: new=%08lx base=%08lx overrides=%08lx", (long)newconf, (long)base, (long)overrides); */ @@ -189,8 +189,8 @@ static void *dav_merge_dir_config(ap_pool_t *p, void *base, void *overrides) newconf->allow_depthinfinity = DAV_INHERIT_VALUE(parent, child, allow_depthinfinity); - newconf->d_params = ap_copy_table(p, parent->d_params); - ap_overlap_tables(newconf->d_params, child->d_params, + newconf->d_params = apr_copy_table(p, parent->d_params); + apr_overlap_tables(newconf->d_params, child->d_params, AP_OVERLAP_TABLES_SET); return newconf; @@ -205,7 +205,7 @@ uuid_state *dav_get_uuid_state(const request_rec *r) return &conf->st; } -ap_table_t *dav_get_dir_params(const request_rec *r) +apr_table_t *dav_get_dir_params(const request_rec *r) { dav_dir_conf *conf; @@ -218,10 +218,10 @@ const dav_hooks_locks *dav_get_lock_hooks(request_rec *r) void *data; const dav_hooks_locks *hooks; - (void) ap_get_userdata(&data, DAV_KEY_LOCK_HOOKS, r->pool); + (void) apr_get_userdata(&data, DAV_KEY_LOCK_HOOKS, r->pool); if (data == NULL) { hooks = ap_run_get_lock_hooks(r); - (void) ap_set_userdata(hooks, DAV_KEY_LOCK_HOOKS, ap_null_cleanup, + (void) apr_set_userdata(hooks, DAV_KEY_LOCK_HOOKS, apr_null_cleanup, r->pool); } else @@ -234,10 +234,10 @@ const dav_hooks_propdb *dav_get_propdb_hooks(request_rec *r) void *data; const dav_hooks_db *hooks; - (void) ap_get_userdata(&data, DAV_KEY_PROPDB_HOOKS, r->pool); + (void) apr_get_userdata(&data, DAV_KEY_PROPDB_HOOKS, r->pool); if (data == NULL) { hooks = ap_run_get_propdb_hooks(r); - (void) ap_set_userdata(hooks, DAV_KEY_PROPDB_HOOKS, ap_null_cleanup, + (void) apr_set_userdata(hooks, DAV_KEY_PROPDB_HOOKS, apr_null_cleanup, r->pool); } else @@ -250,10 +250,10 @@ const dav_hooks_vsn *dav_get_vsn_hooks(request_rec *r) void *data; const dav_hooks_vsn *hooks; - (void) ap_get_userdata(&data, DAV_KEY_VSN_HOOKS, r->pool); + (void) apr_get_userdata(&data, DAV_KEY_VSN_HOOKS, r->pool); if (data == NULL) { hooks = ap_run_get_vsn_hooks(r); - (void) ap_set_userdata(hooks, DAV_KEY_VSN_HOOKS, ap_null_cleanup, + (void) apr_set_userdata(hooks, DAV_KEY_VSN_HOOKS, apr_null_cleanup, r->pool); } else @@ -313,7 +313,7 @@ static const char *dav_cmd_davparam(cmd_parms *cmd, void *config, { dav_dir_conf *conf = (dav_dir_conf *) config; - ap_table_set(conf->d_params, arg1, arg2); + apr_table_set(conf->d_params, arg1, arg2); return NULL; } @@ -361,7 +361,7 @@ static int dav_error_response(request_rec *r, int status, const char *body) ** in a URI (to form a query section). We must explicitly handle it so that ** we can embed the URI into an XML document. */ -static const char *dav_xml_escape_uri(ap_pool_t *p, const char *uri) +static const char *dav_xml_escape_uri(apr_pool_t *p, const char *uri) { const char *e_uri = ap_escape_uri(p, uri); @@ -380,7 +380,7 @@ static const char *dav_xml_escape_uri(ap_pool_t *p, const char *uri) static void dav_send_multistatus(request_rec *r, int status, dav_response *first, - ap_array_header_t *namespaces) + apr_array_header_t *namespaces) { /* Set the correct status and Content-Type */ r->status = status; @@ -501,7 +501,7 @@ static int dav_handle_err(request_rec *r, dav_error *err, if (response == NULL) { /* our error messages are safe; tell Apache this */ - ap_table_setn(r->notes, "verbose-error-to", "*"); + apr_table_setn(r->notes, "verbose-error-to", "*"); return err->status; } @@ -537,14 +537,14 @@ static int dav_created(request_rec *r, request_rec *rnew, * ### the Location header requires an absoluteURI. where to get it? */ /* ### disable until we get the right value */ #if 0 - ap_table_setn(r->headers_out, "Location", rnew->uri); + apr_table_setn(r->headers_out, "Location", rnew->uri); #endif /* ### insert an ETag header? see HTTP/1.1 S10.2.2 */ /* Apache doesn't allow us to set a variable body for HTTP_CREATED, so * we must manufacture the entire response. */ - body = ap_psprintf(r->pool, "%s %s has been created.", + body = apr_psprintf(r->pool, "%s %s has been created.", what, ap_escape_html(rnew->pool, rnew->uri)); return dav_error_response(r, HTTP_CREATED, body); @@ -553,7 +553,7 @@ static int dav_created(request_rec *r, request_rec *rnew, /* ### move to dav_util? */ int dav_get_depth(request_rec *r, int def_depth) { - const char *depth = ap_table_get(r->headers_in, "Depth"); + const char *depth = apr_table_get(r->headers_in, "Depth"); if (depth == NULL) { return def_depth; @@ -577,7 +577,7 @@ int dav_get_depth(request_rec *r, int def_depth) static int dav_get_overwrite(request_rec *r) { - const char *overwrite = ap_table_get(r->headers_in, "Overwrite"); + const char *overwrite = apr_table_get(r->headers_in, "Overwrite"); if (overwrite == NULL) { return 1; /* default is "T" */ @@ -603,7 +603,7 @@ static int dav_get_resource(request_rec *r, dav_resource **res_p) void *data; /* go look for the resource if it isn't already present */ - (void) ap_get_userdata(&data, DAV_KEY_RESOURCE, r->pool); + (void) apr_get_userdata(&data, DAV_KEY_RESOURCE, r->pool); if (data == NULL) { dav_dir_conf *conf; int rv; @@ -619,7 +619,7 @@ static int dav_get_resource(request_rec *r, dav_resource **res_p) else if (rv != OK) return rv; - (void) ap_get_userdata(&data, DAV_KEY_RESOURCE, r->pool); + (void) apr_get_userdata(&data, DAV_KEY_RESOURCE, r->pool); } *res_p = data; @@ -647,11 +647,11 @@ static int dav_parse_range(request_rec *r, char *dash; char *slash; - range_c = ap_table_get(r->headers_in, "content-range"); + range_c = apr_table_get(r->headers_in, "content-range"); if (range_c == NULL) return 0; - range = ap_pstrdup(r->pool, range_c); + range = apr_pstrdup(r->pool, range_c); if (strncasecmp(range, "bytes ", 6) != 0 || (dash = ap_strchr(range, '-')) == NULL || (slash = ap_strchr(range, '/')) == NULL) { @@ -783,9 +783,9 @@ static int dav_method_get(request_rec *r) /* prep the output */ r->status = HTTP_PARTIAL_CONTENT; - ap_table_setn(r->headers_out, + apr_table_setn(r->headers_out, "Content-Range", - ap_psprintf(r->pool, "bytes %ld-%ld/*", + apr_psprintf(r->pool, "bytes %ld-%ld/*", range_start, range_end)); ap_set_content_length(r, range_end - range_start + 1); } @@ -799,7 +799,7 @@ static int dav_method_get(request_rec *r) &stream)) != NULL) { /* ### assuming FORBIDDEN is probably not quite right... */ err = dav_push_error(r->pool, HTTP_FORBIDDEN, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Unable to GET contents for %s.", ap_escape_html(r->pool, r->uri)), err); @@ -818,7 +818,7 @@ static int dav_method_get(request_rec *r) /* all set. send the headers now. */ ap_send_http_header(r); - buffer = ap_palloc(r->pool, DAV_READ_BLOCKSIZE); + buffer = apr_palloc(r->pool, DAV_READ_BLOCKSIZE); while (1) { size_t amt; @@ -923,7 +923,7 @@ static int dav_method_put(request_rec *r) /* If not a file or collection resource, PUT not allowed */ if (resource->type != DAV_RESOURCE_TYPE_REGULAR) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Cannot create resource %s with PUT.", ap_escape_html(r->pool, r->uri)); return dav_error_response(r, HTTP_CONFLICT, body); @@ -979,7 +979,7 @@ static int dav_method_put(request_rec *r) &stream)) != NULL) { /* ### assuming FORBIDDEN is probably not quite right... */ err = dav_push_error(r->pool, HTTP_FORBIDDEN, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Unable to PUT new contents for %s.", ap_escape_html(r->pool, r->uri)), err); @@ -992,7 +992,7 @@ static int dav_method_put(request_rec *r) if (err == NULL) { if (ap_should_client_block(r)) { - char *buffer = ap_palloc(r->pool, DAV_READ_BLOCKSIZE); + char *buffer = apr_palloc(r->pool, DAV_READ_BLOCKSIZE); long len; /* @@ -1109,8 +1109,8 @@ void dav_add_response(dav_walker_ctx *ctx, const char *href, int status, dav_response *resp; /* just drop some data into an dav_response */ - resp = ap_pcalloc(ctx->pool, sizeof(*resp)); - resp->href = ap_pstrdup(ctx->pool, href); + resp = apr_pcalloc(ctx->pool, sizeof(*resp)); + resp->href = apr_pstrdup(ctx->pool, href); resp->status = status; if (propstats) { resp->propresult = *propstats; @@ -1169,7 +1169,7 @@ static int dav_method_delete(request_rec *r) /* ### allow DAV_RESOURCE_TYPE_REVISION with All-Bindings header */ if (resource->type != DAV_RESOURCE_TYPE_REGULAR && resource->type != DAV_RESOURCE_TYPE_WORKSPACE) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Cannot delete resource %s.", ap_escape_html(r->pool, r->uri)); return dav_error_response(r, HTTP_CONFLICT, body); @@ -1188,7 +1188,7 @@ static int dav_method_delete(request_rec *r) DAV_VALIDATE_PARENT | DAV_VALIDATE_USE_424, NULL)) != NULL) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not DELETE %s due to a failed " "precondition (e.g. locks).", ap_escape_html(r->pool, r->uri)), @@ -1223,7 +1223,7 @@ static int dav_method_delete(request_rec *r) /* check for errors now */ if (err != NULL) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not DELETE %s.", ap_escape_html(r->pool, r->uri)), err); @@ -1255,7 +1255,7 @@ static int dav_method_options(request_rec *r) const char *dav_level; const char *vsn_level; int result; - ap_array_header_t *uri_ary; + apr_array_header_t *uri_ary; const char *uris; /* per HTTP/1.1 S9.2, we can discard this body */ @@ -1283,15 +1283,15 @@ static int dav_method_options(request_rec *r) } /* gather property set URIs from all the liveprop providers */ - uri_ary = ap_make_array(r->pool, 5, sizeof(const char *)); + uri_ary = apr_make_array(r->pool, 5, sizeof(const char *)); ap_run_gather_propsets(uri_ary); - uris = ap_array_pstrcat(r->pool, uri_ary, ','); + uris = apr_array_pstrcat(r->pool, uri_ary, ','); if (*uris) { - dav_level = ap_pstrcat(r->pool, dav_level, ",", uris, NULL); + dav_level = apr_pstrcat(r->pool, dav_level, ",", uris, NULL); } /* this tells MSFT products to skip looking for FrontPage extensions */ - ap_table_setn(r->headers_out, "MS-Author-Via", "DAV"); + apr_table_setn(r->headers_out, "MS-Author-Via", "DAV"); /* ** Three cases: resource is null (3), is lock-null (7.4), or exists. @@ -1308,7 +1308,7 @@ static int dav_method_options(request_rec *r) case DAV_RESOURCE_EXISTS: /* resource exists */ if (resource->collection) { - options = ap_pstrcat(r->pool, + options = apr_pstrcat(r->pool, "OPTIONS, " "GET, HEAD, POST, DELETE, TRACE, " "PROPFIND, PROPPATCH, COPY, MOVE", @@ -1317,7 +1317,7 @@ static int dav_method_options(request_rec *r) } else { /* files also support PUT */ - options = ap_pstrcat(r->pool, + options = apr_pstrcat(r->pool, "OPTIONS, " "GET, HEAD, POST, DELETE, TRACE, " "PROPFIND, PROPPATCH, COPY, MOVE, PUT", @@ -1328,14 +1328,14 @@ static int dav_method_options(request_rec *r) case DAV_RESOURCE_LOCK_NULL: /* resource is lock-null. */ - options = ap_pstrcat(r->pool, "OPTIONS, MKCOL, PUT, PROPFIND", + options = apr_pstrcat(r->pool, "OPTIONS, MKCOL, PUT, PROPFIND", locks_hooks != NULL ? ", LOCK, UNLOCK" : "", NULL); break; case DAV_RESOURCE_NULL: /* resource is null. */ - options = ap_pstrcat(r->pool, "OPTIONS, MKCOL, PUT", + options = apr_pstrcat(r->pool, "OPTIONS, MKCOL, PUT", locks_hooks != NULL ? ", LOCK" : "", NULL); break; @@ -1365,14 +1365,14 @@ static int dav_method_options(request_rec *r) vsn_options = ", CHECKOUT"; if (vsn_options != NULL) - options = ap_pstrcat(r->pool, options, vsn_options, NULL); + options = apr_pstrcat(r->pool, options, vsn_options, NULL); } - ap_table_setn(r->headers_out, "Allow", options); - ap_table_setn(r->headers_out, "DAV", dav_level); + apr_table_setn(r->headers_out, "Allow", options); + apr_table_setn(r->headers_out, "DAV", dav_level); if (vsn_level != NULL) - ap_table_setn(r->headers_out, "Versioning", vsn_level); + apr_table_setn(r->headers_out, "Versioning", vsn_level); /* ### this will send a Content-Type. the default OPTIONS does not. */ ap_send_http_header(r); @@ -1496,7 +1496,7 @@ static int dav_method_propfind(request_rec *r) /* default is to DISALLOW these requests */ if (conf->allow_depthinfinity != DAV_ENABLED_ON) { return dav_error_response(r, HTTP_FORBIDDEN, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "PROPFIND requests with a " "Depth of \"infinity\" are " "not allowed for %s.", @@ -1593,8 +1593,8 @@ static int dav_method_propfind(request_rec *r) return DONE; } -static ap_text * dav_failed_proppatch(ap_pool_t *p, - ap_array_header_t *prop_ctx) +static ap_text * dav_failed_proppatch(apr_pool_t *p, + apr_array_header_t *prop_ctx) { ap_text_header hdr = { 0 }; int i = prop_ctx->nelts; @@ -1634,7 +1634,7 @@ static ap_text * dav_failed_proppatch(ap_pool_t *p, } } - s = ap_psprintf(p, + s = apr_psprintf(p, "" "HTTP/1.1 %d (status)" "" DEBUG_CR, @@ -1654,7 +1654,7 @@ static ap_text * dav_failed_proppatch(ap_pool_t *p, return hdr.first; } -static ap_text * dav_success_proppatch(ap_pool_t *p, ap_array_header_t *prop_ctx) +static ap_text * dav_success_proppatch(apr_pool_t *p, apr_array_header_t *prop_ctx) { ap_text_header hdr = { 0 }; int i = prop_ctx->nelts; @@ -1697,7 +1697,7 @@ static void dav_prop_log_errors(dav_prop_ctx *ctx) ** reverse order. */ static int dav_process_ctx_list(void (*func)(dav_prop_ctx *ctx), - ap_array_header_t *ctx_list, int stop_on_error, + apr_array_header_t *ctx_list, int stop_on_error, int reverse) { int i = ctx_list->nelts; @@ -1734,7 +1734,7 @@ static int dav_method_proppatch(request_rec *r) int failure = 0; dav_response resp = { 0 }; ap_text *propstat_text; - ap_array_header_t *ctx_list; + apr_array_header_t *ctx_list; dav_prop_ctx *ctx; /* Ask repository module to resolve the resource */ @@ -1770,7 +1770,7 @@ static int dav_method_proppatch(request_rec *r) if ((err = dav_open_propdb(r, NULL, resource, 0, doc->namespaces, &propdb)) != NULL) { err = dav_push_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not open the property " "database for %s.", ap_escape_html(r->pool, r->uri)), @@ -1782,7 +1782,7 @@ static int dav_method_proppatch(request_rec *r) /* ### validate "live" properties */ /* set up an array to hold property operation contexts */ - ctx_list = ap_make_array(r->pool, 10, sizeof(dav_prop_ctx)); + ctx_list = apr_make_array(r->pool, 10, sizeof(dav_prop_ctx)); /* do a first pass to ensure that all "remove" properties exist */ for (child = doc->root->first_child; child; child = child->next) { @@ -1811,7 +1811,7 @@ static int dav_method_proppatch(request_rec *r) for (one_prop = prop_group->first_child; one_prop; one_prop = one_prop->next) { - ctx = (dav_prop_ctx *)ap_push_array(ctx_list); + ctx = (dav_prop_ctx *)apr_push_array(ctx_list); ctx->propdb = propdb; ctx->operation = is_remove ? DAV_PROP_OP_DELETE : DAV_PROP_OP_SET; ctx->prop = one_prop; @@ -1867,8 +1867,8 @@ static int process_mkcol_body(request_rec *r) * return HTTP_UNSUPPORTED_MEDIA_TYPE (while ap_setup_client_block * returns HTTP_REQUEST_ENTITY_TOO_LARGE). */ - const char *tenc = ap_table_get(r->headers_in, "Transfer-Encoding"); - const char *lenp = ap_table_get(r->headers_in, "Content-Length"); + const char *tenc = apr_table_get(r->headers_in, "Transfer-Encoding"); + const char *lenp = apr_table_get(r->headers_in, "Content-Length"); /* make sure to set the Apache request fields properly. */ r->read_body = REQUEST_NO_BODY; @@ -2073,21 +2073,21 @@ static int dav_method_copymove(request_rec *r, int is_move) /* If not a file or collection resource, COPY/MOVE not allowed */ if (resource->type != DAV_RESOURCE_TYPE_REGULAR) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Cannot COPY/MOVE resource %s.", ap_escape_html(r->pool, r->uri)); return dav_error_response(r, HTTP_METHOD_NOT_ALLOWED, body); } /* get the destination URI */ - dest = ap_table_get(r->headers_in, "Destination"); + dest = apr_table_get(r->headers_in, "Destination"); if (dest == NULL) { /* Look in headers provided by Netscape's Roaming Profiles */ - const char *nscp_host = ap_table_get(r->headers_in, "Host"); - const char *nscp_path = ap_table_get(r->headers_in, "New-uri"); + const char *nscp_host = apr_table_get(r->headers_in, "Host"); + const char *nscp_path = apr_table_get(r->headers_in, "New-uri"); if (nscp_host != NULL && nscp_path != NULL) - dest = ap_psprintf(r->pool, "http://%s%s", nscp_host, nscp_path); + dest = apr_psprintf(r->pool, "http://%s%s", nscp_host, nscp_path); } if (dest == NULL) { /* This supplies additional information for the default message. */ @@ -2195,7 +2195,7 @@ static int dav_method_copymove(request_rec *r, int is_move) | DAV_VALIDATE_USE_424, NULL)) != NULL) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not MOVE %s due to a failed " "precondition on the source " "(e.g. locks).", @@ -2219,7 +2219,7 @@ static int dav_method_copymove(request_rec *r, int is_move) DAV_VALIDATE_PARENT | DAV_VALIDATE_USE_424, NULL)) != NULL) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not MOVE/COPY %s due to a " "failed precondition on the " "destination (e.g. locks).", @@ -2366,7 +2366,7 @@ static int dav_method_copymove(request_rec *r, int is_move) (*lockdb->hooks->close_lockdb)(lockdb); err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not MOVE/COPY %s.", ap_escape_html(r->pool, r->uri)), err); @@ -2470,7 +2470,7 @@ static int dav_method_lock(request_rec *r) } new_lock_request = 1; - lock->auth_user = ap_pstrdup(r->pool, r->user); + lock->auth_user = apr_pstrdup(r->pool, r->user); } resource_state = dav_get_resource_state(r, resource); @@ -2490,7 +2490,7 @@ static int dav_method_lock(request_rec *r) | DAV_VALIDATE_ADD_LD, lockdb)) != OK) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not LOCK %s due to a failed " "precondition (e.g. other locks).", ap_escape_html(r->pool, r->uri)), @@ -2511,7 +2511,7 @@ static int dav_method_lock(request_rec *r) if ((err = dav_get_locktoken_list(r, <l)) != NULL) { err = dav_push_error(r->pool, err->status, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "The lock refresh for %s failed " "because no lock tokens were " "specified in an \"If:\" " @@ -2546,11 +2546,11 @@ static int dav_method_lock(request_rec *r) goto error; } - locktoken_txt = ap_pstrcat(r->pool, "<", + locktoken_txt = apr_pstrcat(r->pool, "<", (*locks_hooks->format_locktoken)(r->pool, lock->locktoken), ">", NULL); - ap_table_set(r->headers_out, "Lock-Token", locktoken_txt); + apr_table_set(r->headers_out, "Lock-Token", locktoken_txt); } (*locks_hooks->close_lockdb)(lockdb); @@ -2600,13 +2600,13 @@ static int dav_method_unlock(request_rec *r) if (locks_hooks == NULL) return DECLINED; - if ((const_locktoken_txt = ap_table_get(r->headers_in, "Lock-Token")) == NULL) { + if ((const_locktoken_txt = apr_table_get(r->headers_in, "Lock-Token")) == NULL) { ap_log_rerror(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r, "Unlock failed (%s): No Lock-Token specified in header", r->filename); return HTTP_BAD_REQUEST; } - locktoken_txt = ap_pstrdup(r->pool, const_locktoken_txt); + locktoken_txt = apr_pstrdup(r->pool, const_locktoken_txt); if (locktoken_txt[0] != '<') { /* ### should provide more specifics... */ return HTTP_BAD_REQUEST; @@ -2622,7 +2622,7 @@ static int dav_method_unlock(request_rec *r) if ((err = (*locks_hooks->parse_locktoken)(r->pool, locktoken_txt, &locktoken)) != NULL) { err = dav_push_error(r->pool, HTTP_BAD_REQUEST, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "The UNLOCK on %s failed -- an " "invalid lock token was specified " "in the \"If:\" header.", @@ -2735,7 +2735,7 @@ static int dav_method_checkout(request_rec *r) /* Do the checkout */ if ((err = (*vsn_hooks->checkout)(resource)) != NULL) { err = dav_push_error(r->pool, HTTP_CONFLICT, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not CHECKOUT resource %s.", ap_escape_html(r->pool, r->uri)), err); @@ -2797,7 +2797,7 @@ static int dav_method_uncheckout(request_rec *r) /* Do the uncheckout */ if ((err = (*vsn_hooks->uncheckout)(resource)) != NULL) { err = dav_push_error(r->pool, HTTP_CONFLICT, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not UNCHECKOUT resource %s.", ap_escape_html(r->pool, r->uri)), err); @@ -2859,7 +2859,7 @@ static int dav_method_checkin(request_rec *r) /* Do the checkin */ if ((err = (*vsn_hooks->checkin)(resource)) != NULL) { err = dav_push_error(r->pool, HTTP_CONFLICT, 0, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Could not CHECKIN resource %s.", ap_escape_html(r->pool, r->uri)), err); @@ -3145,7 +3145,7 @@ AP_IMPLEMENT_HOOK_RUN_FIRST(const dav_hooks_db *, get_propdb_hooks, (request_rec *r), (r), NULL); AP_IMPLEMENT_HOOK_RUN_FIRST(const dav_hooks_vsn *, get_vsn_hooks, (request_rec *r), (r), NULL); -AP_IMPLEMENT_HOOK_VOID(gather_propsets, (ap_array_header_t *uris), (uris)) +AP_IMPLEMENT_HOOK_VOID(gather_propsets, (apr_array_header_t *uris), (uris)) AP_IMPLEMENT_HOOK_RUN_FIRST(int, find_liveprop, (request_rec *r, const char *ns_uri, const char *name, diff --git a/modules/dav/main/mod_dav.h b/modules/dav/main/mod_dav.h index 12b625ee9f..bc121053a6 100644 --- a/modules/dav/main/mod_dav.h +++ b/modules/dav/main/mod_dav.h @@ -135,7 +135,7 @@ typedef struct dav_error { struct dav_error *prev; /* previous error (in stack) */ /* deferred computation of the description */ - void (*compute_desc)(struct dav_error *err, ap_pool_t *p); + void (*compute_desc)(struct dav_error *err, apr_pool_t *p); int ctx_i; const char *ctx_s; void *ctx_p; @@ -146,7 +146,7 @@ typedef struct dav_error { ** Create a new error structure. save_errno will be filled with the current ** errno value. */ -dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *desc); +dav_error *dav_new_error(apr_pool_t *p, int status, int error_id, const char *desc); /* ** Push a new error description onto the stack of errors. @@ -161,7 +161,7 @@ dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *des ** can specify a new error_id since the topmost description has ** changed. */ -dav_error *dav_push_error(ap_pool_t *p, int status, int error_id, const char *desc, +dav_error *dav_push_error(apr_pool_t *p, int status, int error_id, const char *desc, dav_error *prev); @@ -304,31 +304,31 @@ typedef struct dav_locktoken dav_locktoken; /* buffer for reuse; can grow to accomodate needed size */ typedef struct { - ap_size_t alloc_len; /* how much has been allocated */ - ap_size_t cur_len; /* how much is currently being used */ + apr_size_t alloc_len; /* how much has been allocated */ + apr_size_t cur_len; /* how much is currently being used */ char *buf; /* buffer contents */ } dav_buffer; #define DAV_BUFFER_MINSIZE 256 /* minimum size for buffer */ #define DAV_BUFFER_PAD 64 /* amount of pad when growing */ /* set the cur_len to the given size and ensure space is available */ -void dav_set_bufsize(ap_pool_t *p, dav_buffer *pbuf, ap_size_t size); +void dav_set_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t size); /* initialize a buffer and copy the specified (null-term'd) string into it */ -void dav_buffer_init(ap_pool_t *p, dav_buffer *pbuf, const char *str); +void dav_buffer_init(apr_pool_t *p, dav_buffer *pbuf, const char *str); /* check that the buffer can accomodate more bytes */ -void dav_check_bufsize(ap_pool_t *p, dav_buffer *pbuf, ap_size_t extra_needed); +void dav_check_bufsize(apr_pool_t *p, dav_buffer *pbuf, apr_size_t extra_needed); /* append a string to the end of the buffer, adjust length */ -void dav_buffer_append(ap_pool_t *p, dav_buffer *pbuf, const char *str); +void dav_buffer_append(apr_pool_t *p, dav_buffer *pbuf, const char *str); /* place a string on the end of the buffer, do NOT adjust length */ -void dav_buffer_place(ap_pool_t *p, dav_buffer *pbuf, const char *str); +void dav_buffer_place(apr_pool_t *p, dav_buffer *pbuf, const char *str); /* place some memory on the end of a buffer; do NOT adjust length */ -void dav_buffer_place_mem(ap_pool_t *p, dav_buffer *pbuf, const void *mem, - ap_size_t amt, ap_size_t pad); +void dav_buffer_place_mem(apr_pool_t *p, dav_buffer *pbuf, const void *mem, + apr_size_t amt, apr_size_t pad); /* -------------------------------------------------------------------- @@ -393,7 +393,7 @@ AP_DECLARE_HOOK(const dav_hooks_locks *, get_lock_hooks, (request_rec *r)) AP_DECLARE_HOOK(const dav_hooks_propdb *, get_propdb_hooks, (request_rec *r)) AP_DECLARE_HOOK(const dav_hooks_vsn *, get_vsn_hooks, (request_rec *r)) -AP_DECLARE_HOOK(void, gather_propsets, (ap_array_header_t *uris)) +AP_DECLARE_HOOK(void, gather_propsets, (apr_array_header_t *uris)) AP_DECLARE_HOOK(int, find_liveprop, (request_rec *r, const char *ns_uri, const char *name, const dav_hooks_liveprop **hooks)) @@ -411,10 +411,10 @@ const dav_hooks_locks *dav_get_lock_hooks(request_rec *r); const dav_hooks_propdb *dav_get_propdb_hooks(request_rec *r); const dav_hooks_vsn *dav_get_vsn_hooks(request_rec *r); -void dav_register_liveprop_namespace(ap_pool_t *pool, const char *uri); +void dav_register_liveprop_namespace(apr_pool_t *pool, const char *uri); int dav_get_liveprop_ns_index(const char *uri); int dav_get_liveprop_ns_count(void); -void dav_add_all_liveprop_xmlns(ap_pool_t *p, ap_text_header *phdr); +void dav_add_all_liveprop_xmlns(apr_pool_t *p, ap_text_header *phdr); /* ### deprecated */ @@ -472,7 +472,7 @@ typedef struct dav_if_state_list typedef struct dav_if_header { const char *uri; - ap_size_t uri_len; + apr_size_t uri_len; struct dav_if_state_list *state; struct dav_if_header *next; @@ -670,13 +670,13 @@ typedef struct dav_db dav_db; typedef struct { char *dptr; - ap_size_t dsize; + apr_size_t dsize; } dav_datum; /* hook functions to enable pluggable databases */ struct dav_hooks_propdb { - dav_error * (*open)(ap_pool_t *p, const dav_resource *resource, int ro, + dav_error * (*open)(apr_pool_t *p, const dav_resource *resource, int ro, dav_db **pdb); void (*close)(dav_db *db); @@ -860,7 +860,7 @@ struct dav_hooks_locks * in the given pool. */ dav_error * (*parse_locktoken)( - ap_pool_t *p, + apr_pool_t *p, const char *char_token, dav_locktoken **locktoken_p ); @@ -871,7 +871,7 @@ struct dav_hooks_locks * Always returns non-NULL. */ const char * (*format_locktoken)( - ap_pool_t *p, + apr_pool_t *p, const dav_locktoken *locktoken ); @@ -1064,7 +1064,7 @@ dav_error *dav_open_propdb( dav_lockdb *lockdb, dav_resource *resource, int ro, - ap_array_header_t *ns_xlate, + apr_array_header_t *ns_xlate, dav_propdb **propdb); void dav_close_propdb(dav_propdb *db); @@ -1169,7 +1169,7 @@ typedef struct dav_walker_ctx #define DAV_CALLTYPE_LOCKNULL 3 /* called for a locknull resource */ #define DAV_CALLTYPE_POSTFIX 4 /* postfix call for a collection */ - ap_pool_t *pool; + apr_pool_t *pool; request_rec *r; /* original request */ dav_buffer uri; /* current URI */ @@ -1330,7 +1330,7 @@ struct dav_hooks_repository ** on each call, until the EOF condition is met. */ dav_error * (*read_stream)(dav_stream *stream, - void *buf, ap_size_t *bufsize); + void *buf, apr_size_t *bufsize); /* ** Write data to the stream. @@ -1338,7 +1338,7 @@ struct dav_hooks_repository ** All of the bytes must be written, or an error should be returned. */ dav_error * (*write_stream)(dav_stream *stream, - const void *buf, ap_size_t bufsize); + const void *buf, apr_size_t bufsize); /* ** Seek to an absolute position in the stream. This is used to support @@ -1387,7 +1387,7 @@ struct dav_hooks_repository * is a collection. */ dav_error * (*create_collection)( - ap_pool_t *p, dav_resource *resource + apr_pool_t *p, dav_resource *resource ); /* Copy one resource to another. The destination must not exist. @@ -1551,10 +1551,10 @@ struct dav_hooks_vsn */ /* allow providers access to the per-directory parameters */ -ap_table_t *dav_get_dir_params(const request_rec *r); +apr_table_t *dav_get_dir_params(const request_rec *r); /* fetch the "LimitXMLRequestBody" in force for this resource */ -ap_size_t dav_get_limit_xml_body(const request_rec *r); +apr_size_t dav_get_limit_xml_body(const request_rec *r); typedef struct { int propid; /* live property ID */ diff --git a/modules/dav/main/props.c b/modules/dav/main/props.c index dc25925166..e2ea30b2c2 100644 --- a/modules/dav/main/props.c +++ b/modules/dav/main/props.c @@ -240,7 +240,7 @@ typedef struct { struct dav_propdb { int version; /* *minor* version of this db */ - ap_pool_t *p; /* the pool we should use */ + apr_pool_t *p; /* the pool we should use */ request_rec *r; /* the request record */ dav_resource *resource; /* the target resource */ @@ -252,7 +252,7 @@ struct dav_propdb { short ns_count; /* number of entries in table */ int ns_table_dirty; /* ns_table was modified */ - ap_array_header_t *ns_xlate; /* translation of an elem->ns to URI */ + apr_array_header_t *ns_xlate; /* translation of an elem->ns to URI */ int *ns_map; /* map elem->ns to propdb ns values */ int incomplete_map; /* some mappings do not exist */ @@ -488,7 +488,7 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, &propdb->wb_lock); /* make a copy to isolate it from changes to wb_lock */ - value = ap_pstrdup(propdb->p, propdb->wb_lock.buf); + value = apr_pstrdup(propdb->p, propdb->wb_lock.buf); } } break; @@ -515,7 +515,7 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, if (propdb->subreq == NULL) { dav_do_prop_subreq(propdb); } - if ((lang = ap_table_get(propdb->subreq->headers_out, + if ((lang = apr_table_get(propdb->subreq->headers_out, "Content-Language")) != NULL) { value = lang; } @@ -534,12 +534,12 @@ static dav_error * dav_insert_coreprop(dav_propdb *propdb, if (getvals && *value != '\0') { /* use D: prefix to refer to the DAV: namespace URI */ - s = ap_psprintf(propdb->p, "%s" DEBUG_CR, + s = apr_psprintf(propdb->p, "%s" DEBUG_CR, name, value, name); } else { /* use D: prefix to refer to the DAV: namespace URI */ - s = ap_psprintf(propdb->p, "" DEBUG_CR, name); + s = apr_psprintf(propdb->p, "" DEBUG_CR, name); } ap_text_append(propdb->p, phdr, s); @@ -597,29 +597,29 @@ static void dav_append_prop(dav_propdb *propdb, /* the property is an empty value */ if (*name == ':') { /* "no namespace" case */ - s = ap_psprintf(propdb->p, "<%s/>" DEBUG_CR, name+1); + s = apr_psprintf(propdb->p, "<%s/>" DEBUG_CR, name+1); } else { - s = ap_psprintf(propdb->p, "" DEBUG_CR, name); + s = apr_psprintf(propdb->p, "" DEBUG_CR, name); } } else if (*lang != '\0') { if (*name == ':') { /* "no namespace" case */ - s = ap_psprintf(propdb->p, "<%s xml:lang=\"%s\">%s" DEBUG_CR, + s = apr_psprintf(propdb->p, "<%s xml:lang=\"%s\">%s" DEBUG_CR, name+1, lang, value, name+1); } else { - s = ap_psprintf(propdb->p, "%s" DEBUG_CR, + s = apr_psprintf(propdb->p, "%s" DEBUG_CR, name, lang, value, name); } } else if (*name == ':') { /* "no namespace" case */ - s = ap_psprintf(propdb->p, "<%s>%s" DEBUG_CR, name+1, value, name+1); + s = apr_psprintf(propdb->p, "<%s>%s" DEBUG_CR, name+1, value, name+1); } else { - s = ap_psprintf(propdb->p, "%s" DEBUG_CR, name, value, name); + s = apr_psprintf(propdb->p, "%s" DEBUG_CR, name, value, name); } ap_text_append(propdb->p, phdr, s); } @@ -662,7 +662,7 @@ static void dav_prep_ns_map(dav_propdb *propdb, int add_ns) } } else { - propdb->ns_map = ap_palloc(propdb->p, propdb->ns_xlate->nelts * sizeof(*propdb->ns_map)); + propdb->ns_map = apr_palloc(propdb->p, propdb->ns_xlate->nelts * sizeof(*propdb->ns_map)); } pmap = propdb->ns_map; @@ -762,12 +762,12 @@ static int dav_find_dav_id(dav_propdb *propdb) return -1; } -static void dav_insert_xmlns(ap_pool_t *p, const char *pre_prefix, int ns, +static void dav_insert_xmlns(apr_pool_t *p, const char *pre_prefix, int ns, const char *ns_uri, ap_text_header *phdr) { const char *s; - s = ap_psprintf(p, " xmlns:%s%d=\"%s\"", pre_prefix, ns, ns_uri); + s = apr_psprintf(p, " xmlns:%s%d=\"%s\"", pre_prefix, ns, ns_uri); ap_text_append(p, phdr, s); } @@ -789,7 +789,7 @@ static void dav_get_propdb_xmlns(dav_propdb *propdb, ap_text_header *phdr) /* add a namespace decl from one of the namespace tables */ static void dav_add_marked_xmlns(dav_propdb *propdb, char *marks, int ns, - ap_array_header_t *ns_table, + apr_array_header_t *ns_table, const char *pre_prefix, ap_text_header *phdr) { @@ -945,10 +945,10 @@ static dav_error *dav_really_open_db(dav_propdb *propdb, int ro) dav_error *dav_open_propdb(request_rec *r, dav_lockdb *lockdb, dav_resource *resource, int ro, - ap_array_header_t * ns_xlate, + apr_array_header_t * ns_xlate, dav_propdb **p_propdb) { - dav_propdb *propdb = ap_pcalloc(r->pool, sizeof(*propdb)); + dav_propdb *propdb = apr_pcalloc(r->pool, sizeof(*propdb)); dav_error *err; *p_propdb = NULL; @@ -1191,10 +1191,10 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) /* ### the marks should be in a buffer! */ /* allocate zeroed-memory for the marks. These marks indicate which input namespaces we've generated into the output xmlns buffer */ - marks_input = ap_pcalloc(propdb->p, propdb->ns_xlate->nelts); + marks_input = apr_pcalloc(propdb->p, propdb->ns_xlate->nelts); /* same for the liveprops */ - marks_liveprop = ap_pcalloc(propdb->p, dav_get_liveprop_ns_count() + 1); + marks_liveprop = apr_pcalloc(propdb->p, dav_get_liveprop_ns_count() + 1); for (elem = elem->first_child; elem; elem = elem->next) { dav_datum key; @@ -1213,7 +1213,7 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) } if (elem->private == NULL) { - elem->private = ap_pcalloc(propdb->p, sizeof(*priv)); + elem->private = apr_pcalloc(propdb->p, sizeof(*priv)); } priv = elem->private; @@ -1284,14 +1284,14 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc) * elem has a prefix already (xml...:name) or the elem * simply has no namespace. */ - s = ap_psprintf(propdb->p, "<%s/>" DEBUG_CR, elem->name); + s = apr_psprintf(propdb->p, "<%s/>" DEBUG_CR, elem->name); } else { /* ensure that an xmlns is generated for the input namespace */ dav_add_marked_xmlns(propdb, marks_input, elem->ns, propdb->ns_xlate, "i", &hdr_ns); - s = ap_psprintf(propdb->p, "" DEBUG_CR, + s = apr_psprintf(propdb->p, "" DEBUG_CR, elem->ns, elem->name); } ap_text_append(propdb->p, &hdr_bad, s); @@ -1347,7 +1347,7 @@ void dav_prop_validate(dav_prop_ctx *ctx) ap_xml_elem *prop = ctx->prop; dav_elem_private *priv; - priv = ctx->prop->private = ap_pcalloc(propdb->p, sizeof(*priv)); + priv = ctx->prop->private = apr_pcalloc(propdb->p, sizeof(*priv)); /* ** Check to see if this is a live property, and fill the fields @@ -1437,7 +1437,7 @@ void dav_prop_exec(dav_prop_ctx *ctx) dav_rollback_item *rollback; dav_elem_private *priv = ctx->prop->private; - rollback = ap_pcalloc(propdb->p, sizeof(*rollback)); + rollback = apr_pcalloc(propdb->p, sizeof(*rollback)); ctx->rollback = rollback; if (ctx->is_liveprop) { diff --git a/modules/dav/main/util.c b/modules/dav/main/util.c index 48f55bb365..187bfbd78d 100644 --- a/modules/dav/main/util.c +++ b/modules/dav/main/util.c @@ -66,10 +66,10 @@ #include "http_protocol.h" -dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *desc) +dav_error *dav_new_error(apr_pool_t *p, int status, int error_id, const char *desc) { int save_errno = errno; - dav_error *err = ap_pcalloc(p, sizeof(*err)); + dav_error *err = apr_pcalloc(p, sizeof(*err)); /* DBG3("dav_new_error: %d %d %s", status, error_id, desc ? desc : "(no desc)"); */ @@ -81,10 +81,10 @@ dav_error *dav_new_error(ap_pool_t *p, int status, int error_id, const char *des return err; } -dav_error *dav_push_error(ap_pool_t *p, int status, int error_id, const char *desc, +dav_error *dav_push_error(apr_pool_t *p, int status, int error_id, const char *desc, dav_error *prev) { - dav_error *err = ap_pcalloc(p, sizeof(*err)); + dav_error *err = apr_pcalloc(p, sizeof(*err)); err->status = status; err->error_id = error_id; @@ -94,20 +94,20 @@ dav_error *dav_push_error(ap_pool_t *p, int status, int error_id, const char *de return err; } -void dav_check_bufsize(ap_pool_t * p, dav_buffer *pbuf, size_t extra_needed) +void dav_check_bufsize(apr_pool_t * p, dav_buffer *pbuf, size_t extra_needed) { /* grow the buffer if necessary */ if (pbuf->cur_len + extra_needed > pbuf->alloc_len) { char *newbuf; pbuf->alloc_len += extra_needed + DAV_BUFFER_PAD; - newbuf = ap_palloc(p, pbuf->alloc_len); + newbuf = apr_palloc(p, pbuf->alloc_len); memcpy(newbuf, pbuf->buf, pbuf->cur_len); pbuf->buf = newbuf; } } -void dav_set_bufsize(ap_pool_t * p, dav_buffer *pbuf, size_t size) +void dav_set_bufsize(apr_pool_t * p, dav_buffer *pbuf, size_t size) { /* NOTE: this does not retain prior contents */ @@ -121,21 +121,21 @@ void dav_set_bufsize(ap_pool_t * p, dav_buffer *pbuf, size_t size) if (pbuf->alloc_len < DAV_BUFFER_MINSIZE) pbuf->alloc_len = DAV_BUFFER_MINSIZE; - pbuf->buf = ap_palloc(p, pbuf->alloc_len); + pbuf->buf = apr_palloc(p, pbuf->alloc_len); } pbuf->cur_len = size; } /* initialize a buffer and copy the specified (null-term'd) string into it */ -void dav_buffer_init(ap_pool_t *p, dav_buffer *pbuf, const char *str) +void dav_buffer_init(apr_pool_t *p, dav_buffer *pbuf, const char *str) { dav_set_bufsize(p, pbuf, strlen(str)); memcpy(pbuf->buf, str, pbuf->cur_len + 1); } /* append a string to the end of the buffer, adjust length */ -void dav_buffer_append(ap_pool_t *p, dav_buffer *pbuf, const char *str) +void dav_buffer_append(apr_pool_t *p, dav_buffer *pbuf, const char *str) { size_t len = strlen(str); @@ -145,7 +145,7 @@ void dav_buffer_append(ap_pool_t *p, dav_buffer *pbuf, const char *str) } /* place a string on the end of the buffer, do NOT adjust length */ -void dav_buffer_place(ap_pool_t *p, dav_buffer *pbuf, const char *str) +void dav_buffer_place(apr_pool_t *p, dav_buffer *pbuf, const char *str) { size_t len = strlen(str); @@ -154,7 +154,7 @@ void dav_buffer_place(ap_pool_t *p, dav_buffer *pbuf, const char *str) } /* place some memory on the end of a buffer; do NOT adjust length */ -void dav_buffer_place_mem(ap_pool_t *p, dav_buffer *pbuf, const void *mem, +void dav_buffer_place_mem(apr_pool_t *p, dav_buffer *pbuf, const void *mem, size_t amt, size_t pad) { dav_check_bufsize(p, pbuf, amt + pad); @@ -209,7 +209,7 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r) if (strcasecmp(comp.scheme, scheme) != 0 || comp.port != port) { result.err.status = HTTP_BAD_GATEWAY; - result.err.desc = ap_psprintf(r->pool, + result.err.desc = apr_psprintf(r->pool, "Destination URI refers to different " "scheme or port (%s://hostname:%d)" APR_EOL_STR "(want: %s://hostname:%d)", @@ -242,7 +242,7 @@ dav_lookup_result dav_lookup_uri(const char *uri, request_rec * r) */ if (strrchr(comp.hostname, '.') == NULL && (domain = strchr(r->server->server_hostname, '.')) != NULL) { - comp.hostname = ap_pstrcat(r->pool, comp.hostname, domain, NULL); + comp.hostname = apr_pstrcat(r->pool, comp.hostname, domain, NULL); } /* now, if a hostname was provided, then verify that it represents the @@ -313,8 +313,8 @@ time_t dav_get_timeout(request_rec *r) { time_t now, expires = DAV_TIMEOUT_INFINITE; - const char *timeout_const = ap_table_get(r->headers_in, "Timeout"); - const char *timeout = ap_pstrdup(r->pool, timeout_const), *val; + const char *timeout_const = apr_table_get(r->headers_in, "Timeout"); + const char *timeout = apr_pstrdup(r->pool, timeout_const), *val; if (timeout == NULL) return DAV_TIMEOUT_INFINITE; @@ -350,12 +350,12 @@ time_t dav_get_timeout(request_rec *r) /* add_if_resource returns a new if_header, linking it to next_ih. */ -static dav_if_header *dav_add_if_resource(ap_pool_t *p, dav_if_header *next_ih, +static dav_if_header *dav_add_if_resource(apr_pool_t *p, dav_if_header *next_ih, const char *uri, size_t uri_len) { dav_if_header *ih; - if ((ih = ap_pcalloc(p, sizeof(*ih))) == NULL) + if ((ih = apr_pcalloc(p, sizeof(*ih))) == NULL) return NULL; ih->uri = uri; @@ -367,14 +367,14 @@ static dav_if_header *dav_add_if_resource(ap_pool_t *p, dav_if_header *next_ih, /* add_if_state adds a condition to an if_header. */ -static dav_error * dav_add_if_state(ap_pool_t *p, dav_if_header *ih, +static dav_error * dav_add_if_state(apr_pool_t *p, dav_if_header *ih, const char *state_token, dav_if_state_type t, int condition, const dav_hooks_locks *locks_hooks) { dav_if_state_list *new_sl; - new_sl = ap_pcalloc(p, sizeof(*new_sl)); + new_sl = apr_pcalloc(p, sizeof(*new_sl)); new_sl->condition = condition; new_sl->type = t; @@ -444,7 +444,7 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) *p_ih = NULL; - if ((str = ap_pstrdup(r->pool, ap_table_get(r->headers_in, "If"))) == NULL) + if ((str = apr_pstrdup(r->pool, apr_table_get(r->headers_in, "If"))) == NULL) return NULL; while (*str) { @@ -556,7 +556,7 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) default: return dav_new_error(r->pool, HTTP_BAD_REQUEST, DAV_ERR_IF_UNK_CHAR, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Invalid \"If:\" " "header: Unexpected " "character encountered " @@ -575,7 +575,7 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih) default: return dav_new_error(r->pool, HTTP_BAD_REQUEST, DAV_ERR_IF_UNK_CHAR, - ap_psprintf(r->pool, + apr_psprintf(r->pool, "Invalid \"If:\" header: " "Unexpected character " "encountered (0x%02x, '%c').", @@ -634,7 +634,7 @@ static int dav_find_submitted_locktoken(const dav_if_header *if_header, /* dav_validate_resource_state: * Returns NULL if path/uri meets if-header and lock requirements */ -static dav_error * dav_validate_resource_state(ap_pool_t *p, +static dav_error * dav_validate_resource_state(apr_pool_t *p, const dav_resource *resource, dav_lockdb *lockdb, const dav_if_header *if_header, @@ -981,7 +981,7 @@ static dav_error * dav_validate_resource_state(ap_pool_t *p, strcmp(lock->auth_user, r->user))) { const char *errmsg; - errmsg = ap_pstrcat(p, "User \"", + errmsg = apr_pstrcat(p, "User \"", r->user, "\" submitted a locktoken created " "by user \"", @@ -1118,7 +1118,7 @@ static dav_error * dav_validate_resource_state(ap_pool_t *p, } return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, - ap_psprintf(p, + apr_psprintf(p, "The precondition(s) specified by " "the \"If:\" header did not match " "this resource. At least one " @@ -1267,12 +1267,12 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, if (locktoken != NULL) { dav_if_header *ifhdr_new; - ifhdr_new = ap_pcalloc(r->pool, sizeof(*ifhdr_new)); + ifhdr_new = apr_pcalloc(r->pool, sizeof(*ifhdr_new)); ifhdr_new->uri = resource->uri; ifhdr_new->uri_len = strlen(resource->uri); ifhdr_new->dummy_header = 1; - ifhdr_new->state = ap_pcalloc(r->pool, sizeof(*ifhdr_new->state)); + ifhdr_new->state = apr_pcalloc(r->pool, sizeof(*ifhdr_new->state)); ifhdr_new->state->type = dav_if_opaquelock; ifhdr_new->state->condition = DAV_IF_COND_NORMAL; ifhdr_new->state->locktoken = locktoken; @@ -1353,7 +1353,7 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, ** into a multistatus response. */ if (err != NULL) { - new_response = ap_pcalloc(r->pool, sizeof(*new_response)); + new_response = apr_pcalloc(r->pool, sizeof(*new_response)); new_response->href = parent_resource->uri; new_response->status = err->status; @@ -1362,7 +1362,7 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, "preventing the operation on the resource specified by " "the Request-URI."; if (err->desc != NULL) { - new_response->desc = ap_pstrcat(r->pool, + new_response->desc = apr_pstrcat(r->pool, new_response->desc, " The error was: ", err->desc, NULL); @@ -1407,7 +1407,7 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, ** For other methods, return a simple 424. */ if ((flags & DAV_VALIDATE_ADD_LD) != 0) { - propstat = ap_pcalloc(r->pool, sizeof(*propstat)); + propstat = apr_pcalloc(r->pool, sizeof(*propstat)); propstat->text = "" DEBUG_CR "" DEBUG_CR @@ -1416,7 +1416,7 @@ dav_error * dav_validate_request(request_rec *r, dav_resource *resource, } /* create the 424 response */ - new_response = ap_pcalloc(r->pool, sizeof(*new_response)); + new_response = apr_pcalloc(r->pool, sizeof(*new_response)); new_response->href = resource->uri; new_response->status = HTTP_FAILED_DEPENDENCY; new_response->propresult.propstats = propstat; @@ -1460,7 +1460,7 @@ dav_error * dav_get_locktoken_list(request_rec *r, dav_locktoken_list **ltl) while (if_state != NULL) { if (if_state->condition == DAV_IF_COND_NORMAL && if_state->type == dav_if_opaquelock) { - lock_token = ap_pcalloc(r->pool, sizeof(dav_locktoken_list)); + lock_token = apr_pcalloc(r->pool, sizeof(dav_locktoken_list)); lock_token->locktoken = if_state->locktoken; lock_token->next = *ltl; *ltl = lock_token; @@ -1486,7 +1486,7 @@ dav_error * dav_get_locktoken_list(request_rec *r, dav_locktoken_list **ltl) */ const char *dav_get_target_selector(request_rec *r) { - return ap_table_get(r->headers_in, "Target-Selector"); + return apr_table_get(r->headers_in, "Target-Selector"); } /* Ensure that a resource is writable. If there is no versioning @@ -1542,7 +1542,7 @@ dav_error *dav_ensure_resource_writable(request_rec *r, if (!resource->exists || parent_only) { parent = (*resource->hooks->get_parent_resource)(resource); if (parent == NULL || !parent->exists) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Missing one or more intermediate collections. " "Cannot create resource %s.", ap_escape_html(r->pool, resource->uri)); @@ -1577,7 +1577,7 @@ dav_error *dav_ensure_resource_writable(request_rec *r, /* parent must be checked out */ if (!parent->working) { if ((err = (*vsn_hooks->checkout)(parent)) != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to checkout parent collection. " "Cannot create resource %s.", ap_escape_html(r->pool, resource->uri)); @@ -1588,7 +1588,7 @@ dav_error *dav_ensure_resource_writable(request_rec *r, /* if not just checking parent, create new child resource */ if (!parent_only) { if ((err = (*vsn_hooks->mkresource)(resource)) != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to create versioned resource %s.", ap_escape_html(r->pool, resource->uri)); return dav_push_error(r->pool, HTTP_CONFLICT, 0, body, err); @@ -1608,7 +1608,7 @@ dav_error *dav_ensure_resource_writable(request_rec *r, /* if not just checking parent, make sure child resource is checked out */ if (!parent_only && !resource->working) { if ((err = (*vsn_hooks->checkout)(resource)) != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to checkout resource %s.", ap_escape_html(r->pool, resource->uri)); return dav_push_error(r->pool, HTTP_CONFLICT, 0, body, err); @@ -1649,7 +1649,7 @@ dav_error *dav_revert_resource_writability(request_rec *r, err = (*vsn_hooks->checkin)(resource); if (err != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to %s resource %s.", undo ? "uncheckout" : "checkin", ap_escape_html(r->pool, resource->uri)); @@ -1664,7 +1664,7 @@ dav_error *dav_revert_resource_writability(request_rec *r, /* ### should we do anything with the response? */ if ((err = (*resource->hooks->remove_resource)(resource, &response)) != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to undo creation of resource %s.", ap_escape_html(r->pool, resource->uri)); return dav_push_error(r->pool, HTTP_INTERNAL_SERVER_ERROR, 0, @@ -1682,7 +1682,7 @@ dav_error *dav_revert_resource_writability(request_rec *r, err = (*vsn_hooks->checkin)(parent_resource); if (err != NULL) { - body = ap_psprintf(r->pool, + body = apr_psprintf(r->pool, "Unable to %s parent collection of %s.", undo ? "uncheckout" : "checkin", ap_escape_html(r->pool, resource->uri)); diff --git a/modules/dav/main/util_lock.c b/modules/dav/main/util_lock.c index 6adfdf7736..124541644f 100644 --- a/modules/dav/main/util_lock.c +++ b/modules/dav/main/util_lock.c @@ -81,7 +81,7 @@ const char *dav_lock_get_activelock(request_rec *r, dav_lock *lock, const dav_hooks_locks *hooks = DAV_GET_HOOKS_LOCKS(r); int count = 0; dav_buffer work_buf = { 0 }; - ap_pool_t *p = r->pool; + apr_pool_t *p = r->pool; /* If no locks or no lock provider, there are no locks */ if (lock == NULL || hooks == NULL) { @@ -197,7 +197,7 @@ dav_error * dav_lock_parse_lockinfo(request_rec *r, const ap_xml_doc *doc, dav_lock **lock_request) { - ap_pool_t *p = r->pool; + apr_pool_t *p = r->pool; dav_error *err; ap_xml_elem *child; dav_lock *lock; @@ -262,7 +262,7 @@ dav_error * dav_lock_parse_lockinfo(request_rec *r, } return dav_new_error(p, HTTP_PRECONDITION_FAILED, 0, - ap_psprintf(p, + apr_psprintf(p, "The server cannot satisfy the " "LOCK request due to an unknown XML " "element (\"%s\") within the " @@ -428,7 +428,7 @@ static dav_error * dav_unlock_walker(dav_walker_ctx *ctx, int calltype) ** namespace [repository] hierarchy. Note that some lock providers may be ** able to return this information with a traversal. */ -static dav_error * dav_get_direct_resource(ap_pool_t *p, +static dav_error * dav_get_direct_resource(apr_pool_t *p, dav_lockdb *lockdb, const dav_locktoken *locktoken, const dav_resource *resource, diff --git a/modules/echo/mod_echo.c b/modules/echo/mod_echo.c index 14582a6df4..011c23e409 100644 --- a/modules/echo/mod_echo.c +++ b/modules/echo/mod_echo.c @@ -69,9 +69,9 @@ typedef struct int bEnabled; } EchoConfig; -static void *create_echo_server_config(ap_pool_t *p,server_rec *s) +static void *create_echo_server_config(apr_pool_t *p,server_rec *s) { - EchoConfig *pConfig=ap_pcalloc(p,sizeof *pConfig); + EchoConfig *pConfig=apr_pcalloc(p,sizeof *pConfig); pConfig->bEnabled=0; @@ -98,7 +98,7 @@ static int process_echo_connection(conn_rec *c) for( ; ; ) { - ap_ssize_t r, w; + apr_ssize_t r, w; (void) ap_bread(c->client,buf,sizeof buf,&r); if(r <= 0) break; @@ -128,7 +128,7 @@ API_VAR_EXPORT module echo_module = { NULL, /* merge per-directory config structures */ create_echo_server_config, /* create per-server config structure */ NULL, /* merge per-server config structures */ - echo_cmds, /* command ap_table_t */ + echo_cmds, /* command apr_table_t */ NULL, /* handlers */ register_hooks /* register hooks */ }; diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index c0e55324ab..a5b8371591 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -92,14 +92,14 @@ typedef struct charset_dir_t { module charset_lite_module; -static void *create_charset_dir_conf(ap_pool_t *p,char *dummy) +static void *create_charset_dir_conf(apr_pool_t *p,char *dummy) { - return ap_pcalloc(p,sizeof(charset_dir_t)); + return apr_pcalloc(p,sizeof(charset_dir_t)); } -static void *merge_charset_dir_conf(ap_pool_t *p, void *basev, void *overridesv) +static void *merge_charset_dir_conf(apr_pool_t *p, void *basev, void *overridesv) { - charset_dir_t *a = (charset_dir_t *)ap_pcalloc (p, sizeof(charset_dir_t)); + charset_dir_t *a = (charset_dir_t *)apr_pcalloc (p, sizeof(charset_dir_t)); charset_dir_t *base = (charset_dir_t *)basev, *over = (charset_dir_t *)overridesv; @@ -154,8 +154,8 @@ static const char *add_charset_debug(cmd_parms *cmd, charset_dir_t *dc, int arg) static int find_code_page(request_rec *r) { charset_dir_t *dc = ap_get_module_config(r->per_dir_config, &charset_lite_module); - ap_status_t rv; - ap_xlate_t *input_xlate, *output_xlate; + apr_status_t rv; + apr_xlate_t *input_xlate, *output_xlate; const char *mime_type; int debug = dc->debug == DEBUG; diff --git a/modules/experimental/mod_example.c b/modules/experimental/mod_example.c index 223a7443d4..fbea022852 100644 --- a/modules/experimental/mod_example.c +++ b/modules/experimental/mod_example.c @@ -118,7 +118,7 @@ typedef struct excfg { * the same routine/environment. */ static const char *trace = NULL; -static ap_table_t *static_calls_made = NULL; +static apr_table_t *static_calls_made = NULL; /* * To avoid leaking memory from pools other than the per-request one, we @@ -126,8 +126,8 @@ static ap_table_t *static_calls_made = NULL; * freed each time we modify the trace. That way previous layers of trace * data don't get lost. */ -static ap_pool_t *example_pool = NULL; -static ap_pool_t *example_subpool = NULL; +static apr_pool_t *example_pool = NULL; +static apr_pool_t *example_subpool = NULL; /* * Declare ourselves so the configuration routines can find and know us. @@ -295,14 +295,14 @@ static void setup_module_cells() * If we haven't already allocated our module-private pool, do so now. */ if (example_pool == NULL) { - ap_create_pool(&example_pool, NULL); + apr_create_pool(&example_pool, NULL); }; /* - * Likewise for the ap_table_t of routine/environment pairs we visit outside of + * Likewise for the apr_table_t of routine/environment pairs we visit outside of * request context. */ if (static_calls_made == NULL) { - static_calls_made = ap_make_table(example_pool, 16); + static_calls_made = apr_make_table(example_pool, 16); }; } @@ -315,11 +315,11 @@ static void setup_module_cells() * 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 ap_pool_t and attach it to the + * record), we put the trace into the request apr_pool_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 ap_table_t is only for storing strings; if you need to + * Note that the r->notes apr_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. */ @@ -333,7 +333,7 @@ static void trace_add(server_rec *s, request_rec *r, excfg *mconfig, const char *sofar; char *addon; char *where; - ap_pool_t *p; + apr_pool_t *p; const char *trace_copy; /* @@ -345,7 +345,7 @@ static void trace_add(server_rec *s, request_rec *r, excfg *mconfig, */ if (r != NULL) { p = r->pool; - if ((trace_copy = ap_table_get(r->notes, TRACE_NOTE)) == NULL) { + if ((trace_copy = apr_table_get(r->notes, TRACE_NOTE)) == NULL) { trace_copy = ""; } } @@ -360,16 +360,16 @@ static void trace_add(server_rec *s, request_rec *r, excfg *mconfig, * Make a new sub-pool and copy any existing trace to it. Point the * trace cell at the copied value. */ - ap_create_pool(&p, example_pool); + apr_create_pool(&p, example_pool); if (trace != NULL) { - trace = ap_pstrdup(p, trace); + trace = apr_pstrdup(p, trace); } /* * Now, if we have a sub-pool from before, nuke it and replace with * the one we just allocated. */ if (example_subpool != NULL) { - ap_destroy_pool(example_subpool); + apr_destroy_pool(example_subpool); } example_subpool = p; trace_copy = trace; @@ -385,14 +385,14 @@ static void trace_add(server_rec *s, request_rec *r, excfg *mconfig, where = (where != NULL) ? where : ""; /* * Now, if we're not in request context, see if we've been called with - * this particular combination before. The ap_table_t is allocated in the + * this particular combination before. The apr_table_t is allocated in the * module's private pool, which doesn't get destroyed. */ if (r == NULL) { char *key; - key = ap_pstrcat(p, note, ":", where, NULL); - if (ap_table_get(static_calls_made, key) != NULL) { + key = apr_pstrcat(p, note, ":", where, NULL); + if (apr_table_get(static_calls_made, key) != NULL) { /* * Been here, done this. */ @@ -403,17 +403,17 @@ static void trace_add(server_rec *s, request_rec *r, excfg *mconfig, * First time for this combination of routine and environment - * log it so we don't do it again. */ - ap_table_set(static_calls_made, key, "been here"); + apr_table_set(static_calls_made, key, "been here"); } } - addon = ap_pstrcat(p, "
  • \n", "
    \n", "
    ", + addon = apr_pstrcat(p, "
  • \n", "
    \n", "
    ", note, "\n", "
    \n", "
    [", where, "]\n", "
    \n", "
    \n", "
  • \n", NULL); sofar = (trace_copy == NULL) ? "" : trace_copy; - trace_copy = ap_pstrcat(p, sofar, addon, NULL); + trace_copy = apr_pstrcat(p, sofar, addon, NULL); if (r != NULL) { - ap_table_set(r->notes, TRACE_NOTE, trace_copy); + apr_table_set(r->notes, TRACE_NOTE, trace_copy); } else { trace = trace_copy; @@ -563,7 +563,7 @@ static int example_handler(request_rec *r) ap_rprintf(r, "

    Static callbacks so far:

    \n
      \n%s
    \n", trace); ap_rputs("

    Request-specific callbacks so far:

    \n", r); - ap_rprintf(r, "
      \n%s
    \n", ap_table_get(r->notes, TRACE_NOTE)); + ap_rprintf(r, "
      \n%s
    \n", apr_table_get(r->notes, TRACE_NOTE)); ap_rputs("

    Environment for this call:

    \n", r); ap_rputs("