rse 98/04/11 05:01:10
Modified: . STATUS src CHANGES Configure buildmark.c src/ap ap_slack.c ap_strings.c src/include alloc.h buff.h explain.h fnmatch.h http_conf_globals.h http_config.h http_core.h http_log.h http_main.h http_protocol.h http_request.h http_vhost.h httpd.h md5.h multithread.h rfc1413.h scoreboard.h util_date.h util_script.h util_uri.h src/main alloc.c buff.c fnmatch.c http_config.c http_core.c http_log.c http_main.c http_protocol.c http_request.c http_vhost.c md5c.c rfc1413.c util.c util_date.c util_md5.c util_script.c util_uri.c src/modules/example mod_example.c src/modules/experimental mod_mmap_static.c src/modules/proxy mod_proxy.c mod_proxy.h proxy_cache.c proxy_connect.c proxy_ftp.c proxy_http.c proxy_util.c src/modules/standard mod_access.c mod_actions.c mod_alias.c mod_asis.c mod_auth.c mod_auth_anon.c mod_auth_db.c mod_auth_dbm.c mod_autoindex.c mod_cern_meta.c mod_cgi.c mod_digest.c mod_dir.c mod_env.c mod_expires.c mod_headers.c mod_imap.c mod_include.c mod_info.c mod_log_agent.c mod_log_config.c mod_log_referer.c mod_mime.c mod_mime_magic.c mod_negotiation.c mod_rewrite.c mod_setenvif.c mod_so.c mod_speling.c mod_status.c mod_unique_id.c mod_userdir.c mod_usertrack.c src/modules/test mod_rndchunk.c mod_test_util_uri.c src/os/bs2000 os-inline.c os.c os.h src/os/emx os-inline.c os.h src/os/unix os-inline.c os.h src/os/win32 mod_dll.c mod_isapi.c modules.c multithread.c os.h registry.c service.c util_win32.c src/support htdigest.c src/test/rename rename.cf Log: THE BIG SYMBOL RENAMING FOR APACHE 1.3 The used renaming configuration: =================================================================== bind_address ap_bind_address coredump_dir ap_coredump_dir daemons_limit ap_daemons_limit daemons_max_free ap_daemons_max_free daemons_min_free ap_daemons_min_free daemons_to_start ap_daemons_to_start excess_requests_per_child ap_excess_requests_per_child group_id ap_group_id listenbacklog ap_listenbacklog listeners ap_listeners lock_fname ap_lock_fname max_requests_per_child ap_max_requests_per_child pid_fname ap_pid_fname restart_time ap_restart_time scoreboard_fname ap_scoreboard_fname server_argv0 ap_server_argv0 server_confname ap_server_confname server_post_read_config ap_server_post_read_config server_pre_read_config ap_server_pre_read_config server_root ap_server_root standalone ap_standalone threads_per_child ap_threads_per_child user_id ap_user_id user_name ap_user_name suexec_enabled ap_suexec_enabled day_snames ap_day_snames dummy_mutex ap_dummy_mutex month_snames ap_month_snames rfc1413_timeout ap_rfc1413_timeout scoreboard_image ap_scoreboard_image MD5Final ap_MD5Final MD5Init ap_MD5Init MD5Update ap_MD5Update add_cgi_vars ap_add_cgi_vars add_common_vars ap_add_common_vars add_module ap_add_module add_named_module ap_add_named_module add_per_dir_conf ap_add_per_dir_conf add_per_url_conf ap_add_per_url_conf allow_options ap_allow_options allow_overrides ap_allow_overrides append_arrays ap_append_arrays array_cat ap_array_cat auth_name ap_auth_name auth_type ap_auth_type basic_http_header ap_basic_http_header bclose ap_bclose bcreate ap_bcreate bfilbuf ap_bfilbuf bfileno ap_bfileno bflsbuf ap_bflsbuf bflush ap_bflush bgetopt ap_bgetopt bgets ap_bgets bhalfduplex ap_bhalfduplex block_alarms ap_block_alarms blookc ap_blookc bnonblock ap_bnonblock bonerror ap_bonerror bpushfd ap_bpushfd bputs ap_bputs bprintf ap_bprintf bread ap_bread bsetflag ap_bsetflag bsetopt ap_bsetopt bskiplf ap_bskiplf bvputs ap_bvputs bwrite ap_bwrite bytes_in_free_blocks ap_bytes_in_free_blocks bytes_in_pool ap_bytes_in_pool call_exec ap_call_exec can_exec ap_can_exec cfg_closefile ap_cfg_closefile cfg_getc ap_cfg_getc cfg_getline ap_cfg_getline chdir_file ap_chdir_file check_access ap_check_access check_alarm ap_check_alarm check_auth ap_check_auth check_cmd_context ap_check_cmd_context check_user_id ap_check_user_id checkmask ap_checkmask child_exit_modules ap_child_exit_modules child_init_modules ap_child_init_modules child_terminate ap_child_terminate cleanup_for_exec ap_cleanup_for_exec clear_module_list ap_clear_module_list clear_pool ap_clear_pool clear_table ap_clear_table close_piped_log ap_close_piped_log construct_server ap_construct_server construct_url ap_construct_url copy_array ap_copy_array copy_array_hdr ap_copy_array_hdr copy_table ap_copy_table core_reorder_directories ap_core_reorder_directories count_dirs ap_count_dirs create_environment ap_create_environment create_per_dir_config ap_create_per_dir_config create_request_config ap_create_request_config default_port_for_request ap_default_port_for_request default_port_for_scheme ap_default_port_for_scheme default_type ap_default_type destroy_pool ap_destroy_pool destroy_sub_req ap_destroy_sub_req die ap_die discard_request_body ap_discard_request_body document_root ap_document_root each_byterange ap_each_byterange error_log2stderr ap_error_log2stderr escape_html ap_escape_html escape_path_segment ap_escape_path_segment escape_shell_cmd ap_escape_shell_cmd exists_scoreboard_image ap_exists_scoreboard_image finalize_request_protocol ap_finalize_request_protocol finalize_sub_req_protocol ap_finalize_sub_req_protocol find_command ap_find_command find_command_in_modules ap_find_command_in_modules find_last_token ap_find_last_token find_linked_module ap_find_linked_module find_module_name ap_find_module_name find_path_info ap_find_path_info find_pool ap_find_pool find_token ap_find_token find_types ap_find_types fini_vhost_config ap_fini_vhost_config fnmatch ap_fnmatch force_library_loading ap_force_library_loading get_basic_auth_pw ap_get_basic_auth_pw get_client_block ap_get_client_block get_gmtoff ap_get_gmtoff get_local_host ap_get_local_host get_module_config ap_get_module_config get_remote_host ap_get_remote_host get_remote_logname ap_get_remote_logname get_server_name ap_get_server_name get_server_port ap_get_server_port get_time ap_get_time get_token ap_get_token get_virthost_addr ap_get_virthost_addr getparents ap_getparents getword ap_getword getword_conf ap_getword_conf getword_conf_nc ap_getword_conf_nc getword_nc ap_getword_nc getword_nulls ap_getword_nulls getword_nulls_nc ap_getword_nulls_nc getword_white ap_getword_white getword_white_nc ap_getword_white_nc gm_timestr_822 ap_gm_timestr_822 gname2id ap_gname2id handle_command ap_handle_command hard_timeout ap_hard_timeout header_parse ap_header_parse ht_time ap_ht_time ind ap_ind index_of_response ap_index_of_response init_alloc ap_init_alloc init_modules ap_init_modules init_vhost_config ap_init_vhost_config init_virtual_host ap_init_virtual_host internal_redirect ap_internal_redirect internal_redirect_handler ap_internal_redirect_handler invoke_handler ap_invoke_handler is_directory ap_is_directory is_fnmatch ap_is_fnmatch is_initial_req ap_is_initial_req is_matchexp ap_is_matchexp is_url ap_is_url keepalive_timeout ap_keepalive_timeout kill_cleanup ap_kill_cleanup kill_cleanups_for_fd ap_kill_cleanups_for_fd kill_cleanups_for_socket ap_kill_cleanups_for_socket kill_timeout ap_kill_timeout limit_section ap_limit_section log_assert ap_log_assert log_pid ap_log_pid log_printf ap_log_printf log_reason ap_log_reason log_transaction ap_log_transaction log_unixerr ap_log_unixerr make_array ap_make_array make_dirstr ap_make_dirstr make_dirstr_parent ap_make_dirstr_parent make_dirstr_prefix ap_make_dirstr_prefix make_full_path ap_make_full_path make_sub_pool ap_make_sub_pool make_table ap_make_table matches_request_vhost ap_matches_request_vhost meets_conditions ap_meets_conditions merge_per_dir_configs ap_merge_per_dir_configs no2slash ap_no2slash note_auth_failure ap_note_auth_failure note_basic_auth_failure ap_note_basic_auth_failure note_cleanups_for_fd ap_note_cleanups_for_fd note_cleanups_for_file ap_note_cleanups_for_file note_cleanups_for_socket ap_note_cleanups_for_socket note_digest_auth_failure ap_note_digest_auth_failure note_subprocess ap_note_subprocess null_cleanup ap_null_cleanup open_logs ap_open_logs open_piped_log ap_open_piped_log overlay_tables ap_overlay_tables palloc ap_palloc parseHTTPdate ap_parseHTTPdate parse_htaccess ap_parse_htaccess parse_uri ap_parse_uri parse_uri_components ap_parse_uri_components parse_hostinfo_components ap_parse_hostinfo_components parse_vhost_addrs ap_parse_vhost_addrs pcalloc ap_pcalloc pcfg_open_custom ap_pcfg_open_custom pcfg_openfile ap_pcfg_openfile pclosedir ap_pclosedir pclosef ap_pclosef pclosesocket ap_pclosesocket pduphostent ap_pduphostent pfclose ap_pfclose pfdopen ap_pfdopen pfopen ap_pfopen pgethostbyname ap_pgethostbyname pool_is_ancestor ap_pool_is_ancestor pool_join ap_pool_join popendir ap_popendir popenf ap_popenf pregcomp ap_pregcomp pregfree ap_pregfree pregsub ap_pregsub process_request ap_process_request process_resource_config ap_process_resource_config proxy_add_header ap_proxy_add_header proxy_c2hex ap_proxy_c2hex proxy_cache_check ap_proxy_cache_check proxy_cache_error ap_proxy_cache_error proxy_cache_tidy ap_proxy_cache_tidy proxy_cache_update ap_proxy_cache_update proxy_canon_netloc ap_proxy_canon_netloc proxy_canonenc ap_proxy_canonenc proxy_connect_handler ap_proxy_connect_handler proxy_date_canon ap_proxy_date_canon proxy_del_header ap_proxy_del_header proxy_doconnect ap_proxy_doconnect proxy_ftp_canon ap_proxy_ftp_canon proxy_ftp_handler ap_proxy_ftp_handler proxy_garbage_coll ap_proxy_garbage_coll proxy_garbage_init ap_proxy_garbage_init proxy_get_header ap_proxy_get_header proxy_hash ap_proxy_hash proxy_hex2c ap_proxy_hex2c proxy_hex2sec ap_proxy_hex2sec proxy_host2addr ap_proxy_host2addr proxy_http_canon ap_proxy_http_canon proxy_http_handler ap_proxy_http_handler proxy_is_domainname ap_proxy_is_domainname proxy_is_hostname ap_proxy_is_hostname proxy_is_ipaddr ap_proxy_is_ipaddr proxy_is_word ap_proxy_is_word proxy_liststr ap_proxy_liststr proxy_log_uerror ap_proxy_log_uerror proxy_read_headers ap_proxy_read_headers proxy_sec2hex ap_proxy_sec2hex proxy_send_fb ap_proxy_send_fb proxy_send_headers ap_proxy_send_headers proxyerror ap_proxyerror psignature ap_psignature psocket ap_psocket pstrcat ap_pstrcat pstrdup ap_pstrdup pstrndup ap_pstrndup psprintf ap_psprintf pvsprintf ap_pvsprintf push_array ap_push_array rationalize_mtime ap_rationalize_mtime read_config ap_read_config read_request ap_read_request register_cleanup ap_register_cleanup register_other_child ap_register_other_child remove_module ap_remove_module requires ap_requires reset_timeout ap_reset_timeout response_code_string ap_response_code_string rfc1413 ap_rfc1413 rflush ap_rflush rind ap_rind rprintf ap_rprintf rputc ap_rputc rputs ap_rputs run_cleanup ap_run_cleanup run_fixups ap_run_fixups run_post_read_request ap_run_post_read_request run_sub_req ap_run_sub_req rvputs ap_rvputs rwrite ap_rwrite satisfies ap_satisfies scan_script_header_err ap_scan_script_header_err scan_script_header_err_buff ap_scan_script_header_err_buff send_error_response ap_send_error_response send_fb ap_send_fb send_fb_length ap_send_fb_length send_fd ap_send_fd send_fd_length ap_send_fd_length send_header_field ap_send_header_field send_http_header ap_send_http_header send_http_options ap_send_http_options send_http_trace ap_send_http_trace send_mmap ap_send_mmap send_size ap_send_size server_root_relative ap_server_root_relative set_byterange ap_set_byterange set_callback_and_alarm ap_set_callback_and_alarm set_content_length ap_set_content_length set_etag ap_set_etag set_file_slot ap_set_file_slot set_flag_slot ap_set_flag_slot set_keepalive ap_set_keepalive set_last_modified ap_set_last_modified set_module_config ap_set_module_config set_name_virtual_host ap_set_name_virtual_host set_string_slot ap_set_string_slot set_string_slot_lower ap_set_string_slot_lower set_sub_req_protocol ap_set_sub_req_protocol setup_client_block ap_setup_client_block setup_prelinked_modules ap_setup_prelinked_modules should_client_block ap_should_client_block show_directives ap_show_directives show_modules ap_show_modules soft_timeout ap_soft_timeout some_auth_required ap_some_auth_required spawn_child_err ap_spawn_child_err spawn_child_err_buff ap_spawn_child_err_buff srm_command_loop ap_srm_command_loop start_restart ap_start_restart start_shutdown ap_start_shutdown str_tolower ap_str_tolower strcasecmp_match ap_strcasecmp_match strcmp_match ap_strcmp_match sub_req_lookup_file ap_sub_req_lookup_file sub_req_lookup_uri ap_sub_req_lookup_uri sync_scoreboard_image ap_sync_scoreboard_image table_add ap_table_add table_addn ap_table_addn table_do ap_table_do table_get ap_table_get table_merge ap_table_merge table_mergen ap_table_mergen table_set ap_table_set table_setn ap_table_setn table_unset ap_table_unset time_process_request ap_time_process_request tm2sec ap_tm2sec translate_name ap_translate_name uname2id ap_uname2id unblock_alarms ap_unblock_alarms unescape_url ap_unescape_url unparse_uri_components ap_unparse_uri_components unregister_other_child ap_unregister_other_child update_child_status ap_update_child_status update_mtime ap_update_mtime update_vhost_from_headers ap_update_vhost_from_headers update_vhost_given_ip ap_update_vhost_given_ip util_init ap_util_init util_uri_init ap_util_uri_init uudecode ap_uudecode vbprintf ap_vbprintf apapi_get_server_built ap_get_server_built apapi_get_server_version ap_get_server_version aplog_error ap_log_error log_error ap_log_error_old os_escape_path ap_escape_path os_canonical_filename ap_canonical_filename acquire_mutex ap_acquire_mutex create_mutex ap_create_mutex destroy_mutex ap_destroy_mutex open_mutex ap_open_mutex release_mutex ap_release_mutex os_is_path_absolute ap_is_path_absolute prelinked_modules ap_prelinked_modules preloaded_modules ap_preloaded_modules Revision Changes Path 1.290 +1 -8 apache-1.3/STATUS Index: STATUS =================================================================== RCS file: /export/home/cvs/apache-1.3/STATUS,v retrieving revision 1.289 retrieving revision 1.290 diff -u -r1.289 -r1.290 --- STATUS 1998/04/10 12:31:43 1.289 +++ STATUS 1998/04/11 12:00:14 1.290 @@ -156,6 +156,7 @@ * Ralf's consistent add of "distclean" targets for the src/-Makefiles * Build the libraries before building the rest of the tools * Ralf's and Martin's DSO support for all SVR4-derivate Unix platforms + * THE BIG SYMBOL RENAMING Available Patches: @@ -189,14 +190,6 @@ supply a dot-notation address. Closed issues: - - * To avoid symbol clashes with third-party code compiled into the server, - we shall apply the prefix "ap_" to the following classes of functions: - - - Apache provided general functions (e.g., ap_cpystrn) - - Public API functions (e.g., palloc, bgets) - - Private functions which we can't make static (because of - cross-object usage) but should be (e.g., new_connection) Open issues: 1.765 +13 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.764 retrieving revision 1.765 diff -u -r1.764 -r1.765 --- CHANGES 1998/04/10 10:34:32 1.764 +++ CHANGES 1998/04/11 12:00:15 1.765 @@ -1,5 +1,18 @@ Changes with Apache 1.3b6 + *) ++++ THE BIG SYMBOL RENAMING ++++ + To avoid symbol clashes with third-party code compiled into the server, + we globally applied the prefix "ap_" to the following classes of + functions: + - Apache provided general functions (e.g., ap_cpystrn) + - Public API functions (e.g., palloc, bgets) + - Private functions which we can't make static (because of + cross-object usage) but should be (e.g., new_connection) + For backward source compatibility a new header file named compat.h was + created which provides defines for the old symbol names and can be used + by third-party module authors. + [The Apache Group] + *) Added dynamic shared object (DSO) support for SVR4-derivates: The problem under SVR4 is that there is no command flag to force the linker to export the global symbols of the httpd executable therewith they are 1.234 +2 -2 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.233 retrieving revision 1.234 diff -u -r1.233 -r1.234 --- Configure 1998/04/10 10:34:33 1.233 +++ Configure 1998/04/11 12:00:15 1.234 @@ -1249,14 +1249,14 @@ printf ("extern module %s_module;\n", pmodules[i]) } print "" - print "module *prelinked_modules[] = {" + print "module *ap_prelinked_modules[] = {" for (i = 0; i < n; ++i) { printf " &%s_module,\n", modules[i] } print " NULL" print "};" print "" - print "module *preloaded_modules[] = {" + print "module *ap_preloaded_modules[] = {" for (i = 0; i < pn; ++i) { printf " &%s_module,\n", pmodules[i] } 1.6 +2 -2 apache-1.3/src/buildmark.c Index: buildmark.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/buildmark.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- buildmark.c 1998/03/31 12:52:07 1.5 +++ buildmark.c 1998/04/11 12:00:16 1.6 @@ -65,12 +65,12 @@ #endif static const char server_version[] = SERVER_VERSION; -API_EXPORT(const char *) apapi_get_server_built() +API_EXPORT(const char *) ap_get_server_built() { return server_built; } -API_EXPORT(const char *) apapi_get_server_version() +API_EXPORT(const char *) ap_get_server_version() { return server_version; } 1.5 +1 -1 apache-1.3/src/ap/ap_slack.c Index: ap_slack.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_slack.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ap_slack.c 1998/03/31 12:52:12 1.4 +++ ap_slack.c 1998/04/11 12:00:17 1.5 @@ -98,7 +98,7 @@ * the high line, because if it fails we'll eventually try * the low line... */ - aplog_error(APLOG_MARK, APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "unable to open a file descriptor above %u, " "you may need to increase the number of descriptors", LOW_SLACK_LINE); 1.5 +1 -1 apache-1.3/src/ap/ap_strings.c Index: ap_strings.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_strings.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- ap_strings.c 1998/03/31 12:52:14 1.4 +++ ap_strings.c 1998/04/11 12:00:17 1.5 @@ -84,7 +84,7 @@ } inchr++; } - outstring = palloc(p, newlen + 1); + outstring = ap_palloc(p, newlen + 1); inchr = instring; outchr = outstring; /* 1.55 +66 -66 apache-1.3/src/include/alloc.h Index: alloc.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/alloc.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- alloc.h 1998/04/09 08:20:24 1.54 +++ alloc.h 1998/04/11 12:00:18 1.55 @@ -86,45 +86,45 @@ typedef struct pool pool; -pool * init_alloc(void); /* Set up everything */ -API_EXPORT(pool *) make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ -API_EXPORT(void) destroy_pool(pool *); +pool * ap_init_alloc(void); /* Set up everything */ +API_EXPORT(pool *) ap_make_sub_pool(pool *); /* All pools are subpools of permanent_pool */ +API_EXPORT(void) ap_destroy_pool(pool *); /* used to guarantee to the pool debugging code that the sub pool will not be * destroyed before the parent pool */ #ifndef POOL_DEBUG -#ifdef pool_join -#undef pool_join +#ifdef ap_pool_join +#undef ap_pool_join #endif -#define pool_join(a,b) +#define ap_pool_join(a,b) #else -API_EXPORT(void) pool_join(pool *p, pool *sub); -API_EXPORT(pool *) find_pool(const void *ts); -API_EXPORT(int) pool_is_ancestor(pool *a, pool *b); +API_EXPORT(void) ap_pool_join(pool *p, pool *sub); +API_EXPORT(pool *) ap_find_pool(const void *ts); +API_EXPORT(int) ap_pool_is_ancestor(pool *a, pool *b); #endif /* Clearing out EVERYTHING in an pool... destroys any sub-pools */ -API_EXPORT(void) clear_pool(struct pool *); +API_EXPORT(void) ap_clear_pool(struct pool *); /* Preparing for exec() --- close files, etc., but *don't* flush I/O * buffers, *don't* wait for subprocesses, and *don't* free any memory. */ -API_EXPORT(void) cleanup_for_exec(void); +API_EXPORT(void) ap_cleanup_for_exec(void); /* routines to allocate memory from an pool... */ -API_EXPORT(void *) palloc(struct pool *, int nbytes); -API_EXPORT(void *) pcalloc(struct pool *, int nbytes); -API_EXPORT(char *) pstrdup(struct pool *, const char *s); +API_EXPORT(void *) ap_palloc(struct pool *, int nbytes); +API_EXPORT(void *) ap_pcalloc(struct pool *, int nbytes); +API_EXPORT(char *) ap_pstrdup(struct pool *, const char *s); /* make a nul terminated copy of the n characters starting with s */ -API_EXPORT(char *) pstrndup(struct pool *, const char *s, int n); -API_EXPORT_NONSTD(char *) pstrcat(struct pool *,...); /* all '...' must be char* */ -API_EXPORT_NONSTD(char *) psprintf(struct pool *, const char *fmt, ...) +API_EXPORT(char *) ap_pstrndup(struct pool *, const char *s, int n); +API_EXPORT_NONSTD(char *) ap_pstrcat(struct pool *,...); /* all '...' must be char* */ +API_EXPORT_NONSTD(char *) ap_psprintf(struct pool *, const char *fmt, ...) __attribute__((format(printf,2,3))); -API_EXPORT(char *) pvsprintf(struct pool *, const char *fmt, va_list); +API_EXPORT(char *) ap_pvsprintf(struct pool *, const char *fmt, va_list); /* array and alist management... keeping lists of things. * Common enough to want common support code ... @@ -138,10 +138,10 @@ char *elts; } array_header; -API_EXPORT(array_header *) make_array(pool *p, int nelts, int elt_size); -API_EXPORT(void *) push_array(array_header *); -API_EXPORT(void) array_cat(array_header *dst, const array_header *src); -API_EXPORT(array_header *) append_arrays(pool *, const array_header *, +API_EXPORT(array_header *) ap_make_array(pool *p, int nelts, int elt_size); +API_EXPORT(void *) ap_push_array(array_header *); +API_EXPORT(void) ap_array_cat(array_header *dst, const array_header *src); +API_EXPORT(array_header *) ap_append_arrays(pool *, const array_header *, const array_header *); /* copy_array copies the *entire* array. copy_array_hdr just copies @@ -149,8 +149,8 @@ * if) the code subsequently does a push or arraycat. */ -API_EXPORT(array_header *) copy_array(pool *p, const array_header *src); -API_EXPORT(array_header *) copy_array_hdr(pool *p, const array_header *src); +API_EXPORT(array_header *) ap_copy_array(pool *p, const array_header *src); +API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *src); /* Tables. Implemented alist style, for now, though we try to keep @@ -171,21 +171,21 @@ char *val; } table_entry; -API_EXPORT(table *) make_table(pool *p, int nelts); -API_EXPORT(table *) copy_table(pool *p, const table *); -API_EXPORT(void) clear_table(table *); -API_EXPORT(char *) table_get(const table *, const char *); -API_EXPORT(void) table_set(table *, const char *name, const char *val); -API_EXPORT(void) table_setn(table *, const char *name, const char *val); -API_EXPORT(void) table_merge(table *, const char *name, const char *more_val); -API_EXPORT(void) table_mergen(table *, const char *name, const char *more_val); -API_EXPORT(void) table_unset(table *, const char *key); -API_EXPORT(void) table_add(table *, const char *name, const char *val); -API_EXPORT(void) table_addn(table *, const char *name, const char *val); -API_EXPORT(void) table_do(int (*comp) (void *, const char *, const char *), void *rec, +API_EXPORT(table *) ap_make_table(pool *p, int nelts); +API_EXPORT(table *) ap_copy_table(pool *p, const table *); +API_EXPORT(void) ap_clear_table(table *); +API_EXPORT(char *) ap_table_get(const table *, const char *); +API_EXPORT(void) ap_table_set(table *, const char *name, const char *val); +API_EXPORT(void) ap_table_setn(table *, const char *name, const char *val); +API_EXPORT(void) ap_table_merge(table *, const char *name, const char *more_val); +API_EXPORT(void) ap_table_mergen(table *, const char *name, const char *more_val); +API_EXPORT(void) ap_table_unset(table *, const char *key); +API_EXPORT(void) ap_table_add(table *, const char *name, const char *val); +API_EXPORT(void) ap_table_addn(table *, const char *name, const char *val); +API_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const table *t,...); -API_EXPORT(table *) overlay_tables(pool *p, const table *overlay, const table *base); +API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table *base); /* XXX: these know about the definition of struct table in alloc.c. That * definition is not here because it is supposed to be private, and by not @@ -217,16 +217,16 @@ * unblock_alarms() below... */ -API_EXPORT(void) register_cleanup(pool *p, void *data, +API_EXPORT(void) ap_register_cleanup(pool *p, void *data, void (*plain_cleanup) (void *), void (*child_cleanup) (void *)); -API_EXPORT(void) kill_cleanup(pool *p, void *data, void (*plain_cleanup) (void *)); -API_EXPORT(void) run_cleanup(pool *p, void *data, void (*cleanup) (void *)); +API_EXPORT(void) ap_kill_cleanup(pool *p, void *data, void (*plain_cleanup) (void *)); +API_EXPORT(void) ap_run_cleanup(pool *p, void *data, void (*cleanup) (void *)); /* A "do-nothing" cleanup, for register_cleanup; it's faster to do * things this way than to test for NULL. */ -API_EXPORT_NONSTD(void) null_cleanup(void *data); +API_EXPORT_NONSTD(void) ap_null_cleanup(void *data); /* The time between when a resource is actually allocated, and when it * its cleanup is registered is a critical section, during which the @@ -238,39 +238,39 @@ * up with timeout handling in general... */ -API_EXPORT(void) block_alarms(void); -API_EXPORT(void) unblock_alarms(void); +API_EXPORT(void) ap_block_alarms(void); +API_EXPORT(void) ap_unblock_alarms(void); /* Common cases which want utility support.. * the note_cleanups_for_foo routines are for */ -API_EXPORT(FILE *) pfopen(struct pool *, const char *name, const char *fmode); -API_EXPORT(FILE *) pfdopen(struct pool *, int fd, const char *fmode); -API_EXPORT(int) popenf(struct pool *, const char *name, int flg, int mode); - -API_EXPORT(void) note_cleanups_for_file(pool *, FILE *); -API_EXPORT(void) note_cleanups_for_fd(pool *, int); -API_EXPORT(void) kill_cleanups_for_fd(pool *p, int fd); - -API_EXPORT(void) note_cleanups_for_socket(pool *, int); -API_EXPORT(void) kill_cleanups_for_socket(pool *p, int sock); -API_EXPORT(int) psocket(pool *p, int, int, int); -API_EXPORT(int) pclosesocket(pool *a, int sock); +API_EXPORT(FILE *) ap_pfopen(struct pool *, const char *name, const char *fmode); +API_EXPORT(FILE *) ap_pfdopen(struct pool *, int fd, const char *fmode); +API_EXPORT(int) ap_popenf(struct pool *, const char *name, int flg, int mode); + +API_EXPORT(void) ap_note_cleanups_for_file(pool *, FILE *); +API_EXPORT(void) ap_note_cleanups_for_fd(pool *, int); +API_EXPORT(void) ap_kill_cleanups_for_fd(pool *p, int fd); + +API_EXPORT(void) ap_note_cleanups_for_socket(pool *, int); +API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock); +API_EXPORT(int) ap_psocket(pool *p, int, int, int); +API_EXPORT(int) ap_pclosesocket(pool *a, int sock); -API_EXPORT(regex_t *) pregcomp(pool *p, const char *pattern, int cflags); -API_EXPORT(void) pregfree(pool *p, regex_t * reg); +API_EXPORT(regex_t *) ap_pregcomp(pool *p, const char *pattern, int cflags); +API_EXPORT(void) ap_pregfree(pool *p, regex_t * reg); /* routines to note closes... file descriptors are constrained enough * on some systems that we want to support this. */ -API_EXPORT(int) pfclose(struct pool *, FILE *); -API_EXPORT(int) pclosef(struct pool *, int fd); +API_EXPORT(int) ap_pfclose(struct pool *, FILE *); +API_EXPORT(int) ap_pclosef(struct pool *, int fd); /* routines to deal with directories */ -API_EXPORT(DIR *) popendir(pool *p, const char *name); -API_EXPORT(void) pclosedir(pool *p, DIR * d); +API_EXPORT(DIR *) ap_popendir(pool *p, const char *name); +API_EXPORT(void) ap_pclosedir(pool *p, DIR * d); /* ... even child processes (which we may want to wait for, * or to kill outright, on unexpected termination). @@ -290,11 +290,11 @@ kill_only_once /* send SIGTERM and then wait */ }; -API_EXPORT(void) note_subprocess(pool *a, int pid, enum kill_conditions how); -API_EXPORT(int) spawn_child_err(pool *, int (*)(void *), void *, +API_EXPORT(void) ap_note_subprocess(pool *a, int pid, enum kill_conditions how); +API_EXPORT(int) ap_spawn_child_err(pool *, int (*)(void *), void *, enum kill_conditions, FILE **pipe_in, FILE **pipe_out, FILE **pipe_err); -#define spawn_child(p,f,v,k,in,out) spawn_child_err(p,f,v,k,in,out,NULL) +#define spawn_child(p,f,v,k,in,out) ap_spawn_child_err(p,f,v,k,in,out,NULL) /* magic numbers --- min free bytes to consider a free pool block useable, * and the min amount to allocate if we have to go to malloc() */ @@ -308,7 +308,7 @@ /* Finally, some accounting */ -API_EXPORT(long) bytes_in_pool(pool *p); -API_EXPORT(long) bytes_in_free_blocks(void); +API_EXPORT(long) ap_bytes_in_pool(pool *p); +API_EXPORT(long) ap_bytes_in_free_blocks(void); #endif /* !APACHE_ALLOC_H */ 1.37 +27 -27 apache-1.3/src/include/buff.h Index: buff.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/buff.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- buff.h 1998/03/31 12:52:18 1.36 +++ buff.h 1998/04/11 12:00:18 1.37 @@ -136,67 +136,67 @@ #define BO_BYTECT (1) /* Stream creation and modification */ -API_EXPORT(BUFF *) bcreate(pool *p, int flags); -API_EXPORT(void) bpushfd(BUFF *fb, int fd_in, int fd_out); -API_EXPORT(int) bsetopt(BUFF *fb, int optname, const void *optval); -API_EXPORT(int) bgetopt(BUFF *fb, int optname, void *optval); -API_EXPORT(int) bsetflag(BUFF *fb, int flag, int value); -API_EXPORT(int) bclose(BUFF *fb); +API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags); +API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd_in, int fd_out); +API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval); +API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval); +API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value); +API_EXPORT(int) ap_bclose(BUFF *fb); #define bgetflag(fb, flag) ((fb)->flags & (flag)) /* Error handling */ -API_EXPORT(void) bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), +API_EXPORT(void) ap_bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), void *data); /* I/O */ -API_EXPORT(int) bread(BUFF *fb, void *buf, int nbyte); -API_EXPORT(int) bgets(char *s, int n, BUFF *fb); -API_EXPORT(int) blookc(char *buff, BUFF *fb); -API_EXPORT(int) bskiplf(BUFF *fb); -API_EXPORT(int) bwrite(BUFF *fb, const void *buf, int nbyte); -API_EXPORT(int) bflush(BUFF *fb); -API_EXPORT(int) bputs(const char *x, BUFF *fb); -API_EXPORT(int) bvputs(BUFF *fb,...); -API_EXPORT_NONSTD(int) bprintf(BUFF *fb, const char *fmt,...) +API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte); +API_EXPORT(int) ap_bgets(char *s, int n, BUFF *fb); +API_EXPORT(int) ap_blookc(char *buff, BUFF *fb); +API_EXPORT(int) ap_bskiplf(BUFF *fb); +API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte); +API_EXPORT(int) ap_bflush(BUFF *fb); +API_EXPORT(int) ap_bputs(const char *x, BUFF *fb); +API_EXPORT(int) ap_bvputs(BUFF *fb,...); +API_EXPORT_NONSTD(int) ap_bprintf(BUFF *fb, const char *fmt,...) __attribute__((format(printf,2,3))); -API_EXPORT(int) vbprintf(BUFF *fb, const char *fmt, va_list vlist); +API_EXPORT(int) ap_vbprintf(BUFF *fb, const char *fmt, va_list vlist); /* Internal routines */ -API_EXPORT(int) bflsbuf(int c, BUFF *fb); -API_EXPORT(int) bfilbuf(BUFF *fb); +API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb); +API_EXPORT(int) ap_bfilbuf(BUFF *fb); #ifndef CHARSET_EBCDIC -#define bgetc(fb) ( ((fb)->incnt == 0) ? bfilbuf(fb) : \ +#define bgetc(fb) ( ((fb)->incnt == 0) ? ap_bfilbuf(fb) : \ ((fb)->incnt--, *((fb)->inptr++)) ) #define bputc(c, fb) ((((fb)->flags & (B_EOUT|B_WRERR|B_WR)) != B_WR || \ - (fb)->outcnt == (fb)->bufsiz) ? bflsbuf(c, (fb)) : \ + (fb)->outcnt == (fb)->bufsiz) ? ap_bflsbuf(c, (fb)) : \ ((fb)->outbase[(fb)->outcnt++] = (c), 0)) #else /*CHARSET_EBCDIC*/ -#define bgetc(fb) ( ((fb)->incnt == 0) ? bfilbuf(fb) : \ +#define bgetc(fb) ( ((fb)->incnt == 0) ? ap_bfilbuf(fb) : \ ((fb)->incnt--, (fb->flags & B_ASCII2EBCDIC)\ ?os_toebcdic[(unsigned char)*((fb)->inptr++)]:*((fb)->inptr++)) ) #define bputc(c, fb) ((((fb)->flags & (B_EOUT|B_WRERR|B_WR)) != B_WR || \ - (fb)->outcnt == (fb)->bufsiz) ? bflsbuf(c, (fb)) : \ + (fb)->outcnt == (fb)->bufsiz) ? ap_bflsbuf(c, (fb)) : \ ((fb)->outbase[(fb)->outcnt++] = (fb->flags & B_EBCDIC2ASCII)\ ?os_toascii[(unsigned char)c]:(c), 0)) #endif /*CHARSET_EBCDIC*/ -API_EXPORT(int) spawn_child_err_buff(pool *, int (*)(void *), void *, +API_EXPORT(int) ap_spawn_child_err_buff(pool *, int (*)(void *), void *, enum kill_conditions, BUFF **pipe_in, BUFF **pipe_out, BUFF **pipe_err); /* enable non-blocking operations */ -API_EXPORT(int) bnonblock(BUFF *fb, int direction); +API_EXPORT(int) ap_bnonblock(BUFF *fb, int direction); /* and get an fd to select() on */ -API_EXPORT(int) bfileno(BUFF *fb, int direction); +API_EXPORT(int) ap_bfileno(BUFF *fb, int direction); /* bflush() if a read now would block, but don't actually read anything */ -API_EXPORT(void) bhalfduplex(BUFF *fb); +API_EXPORT(void) ap_bhalfduplex(BUFF *fb); #endif /* !APACHE_BUFF_H */ 1.7 +7 -7 apache-1.3/src/include/explain.h Index: explain.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/explain.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- explain.h 1998/02/22 21:17:04 1.6 +++ explain.h 1998/04/11 12:00:19 1.7 @@ -11,25 +11,25 @@ #include "http_log.h" #define DEF_Explain #define Explain0(f) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f) #define Explain1(f,a1) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1) #define Explain2(f,a1,a2) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1,a2) #define Explain3(f,a1,a2,a3) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1,a2,a3) #define Explain4(f,a1,a2,a3,a4) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1,a2,a3,a4) #define Explain5(f,a1,a2,a3,a4,a5) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1,a2,a3,a4,a5) #define Explain6(f,a1,a2,a3,a4,a5,a6) \ - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, \ f,a1,a2,a3,a4,a5,a6) #endif 1.4 +2 -2 apache-1.3/src/include/fnmatch.h Index: fnmatch.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/fnmatch.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- fnmatch.h 1998/04/06 07:26:24 1.3 +++ fnmatch.h 1998/04/11 12:00:19 1.4 @@ -46,9 +46,9 @@ #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ #define FNM_PERIOD 0x04 /* Period must be matched by period. */ -API_EXPORT(int) fnmatch(const char *, const char *, int); +API_EXPORT(int) ap_fnmatch(const char *, const char *, int); /* this function is an Apache addition */ -API_EXPORT(extern int) is_fnmatch(const char *); +API_EXPORT(extern int) ap_is_fnmatch(const char *); #endif /* !_FNMATCH_H_ */ 1.27 +24 -24 apache-1.3/src/include/http_conf_globals.h Index: http_conf_globals.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_conf_globals.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- http_conf_globals.h 1998/04/06 07:43:31 1.26 +++ http_conf_globals.h 1998/04/11 12:00:19 1.27 @@ -62,29 +62,29 @@ * Process config --- what the process ITSELF is doing */ -extern int standalone; -extern uid_t user_id; -extern char *user_name; -extern gid_t group_id; +extern int ap_standalone; +extern uid_t ap_user_id; +extern char *ap_user_name; +extern gid_t ap_group_id; #ifdef MULTIPLE_GROUPS extern gid_t group_id_list[NGROUPS_MAX]; #endif -extern int max_requests_per_child; -extern int threads_per_child; -extern int excess_requests_per_child; -extern struct in_addr bind_address; -extern listen_rec *listeners; -extern int daemons_to_start; -extern int daemons_min_free; -extern int daemons_max_free; -extern int daemons_limit; -extern MODULE_VAR_EXPORT int suexec_enabled; -extern int listenbacklog; +extern int ap_max_requests_per_child; +extern int ap_threads_per_child; +extern int ap_excess_requests_per_child; +extern struct in_addr ap_bind_address; +extern listen_rec *ap_listeners; +extern int ap_daemons_to_start; +extern int ap_daemons_min_free; +extern int ap_daemons_max_free; +extern int ap_daemons_limit; +extern MODULE_VAR_EXPORT int ap_suexec_enabled; +extern int ap_listenbacklog; -extern char *pid_fname; -extern char *scoreboard_fname; -extern char *lock_fname; -extern MODULE_VAR_EXPORT char *server_argv0; +extern char *ap_pid_fname; +extern char *ap_scoreboard_fname; +extern char *ap_lock_fname; +extern MODULE_VAR_EXPORT char *ap_server_argv0; /* Trying to allocate these in the config pool gets us into some *nasty* * chicken-and-egg problems in http_main.c --- where do you stick them @@ -92,16 +92,16 @@ * statically... */ -extern API_VAR_EXPORT char server_root[MAX_STRING_LEN]; -extern char server_confname[MAX_STRING_LEN]; +extern API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; +extern char ap_server_confname[MAX_STRING_LEN]; /* for -C and -c switches */ -extern array_header *server_pre_read_config; -extern array_header *server_post_read_config; +extern array_header *ap_server_pre_read_config; +extern array_header *ap_server_post_read_config; /* We want this to have the least chance of being corrupted if there * is some memory corruption, so we allocate it statically. */ -extern char coredump_dir[MAX_STRING_LEN]; +extern char ap_coredump_dir[MAX_STRING_LEN]; #endif /* !APACHE_HTTP_CONF_GLOBALS_H */ 1.79 +44 -44 apache-1.3/src/include/http_config.h Index: http_config.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_config.h,v retrieving revision 1.78 retrieving revision 1.79 diff -u -r1.78 -r1.79 --- http_config.h 1998/03/31 12:52:21 1.78 +++ http_config.h 1998/04/11 12:00:19 1.79 @@ -236,7 +236,7 @@ */ int (*translate_handler) (request_rec *); - int (*check_user_id) (request_rec *); + int (*ap_check_user_id) (request_rec *); int (*auth_checker) (request_rec *); int (*access_checker) (request_rec *); int (*type_checker) (request_rec *); @@ -278,69 +278,69 @@ * data */ -API_EXPORT(void *) get_module_config(void *conf_vector, module *m); -API_EXPORT(void) set_module_config(void *conf_vector, module *m, void *val); +API_EXPORT(void *) ap_get_module_config(void *conf_vector, module *m); +API_EXPORT(void) ap_set_module_config(void *conf_vector, module *m, void *val); /* Generic command handling function... */ -API_EXPORT_NONSTD(const char *) set_string_slot(cmd_parms *, char *, char *); -API_EXPORT_NONSTD(const char *) set_string_slot_lower(cmd_parms *, char *, char *); -API_EXPORT_NONSTD(const char *) set_flag_slot(cmd_parms *, char *, int); -API_EXPORT_NONSTD(const char *) set_file_slot(cmd_parms *, char *, char *); +API_EXPORT_NONSTD(const char *) ap_set_string_slot(cmd_parms *, char *, char *); +API_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *, char *, char *); +API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *, char *, int); +API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *, char *, char *); /* For modules which need to read config files, open logs, etc. ... * this returns the fname argument if it begins with '/'; otherwise * it relativizes it wrt server_root. */ -API_EXPORT(char *) server_root_relative(pool *p, char *fname); +API_EXPORT(char *) ap_server_root_relative(pool *p, char *fname); /* Finally, the hook for dynamically loading modules in... */ -API_EXPORT(void) add_module(module *m); -API_EXPORT(void) remove_module(module *m); -API_EXPORT(int) add_named_module(const char *name); -API_EXPORT(void) clear_module_list(void); -API_EXPORT(const char *) find_module_name(module *m); -API_EXPORT(module *) find_linked_module(const char *name); +API_EXPORT(void) ap_add_module(module *m); +API_EXPORT(void) ap_remove_module(module *m); +API_EXPORT(int) ap_add_named_module(const char *name); +API_EXPORT(void) ap_clear_module_list(void); +API_EXPORT(const char *) ap_find_module_name(module *m); +API_EXPORT(module *) ap_find_linked_module(const char *name); /* for implementing subconfigs and customized config files */ -API_EXPORT(const char *) srm_command_loop(cmd_parms *parms, void *config); +API_EXPORT(const char *) ap_srm_command_loop(cmd_parms *parms, void *config); #ifdef CORE_PRIVATE extern API_VAR_EXPORT module *top_module; -extern module *prelinked_modules[]; -extern module *preloaded_modules[]; +extern module *ap_prelinked_modules[]; +extern module *ap_preloaded_modules[]; /* For http_main.c... */ -server_rec *read_config(pool *conf_pool, pool *temp_pool, char *config_name); -void init_modules(pool *p, server_rec *s); -void child_init_modules(pool *p, server_rec *s); -void child_exit_modules(pool *p, server_rec *s); -void setup_prelinked_modules(void); -void show_directives(void); -void show_modules(void); +server_rec *ap_read_config(pool *conf_pool, pool *temp_pool, char *config_name); +void ap_init_modules(pool *p, server_rec *s); +void ap_child_init_modules(pool *p, server_rec *s); +void ap_child_exit_modules(pool *p, server_rec *s); +void ap_setup_prelinked_modules(void); +void ap_show_directives(void); +void ap_show_modules(void); /* For http_request.c... */ -void *create_request_config(pool *p); -CORE_EXPORT(void *) create_per_dir_config(pool *p); -void *merge_per_dir_configs(pool *p, void *base, void *new); +void *ap_create_request_config(pool *p); +CORE_EXPORT(void *) ap_create_per_dir_config(pool *p); +void *ap_merge_per_dir_configs(pool *p, void *base, void *new); /* For http_core.c... (<Directory> command and virtual hosts) */ -int parse_htaccess(void **result, request_rec *r, int override, +int ap_parse_htaccess(void **result, request_rec *r, int override, const char *path, const char *access_name); -CORE_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, +CORE_EXPORT(const char *) ap_init_virtual_host(pool *p, const char *hostname, server_rec *main_server, server_rec **); -void process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp); +void ap_process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp); /* check_cmd_context() definitions: */ -API_EXPORT(const char *) check_cmd_context(cmd_parms *cmd, unsigned forbidden); +API_EXPORT(const char *) ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden); /* check_cmd_context(): Forbidden in: */ #define NOT_IN_VIRTUALHOST 0x01 /* <Virtualhost> */ @@ -354,22 +354,22 @@ /* Module-method dispatchers, also for http_request.c */ -int translate_name(request_rec *); -int check_access(request_rec *); /* check access on non-auth basis */ -int check_user_id(request_rec *); /* obtain valid username from client auth */ -int check_auth(request_rec *); /* check (validated) user is authorized here */ -int find_types(request_rec *); /* identify MIME type */ -int run_fixups(request_rec *); /* poke around for other metainfo, etc.... */ -int invoke_handler(request_rec *); -int log_transaction(request_rec *r); -int header_parse(request_rec *); -int run_post_read_request(request_rec *); +int ap_translate_name(request_rec *); +int ap_check_access(request_rec *); /* check access on non-auth basis */ +int ap_check_user_id(request_rec *); /* obtain valid username from client auth */ +int ap_check_auth(request_rec *); /* check (validated) user is authorized here */ +int ap_find_types(request_rec *); /* identify MIME type */ +int ap_run_fixups(request_rec *); /* poke around for other metainfo, etc.... */ +int ap_invoke_handler(request_rec *); +int ap_log_transaction(request_rec *r); +int ap_header_parse(request_rec *); +int ap_run_post_read_request(request_rec *); /* for mod_perl */ -CORE_EXPORT(const command_rec *) find_command(const char *name, const command_rec *cmds); -CORE_EXPORT(const command_rec *) find_command_in_modules(const char *cmd_name, module **mod); -CORE_EXPORT(const char *) handle_command(cmd_parms *parms, void *config, const char *l); +CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds); +CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod); +CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l); #endif 1.42 +23 -23 apache-1.3/src/include/http_core.h Index: http_core.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_core.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- http_core.h 1998/03/31 12:52:24 1.41 +++ http_core.h 1998/04/11 12:00:19 1.42 @@ -91,23 +91,23 @@ #define SATISFY_ANY 1 #define SATISFY_NOSPEC 2 -API_EXPORT(int) allow_options (request_rec *); -API_EXPORT(int) allow_overrides (request_rec *); -API_EXPORT(char *) default_type (request_rec *); -API_EXPORT(char *) document_root (request_rec *); /* Don't use this! If your request went +API_EXPORT(int) ap_allow_options (request_rec *); +API_EXPORT(int) ap_allow_overrides (request_rec *); +API_EXPORT(char *) ap_default_type (request_rec *); +API_EXPORT(char *) ap_document_root (request_rec *); /* Don't use this! If your request went * through a Userdir, or something like * that, it'll screw you. But it's * back-compatible... */ -API_EXPORT(const char *) get_remote_host(conn_rec *conn, void *dir_config, int type); -API_EXPORT(const char *) get_remote_logname(request_rec *r); +API_EXPORT(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type); +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 *) construct_url(pool *p, const char *uri, const request_rec *r); -API_EXPORT(const char *) get_server_name(const request_rec *r); -API_EXPORT(unsigned) get_server_port(const request_rec *r); +API_EXPORT(char *) ap_construct_url(pool *p, const char *uri, const request_rec *r); +API_EXPORT(const char *) ap_get_server_name(const request_rec *r); +API_EXPORT(unsigned) ap_get_server_port(const request_rec *r); /* Authentication stuff. This is one of the places where compatibility * with the old config files *really* hurts; they don't discriminate at @@ -121,10 +121,10 @@ char *requirement; } require_line; -API_EXPORT(char *) auth_type (request_rec *); -API_EXPORT(char *) auth_name (request_rec *); -API_EXPORT(int) satisfies (request_rec *r); -API_EXPORT(array_header *) requires (request_rec *); +API_EXPORT(char *) ap_auth_type (request_rec *); +API_EXPORT(char *) ap_auth_name (request_rec *); +API_EXPORT(int) ap_satisfies (request_rec *r); +API_EXPORT(array_header *) ap_requires (request_rec *); #ifdef CORE_PRIVATE @@ -134,7 +134,7 @@ * the code that cares really is in http_core.c. Also, anothre accessor. */ -char *response_code_string (request_rec *r, int error_index); +char *ap_response_code_string (request_rec *r, int error_index); extern API_VAR_EXPORT module core_module; @@ -166,14 +166,14 @@ * goes untyped by other mechanisms before it slips out the door... */ - char *default_type; + char *ap_default_type; /* Authentication stuff. Groan... */ int satisfy; - char *auth_type; - char *auth_name; - array_header *requires; + char *ap_auth_type; + char *ap_auth_name; + array_header *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, @@ -231,7 +231,7 @@ * so it's at least a minimally functional web server on its own (and * can be tested that way). But let's keep it to the bare minimum: */ - char *document_root; + char *ap_document_root; /* Access control */ @@ -241,12 +241,12 @@ } core_server_config; /* for http_config.c */ -void core_reorder_directories(pool *, server_rec *); +void ap_core_reorder_directories(pool *, server_rec *); /* for mod_perl */ -CORE_EXPORT(void) add_per_dir_conf (server_rec *s, void *dir_config); -CORE_EXPORT(void) add_per_url_conf (server_rec *s, void *url_config); -CORE_EXPORT_NONSTD(const char *) limit_section (cmd_parms *cmd, void *dummy, const char *arg); +CORE_EXPORT(void) ap_add_per_dir_conf (server_rec *s, void *dir_config); +CORE_EXPORT(void) ap_add_per_url_conf (server_rec *s, void *url_config); +CORE_EXPORT_NONSTD(const char *) ap_limit_section (cmd_parms *cmd, void *dummy, const char *arg); #endif 1.28 +10 -10 apache-1.3/src/include/http_log.h Index: http_log.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_log.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- http_log.h 1998/03/31 12:52:25 1.27 +++ http_log.h 1998/04/11 12:00:20 1.28 @@ -100,19 +100,19 @@ #define APLOG_MARK __FILE__,__LINE__ -void open_logs (server_rec *, pool *p); -API_EXPORT(void) aplog_error(const char *file, int line, int level, +void ap_open_logs (server_rec *, pool *p); +API_EXPORT(void) ap_log_error(const char *file, int line, int level, const server_rec *s, const char *fmt, ...) __attribute__((format(printf,5,6))); -API_EXPORT(void) error_log2stderr (server_rec *); +API_EXPORT(void) ap_error_log2stderr (server_rec *); -void log_pid (pool *p, char *fname); -API_EXPORT(void) log_error(const char *err, server_rec *s); -API_EXPORT(void) log_unixerr(const char *routine, const char *file, +void ap_log_pid (pool *p, char *fname); +API_EXPORT(void) ap_log_error_old(const char *err, server_rec *s); +API_EXPORT(void) ap_log_unixerr(const char *routine, const char *file, const char *msg, server_rec *s); -API_EXPORT(void) log_printf(const server_rec *s, const char *fmt, ...) +API_EXPORT(void) ap_log_printf(const server_rec *s, const char *fmt, ...) __attribute__((format(printf,2,3))); -API_EXPORT(void) log_reason(const char *reason, const char *fname, +API_EXPORT(void) ap_log_reason(const char *reason, const char *fname, request_rec *r); typedef struct piped_log { @@ -126,8 +126,8 @@ #endif } piped_log; -API_EXPORT(piped_log *) open_piped_log (pool *p, const char *program); -API_EXPORT(void) close_piped_log (piped_log *); +API_EXPORT(piped_log *) ap_open_piped_log (pool *p, const char *program); +API_EXPORT(void) ap_close_piped_log (piped_log *); #ifndef NO_RELIABLE_PIPED_LOGS #define piped_log_read_fd(pl) ((pl)->fds[0]) #define piped_log_write_fd(pl) ((pl)->fds[1]) 1.28 +15 -15 apache-1.3/src/include/http_main.h Index: http_main.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_main.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- http_main.h 1998/04/06 06:43:14 1.27 +++ http_main.h 1998/04/11 12:00:20 1.28 @@ -108,20 +108,20 @@ * reset_timeout() resets the timeout in progress. */ -void start_shutdown(void); -void start_restart(int); -API_EXPORT(void) hard_timeout(char *, request_rec *); -void keepalive_timeout(char *, request_rec *); -API_EXPORT(void) soft_timeout(char *, request_rec *); -API_EXPORT(void) kill_timeout(request_rec *); -API_EXPORT(void) reset_timeout(request_rec *); +void ap_start_shutdown(void); +void ap_start_restart(int); +API_EXPORT(void) ap_hard_timeout(char *, request_rec *); +void ap_keepalive_timeout(char *, request_rec *); +API_EXPORT(void) ap_soft_timeout(char *, request_rec *); +API_EXPORT(void) ap_kill_timeout(request_rec *); +API_EXPORT(void) ap_reset_timeout(request_rec *); -API_EXPORT(void) child_terminate(request_rec *r); -API_EXPORT(void) sync_scoreboard_image(void); -int update_child_status(int child_num, int status, request_rec *r); -void time_process_request(int child_num, int status); -unsigned int set_callback_and_alarm(void (*fn) (int), int x); -API_EXPORT(int) check_alarm(void); +API_EXPORT(void) ap_child_terminate(request_rec *r); +API_EXPORT(void) ap_sync_scoreboard_image(void); +int ap_update_child_status(int child_num, int status, request_rec *r); +void ap_time_process_request(int child_num, int status); +unsigned int ap_set_callback_and_alarm(void (*fn) (int), int x); +API_EXPORT(int) ap_check_alarm(void); #ifndef NO_OTHER_CHILD /* @@ -138,7 +138,7 @@ * This is useful for log pipe children, to know when they've blocked. To * disable this feature, use -1 for write_fd. */ -API_EXPORT(void) register_other_child(int pid, +API_EXPORT(void) ap_register_other_child(int pid, void (*maintenance) (int reason, void *data, int status), void *data, int write_fd); #define OC_REASON_DEATH 0 /* child has died, caller must call @@ -159,7 +159,7 @@ * is assumed to be unique per other_child. This is because the pid and * write_fd are possibly killed off separately. */ -API_EXPORT(void) unregister_other_child(void *data); +API_EXPORT(void) ap_unregister_other_child(void *data); #endif 1.41 +39 -39 apache-1.3/src/include/http_protocol.h Index: http_protocol.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_protocol.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- http_protocol.h 1998/04/08 06:30:46 1.40 +++ http_protocol.h 1998/04/11 12:00:22 1.41 @@ -65,11 +65,11 @@ /* Read a request and fill in the fields. */ -request_rec *read_request(conn_rec *c); +request_rec *ap_read_request(conn_rec *c); /* Send a single HTTP header field */ -API_EXPORT_NONSTD(int) send_header_field(request_rec *r, const char *fieldname, +API_EXPORT_NONSTD(int) ap_send_header_field(request_rec *r, const char *fieldname, const char *fieldval); /* Send the minimal part of an HTTP response header... but modules should be @@ -77,20 +77,20 @@ * Much of the HTTP/1.1 implementation correctness depends on code in * send_http_header(). */ -API_EXPORT(void) basic_http_header(request_rec *r); +API_EXPORT(void) ap_basic_http_header(request_rec *r); /* Send the Status-Line and header fields for HTTP response */ -API_EXPORT(void) send_http_header(request_rec *l); +API_EXPORT(void) ap_send_http_header(request_rec *l); /* Send the response to special method requests */ -int send_http_trace(request_rec *r); -int send_http_options(request_rec *r); +int ap_send_http_trace(request_rec *r); +int ap_send_http_options(request_rec *r); /* Finish up stuff after a request */ -void finalize_request_protocol(request_rec *r); +void ap_finalize_request_protocol(request_rec *r); /* Send error back to client... last arg indicates error status in case * we get an error in the process of trying to deal with an ErrorDocument @@ -99,7 +99,7 @@ * problem with the ErrorDocument. */ -void send_error_response(request_rec *r, int recursive_error); +void ap_send_error_response(request_rec *r, int recursive_error); /* Set last modified header line from the lastmod date of the associated file. * Also, set content length. @@ -108,12 +108,12 @@ * permit_cache argument is set to one). */ -API_EXPORT(int) set_content_length(request_rec *r, long length); -API_EXPORT(int) set_keepalive(request_rec *r); -API_EXPORT(time_t) rationalize_mtime(request_rec *r, time_t mtime); -API_EXPORT(void) set_etag(request_rec *r); -API_EXPORT(void) set_last_modified(request_rec *r); -API_EXPORT(int) meets_conditions(request_rec *r); +API_EXPORT(int) ap_set_content_length(request_rec *r, long length); +API_EXPORT(int) ap_set_keepalive(request_rec *r); +API_EXPORT(time_t) ap_rationalize_mtime(request_rec *r, time_t mtime); +API_EXPORT(void) ap_set_etag(request_rec *r); +API_EXPORT(void) ap_set_last_modified(request_rec *r); +API_EXPORT(int) ap_meets_conditions(request_rec *r); /* Other ways to send stuff at the client. All of these keep track * of bytes_sent automatically. This indirection is intended to make @@ -126,45 +126,45 @@ * (Ditto the send_header stuff). */ -API_EXPORT(long) send_fd(FILE *f, request_rec *r); -API_EXPORT(long) send_fd_length(FILE *f, request_rec *r, long length); +API_EXPORT(long) ap_send_fd(FILE *f, request_rec *r); +API_EXPORT(long) ap_send_fd_length(FILE *f, request_rec *r, long length); -API_EXPORT(long) send_fb(BUFF *f, request_rec *r); -API_EXPORT(long) send_fb_length(BUFF *f, request_rec *r, long length); +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) send_mmap(void *mm, request_rec *r, size_t offset, +API_EXPORT(size_t) ap_send_mmap(void *mm, request_rec *r, size_t offset, size_t length); /* Hmmm... could macrofy these for now, and maybe forever, though the * definitions of the macros would get a whole lot hairier. */ -API_EXPORT(int) rputc(int c, request_rec *r); -API_EXPORT(int) rputs(const char *str, request_rec *r); -API_EXPORT(int) rwrite(const void *buf, int nbyte, request_rec *r); -API_EXPORT_NONSTD(int) rvputs(request_rec *r,...); -API_EXPORT_NONSTD(int) rprintf(request_rec *r, const char *fmt,...) +API_EXPORT(int) ap_rputc(int c, request_rec *r); +API_EXPORT(int) ap_rputs(const char *str, request_rec *r); +API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r); +API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r,...); +API_EXPORT_NONSTD(int) ap_rprintf(request_rec *r, const char *fmt,...) __attribute__((format(printf,2,3))); -API_EXPORT(int) rflush(request_rec *r); +API_EXPORT(int) ap_rflush(request_rec *r); /* * Index used in custom_responses array for a specific error code * (only use outside protocol.c is in getting them configured). */ -API_EXPORT(int) index_of_response(int status); +API_EXPORT(int) ap_index_of_response(int status); /* Reading a block of data from the client connection (e.g., POST arg) */ -API_EXPORT(int) setup_client_block(request_rec *r, int read_policy); -API_EXPORT(int) should_client_block(request_rec *r); -API_EXPORT(long) get_client_block(request_rec *r, char *buffer, int bufsiz); -API_EXPORT(int) discard_request_body(request_rec *r); +API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy); +API_EXPORT(int) ap_should_client_block(request_rec *r); +API_EXPORT(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz); +API_EXPORT(int) ap_discard_request_body(request_rec *r); /* Sending a byterange */ -API_EXPORT(int) set_byterange(request_rec *r); -API_EXPORT(int) each_byterange(request_rec *r, long *offset, long *length); +API_EXPORT(int) ap_set_byterange(request_rec *r); +API_EXPORT(int) ap_each_byterange(request_rec *r, long *offset, long *length); /* Support for the Basic authentication protocol. Note that there's * nothing that prevents these from being in mod_auth.c, except that other @@ -188,21 +188,21 @@ * */ -API_EXPORT(void) note_auth_failure(request_rec *r); -API_EXPORT(void) note_basic_auth_failure(request_rec *r); -API_EXPORT(void) note_digest_auth_failure(request_rec *r); -API_EXPORT(int) get_basic_auth_pw(request_rec *r, char **pw); +API_EXPORT(void) ap_note_auth_failure(request_rec *r); +API_EXPORT(void) ap_note_basic_auth_failure(request_rec *r); +API_EXPORT(void) ap_note_digest_auth_failure(request_rec *r); +API_EXPORT(int) ap_get_basic_auth_pw(request_rec *r, char **pw); /* * Setting up the protocol fields for subsidiary requests... * Also, a wrapup function to keep the internal accounting straight. */ -void set_sub_req_protocol(request_rec *rnew, const request_rec *r); -void finalize_sub_req_protocol(request_rec *sub_r); +void ap_set_sub_req_protocol(request_rec *rnew, const request_rec *r); +void ap_finalize_sub_req_protocol(request_rec *sub_r); /* This is also useful for putting sub_reqs and internal_redirects together */ -CORE_EXPORT(void) parse_uri(request_rec *r, const char *uri); +CORE_EXPORT(void) ap_parse_uri(request_rec *r, const char *uri); #endif /* !APACHE_HTTP_PROTOCOL_H */ 1.23 +11 -11 apache-1.3/src/include/http_request.h Index: http_request.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_request.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- http_request.h 1998/03/31 12:52:26 1.22 +++ http_request.h 1998/04/11 12:00:22 1.23 @@ -78,12 +78,12 @@ * about which was allocated in its pool elsewhere before doing this. */ -API_EXPORT(request_rec *) sub_req_lookup_uri(const char *new_file, +API_EXPORT(request_rec *) ap_sub_req_lookup_uri(const char *new_file, const request_rec *r); -API_EXPORT(request_rec *) sub_req_lookup_file(const char *new_file, +API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file, const request_rec *r); -API_EXPORT(int) run_sub_req(request_rec *r); -API_EXPORT(void) destroy_sub_req(request_rec *r); +API_EXPORT(int) ap_run_sub_req(request_rec *r); +API_EXPORT(void) ap_destroy_sub_req(request_rec *r); /* * Then there's the case that you want some other request to be served @@ -91,16 +91,16 @@ * If so, call this from a handler, and then immediately return OK. */ -API_EXPORT(void) internal_redirect(const char *new_uri, request_rec *); -API_EXPORT(void) internal_redirect_handler(const char *new_uri, request_rec *); -API_EXPORT(int) some_auth_required(request_rec *r); -API_EXPORT(int) is_initial_req(request_rec *r); -API_EXPORT(time_t) update_mtime(request_rec *r, time_t dependency_mtime); +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(time_t) ap_update_mtime(request_rec *r, time_t dependency_mtime); #ifdef CORE_PRIVATE /* Function called by main.c to handle first-level request */ -void process_request(request_rec *); -void die(int type, request_rec *r); +void ap_process_request(request_rec *); +void ap_die(int type, request_rec *r); #endif #endif /* !APACHE_HTTP_REQUEST_H */ 1.8 +7 -7 apache-1.3/src/include/http_vhost.h Index: http_vhost.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/http_vhost.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- http_vhost.h 1998/03/31 12:52:27 1.7 +++ http_vhost.h 1998/04/11 12:00:22 1.8 @@ -59,29 +59,29 @@ #define APACHE_HTTP_VHOST_H /* called before any config is read */ -void init_vhost_config(pool *p); +void ap_init_vhost_config(pool *p); /* called after the config has been read */ -void fini_vhost_config(pool *p, server_rec *main_server); +void ap_fini_vhost_config(pool *p, server_rec *main_server); /* handle addresses in <VirtualHost> statement */ -const char *parse_vhost_addrs(pool *p, const char *hostname, server_rec *s); +const char *ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s); /* handle NameVirtualHost directive */ -const char *set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg); +const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg); /* given an ip address only, give our best guess as to what vhost it is */ -void update_vhost_given_ip(conn_rec *conn); +void ap_update_vhost_given_ip(conn_rec *conn); /* The above is never enough, and this is always called after the headers * have been read. It may change r->server. */ -void update_vhost_from_headers(request_rec *r); +void ap_update_vhost_from_headers(request_rec *r); /* return 1 if the host:port matches any of the aliases of r->server * return 0 otherwise */ -API_EXPORT(int) matches_request_vhost(request_rec *r, const char *host, +API_EXPORT(int) ap_matches_request_vhost(request_rec *r, const char *host, unsigned port); #endif /* !APACHE_HTTP_VHOST_H */ 1.202 +64 -64 apache-1.3/src/include/httpd.h Index: httpd.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/httpd.h,v retrieving revision 1.201 retrieving revision 1.202 diff -u -r1.201 -r1.202 --- httpd.h 1998/03/31 12:52:27 1.201 +++ httpd.h 1998/04/11 12:00:22 1.202 @@ -369,8 +369,8 @@ #define SERVER_VERSION SERVER_BASEVERSION #endif -API_EXPORT(const char *) apapi_get_server_version(void); -API_EXPORT(const char *) apapi_get_server_built(void); +API_EXPORT(const char *) ap_get_server_version(void); +API_EXPORT(const char *) ap_get_server_built(void); /* Numeric release version identifier: major minor bugfix betaseq * Always increases along the same track as the source branch. @@ -723,7 +723,7 @@ * this gets set to the user name. We assume * that there's only one user per connection(!) */ - char *auth_type; /* Ditto. */ + char *ap_auth_type; /* Ditto. */ unsigned aborted:1; /* Are we still talking? */ signed int keepalive:2; /* Are we using HTTP Keep-Alive? @@ -810,64 +810,64 @@ /* Prototypes for utilities... util.c. */ -extern void util_init(void); +extern void ap_util_init(void); /* Time */ -extern API_VAR_EXPORT const char month_snames[12][4]; -extern API_VAR_EXPORT const char day_snames[7][4]; +extern API_VAR_EXPORT const char ap_month_snames[12][4]; +extern API_VAR_EXPORT const char ap_day_snames[7][4]; -API_EXPORT(struct tm *) get_gmtoff(int *tz); -API_EXPORT(char *) get_time(void); -API_EXPORT(char *) ht_time(pool *p, time_t t, const char *fmt, int gmt); -API_EXPORT(char *) gm_timestr_822(pool *p, time_t t); +API_EXPORT(struct tm *) ap_get_gmtoff(int *tz); +API_EXPORT(char *) ap_get_time(void); +API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt); +API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t t); /* 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 *) getword(pool *p, const char **line, char stop); -API_EXPORT(char *) getword_nc(pool *p, char **line, char stop); -API_EXPORT(char *) getword_white(pool *p, const char **line); -API_EXPORT(char *) getword_white_nc(pool *p, char **line); -API_EXPORT(char *) getword_nulls(pool *p, const char **line, char stop); -API_EXPORT(char *) getword_nulls_nc(pool *p, char **line, char stop); -API_EXPORT(char *) getword_conf(pool *p, const char **line); -API_EXPORT(char *) getword_conf_nc(pool *p, char **line); - -API_EXPORT(char *) get_token(pool *p, char **accept_line, int accept_white); -API_EXPORT(int) find_token(pool *p, const char *line, const char *tok); -API_EXPORT(int) find_last_token(pool *p, const char *line, const char *tok); - -API_EXPORT(int) is_url(const char *u); -API_EXPORT(int) unescape_url(char *url); -API_EXPORT(void) no2slash(char *name); -API_EXPORT(void) getparents(char *name); -API_EXPORT(char *) escape_path_segment(pool *p, const char *s); -API_EXPORT(char *) os_escape_path(pool *p, const char *path, int partial); -#define escape_uri(ppool,path) os_escape_path(ppool,path,1) -API_EXPORT(char *) escape_html(pool *p, const char *s); -API_EXPORT(char *) construct_server(pool *p, const char *hostname, +API_EXPORT(char *) ap_getword(pool *p, const char **line, char stop); +API_EXPORT(char *) ap_getword_nc(pool *p, char **line, char stop); +API_EXPORT(char *) ap_getword_white(pool *p, const char **line); +API_EXPORT(char *) ap_getword_white_nc(pool *p, char **line); +API_EXPORT(char *) ap_getword_nulls(pool *p, const char **line, char stop); +API_EXPORT(char *) ap_getword_nulls_nc(pool *p, char **line, char stop); +API_EXPORT(char *) ap_getword_conf(pool *p, const char **line); +API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line); + +API_EXPORT(char *) ap_get_token(pool *p, char **accept_line, int accept_white); +API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok); +API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok); + +API_EXPORT(int) ap_is_url(const char *u); +API_EXPORT(int) ap_unescape_url(char *url); +API_EXPORT(void) ap_no2slash(char *name); +API_EXPORT(void) ap_getparents(char *name); +API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *s); +API_EXPORT(char *) ap_escape_path(pool *p, const char *path, int partial); +#define escape_uri(ppool,path) ap_escape_path(ppool,path,1) +API_EXPORT(char *) ap_escape_html(pool *p, const char *s); +API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname, unsigned port, const request_rec *r); -API_EXPORT(char *) escape_shell_cmd(pool *p, const char *s); +API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *s); -API_EXPORT(int) count_dirs(const char *path); -API_EXPORT(char *) make_dirstr_prefix(char *d, const char *s, int n); -API_EXPORT(char *) make_dirstr_parent(pool *p, const char *s); +API_EXPORT(int) ap_count_dirs(const char *path); +API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n); +API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s); /* deprecated. The previous two routines are preferred. */ -API_EXPORT(char *) make_dirstr(pool *a, const char *s, int n); -API_EXPORT(char *) make_full_path(pool *a, const char *dir, const char *f); +API_EXPORT(char *) ap_make_dirstr(pool *a, const char *s, int n); +API_EXPORT(char *) ap_make_full_path(pool *a, const char *dir, const char *f); -API_EXPORT(int) is_matchexp(const char *str); -API_EXPORT(int) strcmp_match(const char *str, const char *exp); -API_EXPORT(int) strcasecmp_match(const char *str, const char *exp); -API_EXPORT(char *) uudecode(pool *, const char *); +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_uudecode(pool *, const char *); -API_EXPORT(char *) pregsub(pool *p, const char *input, const char *source, +API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[]); -API_EXPORT(void) str_tolower(char *); -API_EXPORT(int) ind(const char *, char); /* Sigh... */ -API_EXPORT(int) rind(const char *, char); +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 (pool *p, const char *instring); @@ -882,23 +882,23 @@ } configfile_t; /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) pcfg_openfile(pool *p, const char *name); +API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name); /* Allocate a configfile_t handle with user defined functions and params */ -API_EXPORT(configfile_t *) pcfg_open_custom(pool *p, const char *descr, +API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr, void *param, int(*getc_func)(void*), void *(*gets_func) (void *buf, size_t bufsiz, void *param), int(*close_func)(void*)); /* Read one line from open configfile_t, strip LF, increase line number */ -API_EXPORT(int) cfg_getline(char *buf, size_t bufsize, configfile_t *cfp); +API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp); /* Read one char from open configfile_t, increase line number upon LF */ -API_EXPORT(int) cfg_getc(configfile_t *cfp); +API_EXPORT(int) ap_cfg_getc(configfile_t *cfp); /* Detach from open configfile_t, calling the close handler */ -API_EXPORT(int) cfg_closefile(configfile_t *fp); +API_EXPORT(int) ap_cfg_closefile(configfile_t *fp); #ifdef NEED_STRERROR char *strerror(int err); @@ -906,22 +906,22 @@ /* Misc system hackery */ -API_EXPORT(uid_t) uname2id(const char *name); -API_EXPORT(gid_t) gname2id(const char *name); -API_EXPORT(int) is_directory(const char *name); -API_EXPORT(int) can_exec(const struct stat *); -API_EXPORT(void) chdir_file(const char *file); +API_EXPORT(uid_t) ap_uname2id(const char *name); +API_EXPORT(gid_t) ap_gname2id(const char *name); +API_EXPORT(int) ap_is_directory(const char *name); +API_EXPORT(int) ap_can_exec(const struct stat *); +API_EXPORT(void) ap_chdir_file(const char *file); #ifndef HAVE_CANONICAL_FILENAME -#define os_canonical_filename(p,f) (f) +#define ap_canonical_filename(p,f) (f) #else -API_EXPORT(char *) os_canonical_filename(pool *p, const char *file); +API_EXPORT(char *) ap_canonical_filename(pool *p, const char *file); #endif -char *get_local_host(pool *); -unsigned long get_virthost_addr(const char *hostname, unsigned short *port); +char *ap_get_local_host(pool *); +unsigned long ap_get_virthost_addr(const char *hostname, unsigned short *port); -extern API_VAR_EXPORT time_t restart_time; +extern API_VAR_EXPORT time_t ap_restart_time; /* * Apache tries to keep all of its long term filehandles (such as log files, @@ -958,9 +958,9 @@ /* * Redefine assert() to something more useful for an Apache... */ -API_EXPORT(void) log_assert(const char *szExp, const char *szFile, int nLine) +API_EXPORT(void) ap_log_assert(const char *szExp, const char *szFile, int nLine) __attribute__((noreturn)); -#define ap_assert(exp) (void)( (exp) || (log_assert(#exp, __FILE__, __LINE__), 0) ) +#define ap_assert(exp) (void)( (exp) || (ap_log_assert(#exp, __FILE__, __LINE__), 0) ) /* The optimized timeout code only works if we're not MULTITHREAD and we're * also not using a scoreboard file @@ -990,7 +990,7 @@ #define RAISE_SIGSTOP(x) #endif -API_EXPORT(extern const char *) psignature(const char *prefix, request_rec *r); +API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r); /* strtoul does not exist on sunos4. */ #ifdef strtoul 1.13 +3 -3 apache-1.3/src/include/md5.h Index: md5.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/md5.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- md5.h 1998/03/31 12:52:28 1.12 +++ md5.h 1998/04/11 12:00:23 1.13 @@ -100,9 +100,9 @@ unsigned char buffer[64]; /* input buffer */ } AP_MD5_CTX; -API_EXPORT(void) MD5Init(AP_MD5_CTX * context); -API_EXPORT(void) MD5Update(AP_MD5_CTX * context, const unsigned char *input, +API_EXPORT(void) ap_MD5Init(AP_MD5_CTX * context); +API_EXPORT(void) ap_MD5Update(AP_MD5_CTX * context, const unsigned char *input, unsigned int inputLen); -API_EXPORT(void) MD5Final(unsigned char digest[16], AP_MD5_CTX * context); +API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context); #endif /* !APACHE_MD5_H */ 1.10 +10 -10 apache-1.3/src/include/multithread.h Index: multithread.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/multithread.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- multithread.h 1998/01/21 19:17:42 1.9 +++ multithread.h 1998/04/11 12:00:23 1.10 @@ -23,11 +23,11 @@ void exit_thread(int status); void free_thread(thread *thread_id); -API_EXPORT(mutex *) create_mutex(char *name); -API_EXPORT(mutex *) open_mutex(char *name); -API_EXPORT(int) acquire_mutex(mutex *mutex_id); -API_EXPORT(int) release_mutex(mutex *mutex_id); -API_EXPORT(void) destroy_mutex(mutex *mutex_id); +API_EXPORT(mutex *) ap_create_mutex(char *name); +API_EXPORT(mutex *) ap_open_mutex(char *name); +API_EXPORT(int) ap_acquire_mutex(mutex *mutex_id); +API_EXPORT(int) ap_release_mutex(mutex *mutex_id); +API_EXPORT(void) ap_destroy_mutex(mutex *mutex_id); semaphore *create_semaphore(int initial); int acquire_semaphore(semaphore *semaphore_id); @@ -45,12 +45,12 @@ #define APACHE_TLS /* Only define the ones actually used, for now */ -extern void *dummy_mutex; +extern void *ap_dummy_mutex; -#define create_mutex(name) ((mutex *)dummy_mutex) -#define acquire_mutex(mutex_id) ((int)MULTI_OK) -#define release_mutex(mutex_id) ((int)MULTI_OK) -#define destroy_mutex(mutex_id) (0) +#define ap_create_mutex(name) ((mutex *)ap_dummy_mutex) +#define ap_acquire_mutex(mutex_id) ((int)MULTI_OK) +#define ap_release_mutex(mutex_id) ((int)MULTI_OK) +#define ap_destroy_mutex(mutex_id) (0) #endif /* ndef MULTITHREAD */ 1.10 +1 -1 apache-1.3/src/include/rfc1413.h Index: rfc1413.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/rfc1413.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- rfc1413.h 1998/03/31 12:52:29 1.9 +++ rfc1413.h 1998/04/11 12:00:23 1.10 @@ -58,6 +58,6 @@ #ifndef APACHE_RFC1413_H #define APACHE_RFC1413_H -extern char *rfc1413(conn_rec *conn, server_rec *srv); +extern char *ap_rfc1413(conn_rec *conn, server_rec *srv); #endif /* !APACHE_RFC1413_H */ 1.39 +3 -3 apache-1.3/src/include/scoreboard.h Index: scoreboard.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/scoreboard.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- scoreboard.h 1998/03/31 12:52:30 1.38 +++ scoreboard.h 1998/04/11 12:00:23 1.39 @@ -153,10 +153,10 @@ #define SCOREBOARD_SIZE sizeof(scoreboard) -API_EXPORT(void) sync_scoreboard_image(void); -API_EXPORT(int) exists_scoreboard_image(void); +API_EXPORT(void) ap_sync_scoreboard_image(void); +API_EXPORT(int) ap_exists_scoreboard_image(void); -API_VAR_EXPORT extern scoreboard *scoreboard_image; +API_VAR_EXPORT extern scoreboard *ap_scoreboard_image; /* for time_process_request() in http_main.c */ #define START_PREQUEST 1 1.12 +3 -3 apache-1.3/src/include/util_date.h Index: util_date.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/util_date.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- util_date.h 1998/03/31 12:52:30 1.11 +++ util_date.h 1998/04/11 12:00:23 1.12 @@ -70,8 +70,8 @@ #define BAD_DATE (time_t)0 -API_EXPORT(int) checkmask(const char *data, const char *mask); -API_EXPORT(time_t) tm2sec(const struct tm *t); -API_EXPORT(time_t) parseHTTPdate(const char *date); +API_EXPORT(int) ap_checkmask(const char *data, const char *mask); +API_EXPORT(time_t) ap_tm2sec(const struct tm *t); +API_EXPORT(time_t) ap_parseHTTPdate(const char *date); #endif /* !APACHE_UTIL_DATE_H */ 1.30 +9 -9 apache-1.3/src/include/util_script.h Index: util_script.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/util_script.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- util_script.h 1998/03/31 12:52:32 1.29 +++ util_script.h 1998/04/11 12:00:23 1.30 @@ -66,16 +66,16 @@ #endif #endif -API_EXPORT(char **) create_environment(pool *p, table *t); -API_EXPORT(int) find_path_info(const char *uri, const char *path_info); -API_EXPORT(void) add_cgi_vars(request_rec *r); -API_EXPORT(void) add_common_vars(request_rec *r); -#define scan_script_header(a1,a2) scan_script_header_err(a1,a2,NULL) -API_EXPORT(int) scan_script_header_err(request_rec *r, FILE *f, char *buffer); -API_EXPORT(int) scan_script_header_err_buff(request_rec *r, BUFF *f, +API_EXPORT(char **) ap_create_environment(pool *p, table *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); +#define scan_script_header(a1,a2) ap_scan_script_header_err(a1,a2,NULL) +API_EXPORT(int) ap_scan_script_header_err(request_rec *r, FILE *f, char *buffer); +API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *f, char *buffer); -API_EXPORT(void) send_size(size_t size, request_rec *r); -API_EXPORT(int) call_exec(request_rec *r, char *argv0, char **env, +API_EXPORT(void) ap_send_size(size_t size, request_rec *r); +API_EXPORT(int) ap_call_exec(request_rec *r, char *argv0, char **env, int shellcmd); #endif /* !APACHE_UTIL_SCRIPT_H */ 1.7 +8 -8 apache-1.3/src/include/util_uri.h Index: util_uri.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/util_uri.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- util_uri.h 1998/04/01 14:41:32 1.6 +++ util_uri.h 1998/04/11 12:00:24 1.7 @@ -105,15 +105,15 @@ } uri_components; /* util_uri.c */ -API_EXPORT(unsigned short) default_port_for_scheme(const char *scheme_str); -API_EXPORT(unsigned short) default_port_for_request(const request_rec *r); -API_EXPORT(struct hostent *) pduphostent(pool *p, struct hostent *hp); -API_EXPORT(struct hostent *) pgethostbyname(pool *p, const char *hostname); -API_EXPORT(char *) unparse_uri_components(pool *p, const uri_components *uptr, +API_EXPORT(unsigned short) ap_default_port_for_scheme(const char *scheme_str); +API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec *r); +API_EXPORT(struct hostent *) ap_pduphostent(pool *p, struct hostent *hp); +API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname); +API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr, unsigned flags); -API_EXPORT(int) parse_uri_components(pool *p, const char *uri, uri_components *uptr); -API_EXPORT(int) parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr); +API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr); +API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr); /* called by the core in main() */ -extern void util_uri_init(void); +extern void ap_util_uri_init(void); #endif /*UTIL_URI_H*/ 1.87 +207 -207 apache-1.3/src/main/alloc.c Index: alloc.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/alloc.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- alloc.c 1998/04/06 07:26:27 1.86 +++ alloc.c 1998/04/11 12:00:28 1.87 @@ -261,7 +261,7 @@ if (blok == NULL) return; /* Sanity check --- freeing empty pool? */ - (void) acquire_mutex(alloc_mutex); + (void) ap_acquire_mutex(alloc_mutex); old_free_list = block_freelist; block_freelist = blok; @@ -291,7 +291,7 @@ /* Finally, reset next pointer to get the old free blocks back */ blok->h.next = old_free_list; - (void) release_mutex(alloc_mutex); + (void) ap_release_mutex(alloc_mutex); #endif } @@ -392,14 +392,14 @@ #define POOL_HDR_CLICKS (1 + ((sizeof(struct pool) - 1) / CLICK_SZ)) #define POOL_HDR_BYTES (POOL_HDR_CLICKS * CLICK_SZ) -API_EXPORT(struct pool *) make_sub_pool(struct pool *p) +API_EXPORT(struct pool *) ap_make_sub_pool(struct pool *p) { union block_hdr *blok; pool *new_pool; - block_alarms(); + ap_block_alarms(); - (void) acquire_mutex(alloc_mutex); + (void) ap_acquire_mutex(alloc_mutex); blok = new_block(POOL_HDR_BYTES); new_pool = (pool *) blok->h.first_avail; @@ -420,8 +420,8 @@ p->sub_pools = new_pool; } - (void) release_mutex(alloc_mutex); - unblock_alarms(); + (void) ap_release_mutex(alloc_mutex); + ap_unblock_alarms(); return new_pool; } @@ -440,7 +440,7 @@ } #endif -pool *init_alloc(void) +pool *ap_init_alloc(void) { #ifdef POOL_DEBUG char s; @@ -448,21 +448,21 @@ known_stack_point = &s; stack_var_init(&s); #endif - alloc_mutex = create_mutex(NULL); - spawn_mutex = create_mutex(NULL); - permanent_pool = make_sub_pool(NULL); + alloc_mutex = ap_create_mutex(NULL); + spawn_mutex = ap_create_mutex(NULL); + permanent_pool = ap_make_sub_pool(NULL); return permanent_pool; } -API_EXPORT(void) clear_pool(struct pool *a) +API_EXPORT(void) ap_clear_pool(struct pool *a) { - block_alarms(); + ap_block_alarms(); - (void) acquire_mutex(alloc_mutex); + (void) ap_acquire_mutex(alloc_mutex); while (a->sub_pools) - destroy_pool(a->sub_pools); - (void) release_mutex(alloc_mutex); + ap_destroy_pool(a->sub_pools); + (void) ap_release_mutex(alloc_mutex); /* Don't hold the mutex during cleanups. */ run_cleanups(a->cleanups); a->cleanups = NULL; @@ -488,15 +488,15 @@ } #endif - unblock_alarms(); + ap_unblock_alarms(); } -API_EXPORT(void) destroy_pool(pool *a) +API_EXPORT(void) ap_destroy_pool(pool *a) { - block_alarms(); - clear_pool(a); + ap_block_alarms(); + ap_clear_pool(a); - (void) acquire_mutex(alloc_mutex); + (void) ap_acquire_mutex(alloc_mutex); if (a->parent) { if (a->parent->sub_pools == a) a->parent->sub_pools = a->sub_next; @@ -505,17 +505,17 @@ if (a->sub_next) a->sub_next->sub_prev = a->sub_prev; } - (void) release_mutex(alloc_mutex); + (void) ap_release_mutex(alloc_mutex); free_blocks(a->first); - unblock_alarms(); + ap_unblock_alarms(); } -API_EXPORT(long) bytes_in_pool(pool *p) +API_EXPORT(long) ap_bytes_in_pool(pool *p) { return bytes_in_block_list(p->first); } -API_EXPORT(long) bytes_in_free_blocks(void) +API_EXPORT(long) ap_bytes_in_free_blocks(void) { return bytes_in_block_list(block_freelist); } @@ -539,7 +539,7 @@ /* Find the pool that ts belongs to, return NULL if it doesn't * belong to any pool. */ -API_EXPORT(pool *) find_pool(const void *ts) +API_EXPORT(pool *) ap_find_pool(const void *ts) { const char *s = ts; union block_hdr **pb; @@ -557,7 +557,7 @@ abort(); return NULL; } - block_alarms(); + ap_block_alarms(); /* search the global_block_list */ for (pb = &global_block_list; *pb; pb = &b->h.global_next) { b = *pb; @@ -575,18 +575,18 @@ b->h.global_next = global_block_list; global_block_list = b; } - unblock_alarms(); + ap_unblock_alarms(); return b->h.owning_pool; } } - unblock_alarms(); + ap_unblock_alarms(); return NULL; } /* return TRUE iff a is an ancestor of b * NULL is considered an ancestor of all pools */ -API_EXPORT(int) pool_is_ancestor(pool *a, pool *b) +API_EXPORT(int) ap_pool_is_ancestor(pool *a, pool *b) { if (a == NULL) { return 1; @@ -607,7 +607,7 @@ * instead. This is a guarantee by the caller that sub will not * be destroyed before p is. */ -API_EXPORT(void) pool_join(pool *p, pool *sub) +API_EXPORT(void) ap_pool_join(pool *p, pool *sub) { union block_hdr *b; @@ -616,7 +616,7 @@ fprintf(stderr, "pool_join: p is not parent of sub\n"); abort(); } - block_alarms(); + ap_block_alarms(); while (p->joined) { p = p->joined; } @@ -626,7 +626,7 @@ b->h.owning_pool = p; } } - unblock_alarms(); + ap_unblock_alarms(); } #endif @@ -636,13 +636,13 @@ */ -API_EXPORT(void *) palloc(struct pool *a, int reqsize) +API_EXPORT(void *) ap_palloc(struct pool *a, int reqsize) { #ifdef ALLOC_USE_MALLOC int size = reqsize + CLICK_SZ; void *ptr; - block_alarms(); + ap_block_alarms(); ptr = malloc(size); if (ptr == NULL) { fputs("Ouch! Out of memory!\n", stderr); @@ -651,7 +651,7 @@ debug_fill(ptr, size); /* might as well get uninitialized protection */ *(void **)ptr = a->allocation_list; a->allocation_list = ptr; - unblock_alarms(); + ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else @@ -683,9 +683,9 @@ /* Nope --- get a new one that's guaranteed to be big enough */ - block_alarms(); + ap_block_alarms(); - (void) acquire_mutex(alloc_mutex); + (void) ap_acquire_mutex(alloc_mutex); blok = new_block(size); a->last->h.next = blok; @@ -694,9 +694,9 @@ blok->h.owning_pool = a; #endif - (void) release_mutex(alloc_mutex); + (void) ap_release_mutex(alloc_mutex); - unblock_alarms(); + ap_unblock_alarms(); first_avail = blok->h.first_avail; blok->h.first_avail += size; @@ -705,14 +705,14 @@ #endif } -API_EXPORT(void *) pcalloc(struct pool *a, int size) +API_EXPORT(void *) ap_pcalloc(struct pool *a, int size) { - void *res = palloc(a, size); + void *res = ap_palloc(a, size); memset(res, '\0', size); return res; } -API_EXPORT(char *) pstrdup(struct pool *a, const char *s) +API_EXPORT(char *) ap_pstrdup(struct pool *a, const char *s) { char *res; size_t len; @@ -720,24 +720,24 @@ if (s == NULL) return NULL; len = strlen(s) + 1; - res = palloc(a, len); + res = ap_palloc(a, len); memcpy(res, s, len); return res; } -API_EXPORT(char *) pstrndup(struct pool *a, const char *s, int n) +API_EXPORT(char *) ap_pstrndup(struct pool *a, const char *s, int n) { char *res; if (s == NULL) return NULL; - res = palloc(a, n + 1); + res = ap_palloc(a, n + 1); memcpy(res, s, n); res[n] = '\0'; return res; } -API_EXPORT_NONSTD(char *) pstrcat(pool *a,...) +API_EXPORT_NONSTD(char *) ap_pstrcat(pool *a,...) { char *cp, *argp, *res; @@ -755,7 +755,7 @@ /* Allocate the required string */ - res = (char *) palloc(a, len + 1); + res = (char *) ap_palloc(a, len + 1); cp = res; *cp = '\0'; @@ -820,11 +820,11 @@ cur_len = strp - blok->h.first_avail; /* must try another blok */ - block_alarms(); - (void) acquire_mutex(alloc_mutex); + ap_block_alarms(); + (void) ap_acquire_mutex(alloc_mutex); nblok = new_block(2 * cur_len); - (void) release_mutex(alloc_mutex); - unblock_alarms(); + (void) ap_release_mutex(alloc_mutex); + ap_unblock_alarms(); memcpy(nblok->h.first_avail, strp, cur_len); strp = nblok->h.first_avail + cur_len; ps->vbuff.curpos = strp; @@ -833,12 +833,12 @@ /* did we allocate the current blok? if so free it up */ if (ps->got_a_new_block) { debug_fill(blok->h.first_avail, blok->h.endp - blok->h.first_avail); - block_alarms(); - (void) acquire_mutex(alloc_mutex); + ap_block_alarms(); + (void) ap_acquire_mutex(alloc_mutex); blok->h.next = block_freelist; block_freelist = blok; - (void) release_mutex(alloc_mutex); - unblock_alarms(); + (void) ap_release_mutex(alloc_mutex); + ap_unblock_alarms(); } ps->blok = nblok; ps->got_a_new_block = 1; @@ -846,13 +846,13 @@ #endif } -API_EXPORT(char *) pvsprintf(pool *p, const char *fmt, va_list ap) +API_EXPORT(char *) ap_pvsprintf(pool *p, const char *fmt, va_list ap) { #ifdef ALLOC_USE_MALLOC struct psprintf_data ps; void *ptr; - block_alarms(); + ap_block_alarms(); ps.base = malloc(512); if (ps.base == NULL) { fputs("Ouch! Out of memory!\n", stderr); @@ -872,7 +872,7 @@ } *(void **)ptr = p->allocation_list; p->allocation_list = ptr; - unblock_alarms(); + ap_unblock_alarms(); return (char *)ptr + CLICK_SZ; #else struct psprintf_data ps; @@ -907,13 +907,13 @@ #endif } -API_EXPORT_NONSTD(char *) psprintf(pool *p, const char *fmt, ...) +API_EXPORT_NONSTD(char *) ap_psprintf(pool *p, const char *fmt, ...) { va_list ap; char *res; va_start(ap, fmt); - res = pvsprintf(p, fmt, ap); + res = ap_pvsprintf(p, fmt, ap); va_end(ap); return res; } @@ -930,7 +930,7 @@ * array of zero elts. */ - res->elts = pcalloc(p, nelts * elt_size); + res->elts = ap_pcalloc(p, nelts * elt_size); res->pool = p; res->elt_size = elt_size; @@ -938,21 +938,21 @@ res->nalloc = nelts; /* ...but this many allocated */ } -API_EXPORT(array_header *) make_array(pool *p, int nelts, int elt_size) +API_EXPORT(array_header *) ap_make_array(pool *p, int nelts, int elt_size) { - array_header *res = (array_header *) palloc(p, sizeof(array_header)); + array_header *res = (array_header *) ap_palloc(p, sizeof(array_header)); make_array_core(res, p, nelts, elt_size); return res; } -API_EXPORT(void *) push_array(array_header *arr) +API_EXPORT(void *) ap_push_array(array_header *arr) { if (arr->nelts == arr->nalloc) { int new_size = (arr->nalloc <= 0) ? 1 : arr->nalloc * 2; char *new_data; - new_data = pcalloc(arr->pool, arr->elt_size * new_size); + new_data = ap_pcalloc(arr->pool, arr->elt_size * new_size); memcpy(new_data, arr->elts, arr->nalloc * arr->elt_size); arr->elts = new_data; @@ -963,7 +963,7 @@ return arr->elts + (arr->elt_size * (arr->nelts - 1)); } -API_EXPORT(void) array_cat(array_header *dst, const array_header *src) +API_EXPORT(void) ap_array_cat(array_header *dst, const array_header *src) { int elt_size = dst->elt_size; @@ -974,7 +974,7 @@ while (dst->nelts + src->nelts > new_size) new_size *= 2; - new_data = pcalloc(dst->pool, elt_size * new_size); + new_data = ap_pcalloc(dst->pool, elt_size * new_size); memcpy(new_data, dst->elts, dst->nalloc * elt_size); dst->elts = new_data; @@ -985,9 +985,9 @@ dst->nelts += src->nelts; } -API_EXPORT(array_header *) copy_array(pool *p, const array_header *arr) +API_EXPORT(array_header *) ap_copy_array(pool *p, const array_header *arr) { - array_header *res = make_array(p, arr->nalloc, arr->elt_size); + array_header *res = ap_make_array(p, arr->nalloc, arr->elt_size); memcpy(res->elts, arr->elts, arr->elt_size * arr->nelts); res->nelts = arr->nelts; @@ -1010,9 +1010,9 @@ res->nalloc = arr->nelts; /* Force overflow on push */ } -API_EXPORT(array_header *) copy_array_hdr(pool *p, const array_header *arr) +API_EXPORT(array_header *) ap_copy_array_hdr(pool *p, const array_header *arr) { - array_header *res = (array_header *) palloc(p, sizeof(array_header)); + array_header *res = (array_header *) ap_palloc(p, sizeof(array_header)); res->pool = p; copy_array_hdr_core(res, arr); @@ -1021,13 +1021,13 @@ /* The above is used here to avoid consing multiple new array bodies... */ -API_EXPORT(array_header *) append_arrays(pool *p, +API_EXPORT(array_header *) ap_append_arrays(pool *p, const array_header *first, const array_header *second) { - array_header *res = copy_array_hdr(p, first); + array_header *res = ap_copy_array_hdr(p, first); - array_cat(res, second); + ap_array_cat(res, second); return res; } @@ -1059,16 +1059,16 @@ "table_push: table created by %p hit limit of %u\n", t->creator, t->a.nalloc); } - return (table_entry *) push_array(&t->a); + return (table_entry *) ap_push_array(&t->a); } #else -#define table_push(t) ((table_entry *) push_array(&(t)->a)) +#define table_push(t) ((table_entry *) ap_push_array(&(t)->a)) #endif -API_EXPORT(table *) make_table(pool *p, int nelts) +API_EXPORT(table *) ap_make_table(pool *p, int nelts) { - table *t = palloc(p, sizeof(table)); + table *t = ap_palloc(p, sizeof(table)); make_array_core(&t->a, p, nelts, sizeof(table_entry)); #ifdef MAKE_TABLE_PROFILE @@ -1077,15 +1077,15 @@ return t; } -API_EXPORT(table *) copy_table(pool *p, const table *t) +API_EXPORT(table *) ap_copy_table(pool *p, const table *t) { - table *new = palloc(p, sizeof(table)); + table *new = ap_palloc(p, sizeof(table)); #ifdef POOL_DEBUG /* we don't copy keys and values, so it's necessary that t->a.pool * have a life span at least as long as p */ - if (!pool_is_ancestor(t->a.pool, p)) { + if (!ap_pool_is_ancestor(t->a.pool, p)) { fprintf(stderr, "copy_table: t's pool is not an ancestor of p\n"); abort(); } @@ -1096,12 +1096,12 @@ return new; } -API_EXPORT(void) clear_table(table *t) +API_EXPORT(void) ap_clear_table(table *t) { t->a.nelts = 0; } -API_EXPORT(char *) table_get(const table *t, const char *key) +API_EXPORT(char *) ap_table_get(const table *t, const char *key) { table_entry *elts = (table_entry *) t->a.elts; int i; @@ -1116,7 +1116,7 @@ return NULL; } -API_EXPORT(void) table_set(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_set(table *t, const char *key, const char *val) { register int i, j, k; table_entry *elts = (table_entry *) t->a.elts; @@ -1125,7 +1125,7 @@ for (i = 0; i < t->a.nelts; ) { if (!strcasecmp(elts[i].key, key)) { if (!done) { - elts[i].val = pstrdup(t->a.pool, val); + elts[i].val = ap_pstrdup(t->a.pool, val); done = 1; ++i; } @@ -1144,12 +1144,12 @@ if (!done) { elts = (table_entry *) table_push(t); - elts->key = pstrdup(t->a.pool, key); - elts->val = pstrdup(t->a.pool, val); + elts->key = ap_pstrdup(t->a.pool, key); + elts->val = ap_pstrdup(t->a.pool, val); } } -API_EXPORT(void) table_setn(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_setn(table *t, const char *key, const char *val) { register int i, j, k; table_entry *elts = (table_entry *) t->a.elts; @@ -1157,11 +1157,11 @@ #ifdef POOL_DEBUG { - if (!pool_is_ancestor(find_pool(key), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!pool_is_ancestor(find_pool(val), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -1195,7 +1195,7 @@ } } -API_EXPORT(void) table_unset(table *t, const char *key) +API_EXPORT(void) ap_table_unset(table *t, const char *key) { register int i, j, k; table_entry *elts = (table_entry *) t->a.elts; @@ -1220,34 +1220,34 @@ } } -API_EXPORT(void) table_merge(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_merge(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; int i; for (i = 0; i < t->a.nelts; ++i) if (!strcasecmp(elts[i].key, key)) { - elts[i].val = pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); + elts[i].val = ap_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } elts = (table_entry *) table_push(t); - elts->key = pstrdup(t->a.pool, key); - elts->val = pstrdup(t->a.pool, val); + elts->key = ap_pstrdup(t->a.pool, key); + elts->val = ap_pstrdup(t->a.pool, val); } -API_EXPORT(void) table_mergen(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_mergen(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; int i; #ifdef POOL_DEBUG { - if (!pool_is_ancestor(find_pool(key), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!pool_is_ancestor(find_pool(val), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -1256,7 +1256,7 @@ for (i = 0; i < t->a.nelts; ++i) { if (!strcasecmp(elts[i].key, key)) { - elts[i].val = pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); + elts[i].val = ap_pstrcat(t->a.pool, elts[i].val, ", ", val, NULL); return; } } @@ -1266,26 +1266,26 @@ elts->val = (char *)val; } -API_EXPORT(void) table_add(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_add(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; elts = (table_entry *) table_push(t); - elts->key = pstrdup(t->a.pool, key); - elts->val = pstrdup(t->a.pool, val); + elts->key = ap_pstrdup(t->a.pool, key); + elts->val = ap_pstrdup(t->a.pool, val); } -API_EXPORT(void) table_addn(table *t, const char *key, const char *val) +API_EXPORT(void) ap_table_addn(table *t, const char *key, const char *val) { table_entry *elts = (table_entry *) t->a.elts; #ifdef POOL_DEBUG { - if (!pool_is_ancestor(find_pool(key), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(key), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } - if (!pool_is_ancestor(find_pool(val), t->a.pool)) { + if (!ap_pool_is_ancestor(ap_find_pool(val), t->a.pool)) { fprintf(stderr, "table_set: key not in ancestor pool of t\n"); abort(); } @@ -1297,7 +1297,7 @@ elts->val = (char *)val; } -API_EXPORT(table *) overlay_tables(pool *p, const table *overlay, const table *base) +API_EXPORT(table *) ap_overlay_tables(pool *p, const table *overlay, const table *base) { table *res; @@ -1306,21 +1306,21 @@ * overlay->a.pool and base->a.pool have a life span at least * as long as p */ - if (!pool_is_ancestor(overlay->a.pool, p)) { + if (!ap_pool_is_ancestor(overlay->a.pool, p)) { fprintf(stderr, "overlay_tables: overlay's pool is not an ancestor of p\n"); abort(); } - if (!pool_is_ancestor(base->a.pool, p)) { + if (!ap_pool_is_ancestor(base->a.pool, p)) { fprintf(stderr, "overlay_tables: base's pool is not an ancestor of p\n"); abort(); } #endif - res = palloc(p, sizeof(table)); + res = ap_palloc(p, sizeof(table)); /* behave like append_arrays */ res->a.pool = p; copy_array_hdr_core(&res->a, &overlay->a); - array_cat(&res->a, &base->a); + ap_array_cat(&res->a, &base->a); return res; } @@ -1347,7 +1347,7 @@ * Note that rec is simply passed-on to the comp function, so that the * caller can pass additional info for the task. */ -API_EXPORT(void) table_do(int (*comp) (void *, const char *, const char *), void *rec, +API_EXPORT(void) ap_table_do(int (*comp) (void *, const char *, const char *), void *rec, const table *t,...) { va_list vp; @@ -1382,10 +1382,10 @@ struct cleanup *next; }; -API_EXPORT(void) register_cleanup(pool *p, void *data, void (*plain_cleanup) (void *), +API_EXPORT(void) ap_register_cleanup(pool *p, void *data, void (*plain_cleanup) (void *), void (*child_cleanup) (void *)) { - struct cleanup *c = (struct cleanup *) palloc(p, sizeof(struct cleanup)); + struct cleanup *c = (struct cleanup *) ap_palloc(p, sizeof(struct cleanup)); c->data = data; c->plain_cleanup = plain_cleanup; c->child_cleanup = child_cleanup; @@ -1393,7 +1393,7 @@ p->cleanups = c; } -API_EXPORT(void) kill_cleanup(pool *p, void *data, void (*cleanup) (void *)) +API_EXPORT(void) ap_kill_cleanup(pool *p, void *data, void (*cleanup) (void *)) { struct cleanup *c = p->cleanups; struct cleanup **lastp = &p->cleanups; @@ -1409,12 +1409,12 @@ } } -API_EXPORT(void) run_cleanup(pool *p, void *data, void (*cleanup) (void *)) +API_EXPORT(void) ap_run_cleanup(pool *p, void *data, void (*cleanup) (void *)) { - block_alarms(); /* Run cleanup only once! */ + ap_block_alarms(); /* Run cleanup only once! */ (*cleanup) (data); - kill_cleanup(p, data, cleanup); - unblock_alarms(); + ap_kill_cleanup(p, data, cleanup); + ap_unblock_alarms(); } static void run_cleanups(struct cleanup *c) @@ -1442,7 +1442,7 @@ cleanup_pool_for_exec(p); } -API_EXPORT(void) cleanup_for_exec(void) +API_EXPORT(void) ap_cleanup_for_exec(void) { #ifndef WIN32 /* @@ -1454,13 +1454,13 @@ * I can do about that (except if the child decides * to go out and close them */ - block_alarms(); + ap_block_alarms(); cleanup_pool_for_exec(permanent_pool); - unblock_alarms(); + ap_unblock_alarms(); #endif /* ndef WIN32 */ } -API_EXPORT_NONSTD(void) null_cleanup(void *data) +API_EXPORT_NONSTD(void) ap_null_cleanup(void *data) { /* do nothing cleanup routine */ } @@ -1476,43 +1476,43 @@ close((int) (long) fdv); } -API_EXPORT(void) note_cleanups_for_fd(pool *p, int fd) +API_EXPORT(void) ap_note_cleanups_for_fd(pool *p, int fd) { - register_cleanup(p, (void *) (long) fd, fd_cleanup, fd_cleanup); + ap_register_cleanup(p, (void *) (long) fd, fd_cleanup, fd_cleanup); } -API_EXPORT(void) kill_cleanups_for_fd(pool *p, int fd) +API_EXPORT(void) ap_kill_cleanups_for_fd(pool *p, int fd) { - kill_cleanup(p, (void *) (long) fd, fd_cleanup); + ap_kill_cleanup(p, (void *) (long) fd, fd_cleanup); } -API_EXPORT(int) popenf(pool *a, const char *name, int flg, int mode) +API_EXPORT(int) ap_popenf(pool *a, const char *name, int flg, int mode) { int fd; int save_errno; - block_alarms(); + ap_block_alarms(); fd = open(name, flg, mode); save_errno = errno; if (fd >= 0) { fd = ap_slack(fd, AP_SLACK_HIGH); - note_cleanups_for_fd(a, fd); + ap_note_cleanups_for_fd(a, fd); } - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return fd; } -API_EXPORT(int) pclosef(pool *a, int fd) +API_EXPORT(int) ap_pclosef(pool *a, int fd) { int res; int save_errno; - block_alarms(); + ap_block_alarms(); res = close(fd); save_errno = errno; - kill_cleanup(a, (void *) (long) fd, fd_cleanup); - unblock_alarms(); + ap_kill_cleanup(a, (void *) (long) fd, fd_cleanup); + ap_unblock_alarms(); errno = save_errno; return res; } @@ -1531,12 +1531,12 @@ close(fileno((FILE *) fpv)); } -API_EXPORT(void) note_cleanups_for_file(pool *p, FILE *fp) +API_EXPORT(void) ap_note_cleanups_for_file(pool *p, FILE *fp) { - register_cleanup(p, (void *) fp, file_cleanup, file_child_cleanup); + ap_register_cleanup(p, (void *) fp, file_cleanup, file_child_cleanup); } -API_EXPORT(FILE *) pfopen(pool *a, const char *name, const char *mode) +API_EXPORT(FILE *) ap_pfopen(pool *a, const char *name, const char *mode) { FILE *fd = NULL; int baseFlag, desc; @@ -1548,7 +1548,7 @@ modeFlags = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; #endif - block_alarms(); + ap_block_alarms(); if (*mode == 'a') { /* Work around faulty implementations of fopen */ @@ -1565,32 +1565,32 @@ } if (fd != NULL) - note_cleanups_for_file(a, fd); - unblock_alarms(); + ap_note_cleanups_for_file(a, fd); + ap_unblock_alarms(); return fd; } -API_EXPORT(FILE *) pfdopen(pool *a, int fd, const char *mode) +API_EXPORT(FILE *) ap_pfdopen(pool *a, int fd, const char *mode) { FILE *f; - block_alarms(); + ap_block_alarms(); f = fdopen(fd, mode); if (f != NULL) - note_cleanups_for_file(a, f); - unblock_alarms(); + ap_note_cleanups_for_file(a, f); + ap_unblock_alarms(); return f; } -API_EXPORT(int) pfclose(pool *a, FILE *fd) +API_EXPORT(int) ap_pfclose(pool *a, FILE *fd) { int res; - block_alarms(); + ap_block_alarms(); res = fclose(fd); - kill_cleanup(a, (void *) fd, file_cleanup); - unblock_alarms(); + ap_kill_cleanup(a, (void *) fd, file_cleanup); + ap_unblock_alarms(); return res; } @@ -1603,30 +1603,30 @@ closedir((DIR *) dv); } -API_EXPORT(DIR *) popendir(pool *p, const char *name) +API_EXPORT(DIR *) ap_popendir(pool *p, const char *name) { DIR *d; int save_errno; - block_alarms(); + ap_block_alarms(); d = opendir(name); if (d == NULL) { save_errno = errno; - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return NULL; } - register_cleanup(p, (void *) d, dir_cleanup, dir_cleanup); - unblock_alarms(); + ap_register_cleanup(p, (void *) d, dir_cleanup, dir_cleanup); + ap_unblock_alarms(); return d; } -API_EXPORT(void) pclosedir(pool *p, DIR * d) +API_EXPORT(void) ap_pclosedir(pool *p, DIR * d) { - block_alarms(); - kill_cleanup(p, (void *) d, dir_cleanup); + ap_block_alarms(); + ap_kill_cleanup(p, (void *) d, dir_cleanup); closedir(d); - unblock_alarms(); + ap_unblock_alarms(); } /***************************************************************** @@ -1640,46 +1640,46 @@ closesocket((int) (long) fdv); } -API_EXPORT(void) note_cleanups_for_socket(pool *p, int fd) +API_EXPORT(void) ap_note_cleanups_for_socket(pool *p, int fd) { - register_cleanup(p, (void *) (long) fd, socket_cleanup, socket_cleanup); + ap_register_cleanup(p, (void *) (long) fd, socket_cleanup, socket_cleanup); } -API_EXPORT(void) kill_cleanups_for_socket(pool *p, int sock) +API_EXPORT(void) ap_kill_cleanups_for_socket(pool *p, int sock) { - kill_cleanup(p, (void *) (long) sock, socket_cleanup); + ap_kill_cleanup(p, (void *) (long) sock, socket_cleanup); } -API_EXPORT(int) psocket(pool *p, int domain, int type, int protocol) +API_EXPORT(int) ap_psocket(pool *p, int domain, int type, int protocol) { int fd; - block_alarms(); + ap_block_alarms(); fd = socket(domain, type, protocol); if (fd == -1) { int save_errno = errno; - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return -1; } - note_cleanups_for_socket(p, fd); - unblock_alarms(); + ap_note_cleanups_for_socket(p, fd); + ap_unblock_alarms(); return fd; } -API_EXPORT(int) pclosesocket(pool *a, int sock) +API_EXPORT(int) ap_pclosesocket(pool *a, int sock) { int res; int save_errno; - block_alarms(); + ap_block_alarms(); res = closesocket(sock); #ifdef WIN32 errno = WSAGetLastError(); #endif /* WIN32 */ save_errno = errno; - kill_cleanup(a, (void *) (long) sock, socket_cleanup); - unblock_alarms(); + ap_kill_cleanup(a, (void *) (long) sock, socket_cleanup); + ap_unblock_alarms(); errno = save_errno; return res; } @@ -1698,25 +1698,25 @@ regfree((regex_t *) preg); } -API_EXPORT(regex_t *) pregcomp(pool *p, const char *pattern, int cflags) +API_EXPORT(regex_t *) ap_pregcomp(pool *p, const char *pattern, int cflags) { - regex_t *preg = palloc(p, sizeof(regex_t)); + regex_t *preg = ap_palloc(p, sizeof(regex_t)); if (regcomp(preg, pattern, cflags)) return NULL; - register_cleanup(p, (void *) preg, regex_cleanup, regex_cleanup); + ap_register_cleanup(p, (void *) preg, regex_cleanup, regex_cleanup); return preg; } -API_EXPORT(void) pregfree(pool *p, regex_t * reg) +API_EXPORT(void) ap_pregfree(pool *p, regex_t * reg) { - block_alarms(); + ap_block_alarms(); regfree(reg); - kill_cleanup(p, (void *) reg, regex_cleanup); - unblock_alarms(); + ap_kill_cleanup(p, (void *) reg, regex_cleanup); + ap_unblock_alarms(); } /***************************************************************** @@ -1736,10 +1736,10 @@ struct process_chain *next; }; -API_EXPORT(void) note_subprocess(pool *a, int pid, enum kill_conditions how) +API_EXPORT(void) ap_note_subprocess(pool *a, int pid, enum kill_conditions how) { struct process_chain *new = - (struct process_chain *) palloc(a, sizeof(struct process_chain)); + (struct process_chain *) ap_palloc(a, sizeof(struct process_chain)); new->pid = pid; new->kill_how = how; @@ -1805,7 +1805,7 @@ int hStdIn, hStdOut, hStdErr; int old_priority; - (void) acquire_mutex(spawn_mutex); + (void) ap_acquire_mutex(spawn_mutex); thread_handle = GetCurrentThread(); /* doesn't need to be closed */ old_priority = GetThreadPriority(thread_handle); SetThreadPriority(thread_handle, THREAD_PRIORITY_HIGHEST); @@ -1813,20 +1813,20 @@ if (pipe_in) { hStdIn = dup(fileno(stdin)); if(dup2(in_fds[0], fileno(stdin))) - aplog_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdin) failed"); + ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdin) failed"); close(in_fds[0]); } if (pipe_out) { hStdOut = dup(fileno(stdout)); close(fileno(stdout)); if(dup2(out_fds[1], fileno(stdout))) - aplog_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdout) failed"); + ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdout) failed"); close(out_fds[1]); } if (pipe_err) { hStdErr = dup(fileno(stderr)); if(dup2(err_fds[1], fileno(stderr))) - aplog_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdin) failed"); + ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "dup2(stdin) failed"); close(err_fds[1]); } @@ -1855,7 +1855,7 @@ } if (pid) { - note_subprocess(p, pid, kill_how); + ap_note_subprocess(p, pid, kill_how); if (pipe_in) { *pipe_in = in_fds[1]; } @@ -1867,7 +1867,7 @@ } } SetThreadPriority(thread_handle, old_priority); - (void) release_mutex(spawn_mutex); + (void) ap_release_mutex(spawn_mutex); /* * go on to the end of the function, where you can * unblock alarms and return the pid @@ -1925,7 +1925,7 @@ /* Parent process */ - note_subprocess(p, pid, kill_how); + ap_note_subprocess(p, pid, kill_how); if (pipe_out) { close(out_fds[1]); @@ -1947,14 +1947,14 @@ } -API_EXPORT(int) spawn_child_err(pool *p, int (*func) (void *), void *data, +API_EXPORT(int) ap_spawn_child_err(pool *p, int (*func) (void *), void *data, enum kill_conditions kill_how, FILE **pipe_in, FILE **pipe_out, FILE **pipe_err) { int fd_in, fd_out, fd_err; int pid, save_errno; - block_alarms(); + ap_block_alarms(); pid = spawn_child_err_core(p, func, data, kill_how, pipe_in ? &fd_in : NULL, @@ -1963,7 +1963,7 @@ if (pid == 0) { save_errno = errno; - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return 0; } @@ -1971,7 +1971,7 @@ if (pipe_out) { *pipe_out = fdopen(fd_out, "r" BINMODE); if (*pipe_out) - note_cleanups_for_file(p, *pipe_out); + ap_note_cleanups_for_file(p, *pipe_out); else close(fd_out); } @@ -1979,7 +1979,7 @@ if (pipe_in) { *pipe_in = fdopen(fd_in, "w" BINMODE); if (*pipe_in) - note_cleanups_for_file(p, *pipe_in); + ap_note_cleanups_for_file(p, *pipe_in); else close(fd_in); } @@ -1987,24 +1987,24 @@ if (pipe_err) { *pipe_err = fdopen(fd_err, "r" BINMODE); if (*pipe_err) - note_cleanups_for_file(p, *pipe_err); + ap_note_cleanups_for_file(p, *pipe_err); else close(fd_err); } - unblock_alarms(); + ap_unblock_alarms(); return pid; } -API_EXPORT(int) spawn_child_err_buff(pool *p, int (*func) (void *), void *data, +API_EXPORT(int) ap_spawn_child_err_buff(pool *p, int (*func) (void *), void *data, enum kill_conditions kill_how, BUFF **pipe_in, BUFF **pipe_out, BUFF **pipe_err) { int fd_in, fd_out, fd_err; int pid, save_errno; - block_alarms(); + ap_block_alarms(); pid = spawn_child_err_core(p, func, data, kill_how, pipe_in ? &fd_in : NULL, @@ -2013,30 +2013,30 @@ if (pid == 0) { save_errno = errno; - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return 0; } if (pipe_out) { - *pipe_out = bcreate(p, B_RD); - note_cleanups_for_fd(p, fd_out); - bpushfd(*pipe_out, fd_out, fd_out); + *pipe_out = ap_bcreate(p, B_RD); + ap_note_cleanups_for_fd(p, fd_out); + ap_bpushfd(*pipe_out, fd_out, fd_out); } if (pipe_in) { - *pipe_in = bcreate(p, B_WR); - note_cleanups_for_fd(p, fd_in); - bpushfd(*pipe_in, fd_in, fd_in); + *pipe_in = ap_bcreate(p, B_WR); + ap_note_cleanups_for_fd(p, fd_in); + ap_bpushfd(*pipe_in, fd_in, fd_in); } if (pipe_err) { - *pipe_err = bcreate(p, B_RD); - note_cleanups_for_fd(p, fd_err); - bpushfd(*pipe_err, fd_err, fd_err); + *pipe_err = ap_bcreate(p, B_RD); + ap_note_cleanups_for_fd(p, fd_err); + ap_bpushfd(*pipe_err, fd_err, fd_err); } - unblock_alarms(); + ap_unblock_alarms(); return pid; } 1.73 +43 -43 apache-1.3/src/main/buff.c Index: buff.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/buff.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- buff.c 1998/04/03 14:55:45 1.72 +++ buff.c 1998/04/11 12:00:28 1.73 @@ -134,7 +134,7 @@ int rv; int retry; - if (!(tv.tv_sec = check_alarm())) + if (!(tv.tv_sec = ap_check_alarm())) return (send(sock, buf, len, flags)); rv = ioctlsocket(sock, FIONBIO, &iostate); @@ -158,7 +158,7 @@ err = WSAGetLastError(); else if (rv == 0) { ioctlsocket(sock, FIONBIO, &iostate); - if(check_alarm() < 0) { + if(ap_check_alarm() < 0) { WSASetLastError(EINTR); /* Simulate an alarm() */ return (SOCKET_ERROR); } @@ -168,7 +168,7 @@ if (rv == SOCKET_ERROR) { err = WSAGetLastError(); if(err == WSAEWOULDBLOCK) { - aplog_error(APLOG_MARK,APLOG_WARNING,NULL, + ap_log_error(APLOG_MARK,APLOG_WARNING,NULL, "select claimed we could write, but in fact we couldn't. This is a bug in Windows."); retry=1; Sleep(100); @@ -192,7 +192,7 @@ int err = WSAEWOULDBLOCK; int rv; - if (!(tv.tv_sec = check_alarm())) + if (!(tv.tv_sec = ap_check_alarm())) return (recv(sock, buf, len, flags)); rv = ioctlsocket(sock, FIONBIO, &iostate); @@ -210,7 +210,7 @@ err = WSAGetLastError(); else if (rv == 0) { ioctlsocket(sock, FIONBIO, &iostate); - check_alarm(); + ap_check_alarm(); WSASetLastError(WSAEWOULDBLOCK); return (SOCKET_ERROR); } @@ -305,24 +305,24 @@ /* * Create a new buffered stream */ -API_EXPORT(BUFF *) bcreate(pool *p, int flags) +API_EXPORT(BUFF *) ap_bcreate(pool *p, int flags) { BUFF *fb; - fb = palloc(p, sizeof(BUFF)); + fb = ap_palloc(p, sizeof(BUFF)); fb->pool = p; fb->bufsiz = DEFAULT_BUFSIZE; fb->flags = flags & (B_RDWR | B_SOCKET); if (flags & B_RD) - fb->inbase = palloc(p, fb->bufsiz); + fb->inbase = ap_palloc(p, fb->bufsiz); else fb->inbase = NULL; /* overallocate so that we can put a chunk trailer of CRLF into this * buffer */ if (flags & B_WR) - fb->outbase = palloc(p, fb->bufsiz + 2); + fb->outbase = ap_palloc(p, fb->bufsiz + 2); else fb->outbase = NULL; @@ -356,13 +356,13 @@ /* * Push some I/O file descriptors onto the stream */ -API_EXPORT(void) bpushfd(BUFF *fb, int fd_in, int fd_out) +API_EXPORT(void) ap_bpushfd(BUFF *fb, int fd_in, int fd_out) { fb->fd = fd_out; fb->fd_in = fd_in; } -API_EXPORT(int) bsetopt(BUFF *fb, int optname, const void *optval) +API_EXPORT(int) ap_bsetopt(BUFF *fb, int optname, const void *optval) { if (optname == BO_BYTECT) { fb->bytes_sent = *(const long int *) optval - (long int) fb->outcnt;; @@ -374,7 +374,7 @@ } } -API_EXPORT(int) bgetopt(BUFF *fb, int optname, void *optval) +API_EXPORT(int) ap_bgetopt(BUFF *fb, int optname, void *optval) { if (optname == BO_BYTECT) { long int bs = fb->bytes_sent + fb->outcnt; @@ -477,7 +477,7 @@ /* * Set a flag on (1) or off (0). */ -API_EXPORT(int) bsetflag(BUFF *fb, int flag, int value) +API_EXPORT(int) ap_bsetflag(BUFF *fb, int flag, int value) { if (value) { fb->flags |= flag; @@ -495,7 +495,7 @@ } -API_EXPORT(int) bnonblock(BUFF *fb, int direction) +API_EXPORT(int) ap_bnonblock(BUFF *fb, int direction) { int fd; @@ -510,7 +510,7 @@ #endif } -API_EXPORT(int) bfileno(BUFF *fb, int direction) +API_EXPORT(int) ap_bfileno(BUFF *fb, int direction) { return (direction == B_RD) ? fb->fd_in : fb->fd; } @@ -534,7 +534,7 @@ /* note we assume the caller has ensured that fb->fd_in <= FD_SETSIZE */ -API_EXPORT(void) bhalfduplex(BUFF *fb) +API_EXPORT(void) ap_bhalfduplex(BUFF *fb) { int rv; fd_set fds; @@ -553,7 +553,7 @@ } while (rv < 0 && errno == EINTR); /* treat any error as if it would block as well */ if (rv != 1) { - bflush(fb); + ap_bflush(fb); } } @@ -562,7 +562,7 @@ int rv; if (fb->flags & B_SAFEREAD) { - bhalfduplex(fb); + ap_bhalfduplex(fb); } do { rv = buff_read(fb, buf, nbyte); @@ -593,7 +593,7 @@ { apache_sfio *disc; - if (!(disc = (apache_sfio *) palloc(p, sizeof(apache_sfio)))) + if (!(disc = (apache_sfio *) ap_palloc(p, sizeof(apache_sfio)))) return (Sfdisc_t *) disc; disc->disc.readf = (Sfread_f) bsfio_read; @@ -634,7 +634,7 @@ * Only when the caller retrieves data from the buffer (calls bread) * is a conversion done, if the conversion flag is set at that time. */ -API_EXPORT(int) bread(BUFF *fb, void *buf, int nbyte) +API_EXPORT(int) ap_bread(BUFF *fb, void *buf, int nbyte) { int i, nrd; @@ -747,7 +747,7 @@ * CR characters in the byte stream not immediately followed by a LF * will be preserved. */ -API_EXPORT(int) bgets(char *buff, int n, BUFF *fb) +API_EXPORT(int) ap_bgets(char *buff, int n, BUFF *fb) { int i, ch, ct; @@ -831,7 +831,7 @@ * Returns 1 on success, zero on end of transmission, or -1 on an error. * */ -API_EXPORT(int) blookc(char *buff, BUFF *fb) +API_EXPORT(int) ap_blookc(char *buff, BUFF *fb) { int i; @@ -870,7 +870,7 @@ * Skip data until a linefeed character is read * Returns 1 on success, 0 if no LF found, or -1 on error */ -API_EXPORT(int) bskiplf(BUFF *fb) +API_EXPORT(int) ap_bskiplf(BUFF *fb) { unsigned char *x; int i; @@ -906,23 +906,23 @@ /* * Empty the buffer after putting a single character in it */ -API_EXPORT(int) bflsbuf(int c, BUFF *fb) +API_EXPORT(int) ap_bflsbuf(int c, BUFF *fb) { char ss[1]; ss[0] = c; - return bwrite(fb, ss, 1); + return ap_bwrite(fb, ss, 1); } /* * Fill the buffer and read a character from it */ -API_EXPORT(int) bfilbuf(BUFF *fb) +API_EXPORT(int) ap_bfilbuf(BUFF *fb) { int i; char buf[1]; - i = bread(fb, buf, 1); + i = ap_bread(fb, buf, 1); if (i == 0) errno = 0; /* no error; EOF */ if (i != 1) @@ -1157,7 +1157,7 @@ * It is worth noting that if an error occurs, the buffer is in an unknown * state. */ -API_EXPORT(int) bwrite(BUFF *fb, const void *buf, int nbyte) +API_EXPORT(int) ap_bwrite(BUFF *fb, const void *buf, int nbyte) { int i, nwr, useable_bufsiz; #ifdef CHARSET_EBCDIC @@ -1328,7 +1328,7 @@ * Flushes the buffered stream. * Returns 0 on success or -1 on error */ -API_EXPORT(int) bflush(BUFF *fb) +API_EXPORT(int) ap_bflush(BUFF *fb) { int ret; @@ -1356,19 +1356,19 @@ * Sets the EOF flag to indicate no futher data can be read, * and the EOUT flag to indicate no further data can be written. */ -API_EXPORT(int) bclose(BUFF *fb) +API_EXPORT(int) ap_bclose(BUFF *fb) { int rc1, rc2, rc3; if (fb->flags & B_WR) - rc1 = bflush(fb); + rc1 = ap_bflush(fb); else rc1 = 0; #ifdef WIN32 if (fb->flags & B_SOCKET) { - rc2 = pclosesocket(fb->pool, fb->fd); + rc2 = ap_pclosesocket(fb->pool, fb->fd); if (fb->fd_in != fb->fd) { - rc3 = pclosesocket(fb->pool, fb->fd_in); + rc3 = ap_pclosesocket(fb->pool, fb->fd_in); } else { rc3 = 0; @@ -1376,9 +1376,9 @@ } else { #endif - rc2 = pclosef(fb->pool, fb->fd); + rc2 = ap_pclosef(fb->pool, fb->fd); if (fb->fd_in != fb->fd) { - rc3 = pclosef(fb->pool, fb->fd_in); + rc3 = ap_pclosef(fb->pool, fb->fd_in); } else { rc3 = 0; @@ -1411,10 +1411,10 @@ /* * returns the number of bytes written or -1 on error */ -API_EXPORT(int) bputs(const char *x, BUFF *fb) +API_EXPORT(int) ap_bputs(const char *x, BUFF *fb) { int i, j = strlen(x); - i = bwrite(fb, x, j); + i = ap_bwrite(fb, x, j); if (i != j) return -1; else @@ -1424,7 +1424,7 @@ /* * returns the number of bytes written or -1 on error */ -API_EXPORT_NONSTD(int) bvputs(BUFF *fb,...) +API_EXPORT_NONSTD(int) ap_bvputs(BUFF *fb,...) { int i, j, k; va_list v; @@ -1436,7 +1436,7 @@ if (x == NULL) break; j = strlen(x); - i = bwrite(fb, x, j); + i = ap_bwrite(fb, x, j); if (i != j) { va_end(v); return -1; @@ -1449,7 +1449,7 @@ return k; } -API_EXPORT(void) bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), +API_EXPORT(void) ap_bonerror(BUFF *fb, void (*error) (BUFF *, int, void *), void *data) { fb->error = error; @@ -1475,7 +1475,7 @@ #endif /*CHARSET_EBCDIC*/ fb->outcnt += b->vbuff.curpos - (char *)&fb->outbase[fb->outcnt]; if (fb->outcnt == fb->bufsiz) { - if (bflush(fb)) { + if (ap_bflush(fb)) { return -1; } } @@ -1484,7 +1484,7 @@ return 0; } -API_EXPORT_NONSTD(int) bprintf(BUFF *fb, const char *fmt, ...) +API_EXPORT_NONSTD(int) ap_bprintf(BUFF *fb, const char *fmt, ...) { va_list ap; int res; @@ -1509,7 +1509,7 @@ return res; } -API_EXPORT(int) vbprintf(BUFF *fb, const char *fmt, va_list ap) +API_EXPORT(int) ap_vbprintf(BUFF *fb, const char *fmt, va_list ap) { struct bprintf_data b; int res; 1.9 +3 -3 apache-1.3/src/main/fnmatch.c Index: fnmatch.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/fnmatch.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- fnmatch.c 1998/04/06 07:26:27 1.8 +++ fnmatch.c 1998/04/11 12:00:28 1.9 @@ -51,7 +51,7 @@ static const char *rangematch(const char *, int, int); -API_EXPORT(int) fnmatch(pattern, string, flags) +API_EXPORT(int) ap_fnmatch(pattern, string, flags) const char *pattern, *string; int flags; { @@ -102,7 +102,7 @@ /* General case, use recursion. */ while ((test = *string) != EOS) { - if (!fnmatch(pattern, string, flags & ~FNM_PERIOD)) + if (!ap_fnmatch(pattern, string, flags & ~FNM_PERIOD)) return (0); if (test == '/' && flags & FNM_PATHNAME) break; @@ -181,7 +181,7 @@ /* This function is an Apache addition */ /* return non-zero if pattern has any glob chars in it */ -API_EXPORT(int) is_fnmatch(const char *pattern) +API_EXPORT(int) ap_is_fnmatch(const char *pattern) { int nesting; 1.113 +172 -172 apache-1.3/src/main/http_config.c Index: http_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_config.c,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- http_config.c 1998/04/06 10:40:15 1.112 +++ http_config.c 1998/04/11 12:00:28 1.113 @@ -115,13 +115,13 @@ * overridden). */ -API_EXPORT(void *) get_module_config(void *conf_vector, module *m) +API_EXPORT(void *) ap_get_module_config(void *conf_vector, module *m) { void **confv = (void **) conf_vector; return confv[m->module_index]; } -API_EXPORT(void) set_module_config(void *conf_vector, module *m, void *val) +API_EXPORT(void) ap_set_module_config(void *conf_vector, module *m, void *val) { void **confv = (void **) conf_vector; confv[m->module_index] = val; @@ -129,14 +129,14 @@ static void *create_empty_config(pool *p) { - void **conf_vector = (void **) pcalloc(p, sizeof(void *) * + void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); return (void *) conf_vector; } static void *create_default_per_dir_config(pool *p) { - void **conf_vector = (void **) pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); + void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); module *modp; for (modp = top_module; modp; modp = modp->next) { @@ -150,9 +150,9 @@ } void * - merge_per_dir_configs(pool *p, void *base, void *new) + ap_merge_per_dir_configs(pool *p, void *base, void *new) { - void **conf_vector = (void **) palloc(p, sizeof(void *) * total_modules); + void **conf_vector = (void **) ap_palloc(p, sizeof(void *) * total_modules); void **base_vector = (void **) base; void **new_vector = (void **) new; module *modp; @@ -172,7 +172,7 @@ static void *create_server_config(pool *p, server_rec *s) { - void **conf_vector = (void **) pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); + void **conf_vector = (void **) ap_pcalloc(p, sizeof(void *) * (total_modules + DYNAMIC_MODULE_LIMIT)); module *modp; for (modp = top_module; modp; modp = modp->next) { @@ -204,12 +204,12 @@ } } -void *create_request_config(pool *p) +void *ap_create_request_config(pool *p) { return create_empty_config(p); } -CORE_EXPORT(void *) create_per_dir_config(pool *p) +CORE_EXPORT(void *) ap_create_per_dir_config(pool *p) { return create_empty_config(p); } @@ -224,7 +224,7 @@ { #define m(meth) { XtOffsetOf(module,meth),#meth } m(translate_handler), - m(check_user_id), + m(ap_check_user_id), m(auth_checker), m(type_checker), m(fixer_upper), @@ -264,7 +264,7 @@ static const int method_offsets[] = { XtOffsetOf(module, translate_handler), - XtOffsetOf(module, check_user_id), + XtOffsetOf(module, ap_check_user_id), XtOffsetOf(module, auth_checker), XtOffsetOf(module, access_checker), XtOffsetOf(module, type_checker), @@ -277,7 +277,7 @@ static struct { int translate_handler; - int check_user_id; + int ap_check_user_id; int auth_checker; int access_checker; int type_checker; @@ -359,37 +359,37 @@ return run_all ? OK : DECLINED; } -int translate_name(request_rec *r) +int ap_translate_name(request_rec *r) { return run_method(r, offsets_into_method_ptrs.translate_handler, 0); } -int check_access(request_rec *r) +int ap_check_access(request_rec *r) { return run_method(r, offsets_into_method_ptrs.access_checker, 1); } -int find_types(request_rec *r) +int ap_find_types(request_rec *r) { return run_method(r, offsets_into_method_ptrs.type_checker, 0); } -int run_fixups(request_rec *r) +int ap_run_fixups(request_rec *r) { return run_method(r, offsets_into_method_ptrs.fixer_upper, 1); } -int log_transaction(request_rec *r) +int ap_log_transaction(request_rec *r) { return run_method(r, offsets_into_method_ptrs.logger, 1); } -int header_parse(request_rec *r) +int ap_header_parse(request_rec *r) { return run_method(r, offsets_into_method_ptrs.header_parser, 1); } -int run_post_read_request(request_rec *r) +int ap_run_post_read_request(request_rec *r) { return run_method(r, offsets_into_method_ptrs.post_read_request, 1); } @@ -399,12 +399,12 @@ * separate from check_access to make catching some config errors easier. */ -int check_user_id(request_rec *r) +int ap_check_user_id(request_rec *r) { - return run_method(r, offsets_into_method_ptrs.check_user_id, 0); + return run_method(r, offsets_into_method_ptrs.ap_check_user_id, 0); } -int check_auth(request_rec *r) +int ap_check_auth(request_rec *r) { return run_method(r, offsets_into_method_ptrs.auth_checker, 0); } @@ -443,8 +443,8 @@ } } } - ph = handlers = palloc(p, sizeof(*ph)*(nhandlers + 1)); - pw = wildhandlers = palloc(p, sizeof(*pw)*(nwildhandlers + 1)); + ph = handlers = ap_palloc(p, sizeof(*ph)*(nhandlers + 1)); + pw = wildhandlers = ap_palloc(p, sizeof(*pw)*(nwildhandlers + 1)); for (modp = top_module; modp; modp = modp->next) { if (!modp->handlers) continue; @@ -468,7 +468,7 @@ ph->hr.handler = NULL; } -int invoke_handler(request_rec *r) +int ap_invoke_handler(request_rec *r) { fast_handler_rec *handp; char *handler, *p; @@ -479,7 +479,7 @@ handler_len = strlen(handler); } else { - handler = r->content_type ? r->content_type : default_type(r); + handler = r->content_type ? r->content_type : ap_default_type(r); if ((p = strchr(handler, ';')) != NULL) { /* MIME type arguments */ while (p > handler && p[-1] == ' ') --p; /* strip trailing spaces */ @@ -519,7 +519,7 @@ /* One-time setup for precompiled modules --- NOT to be done on restart */ -API_EXPORT(void) add_module(module *m) +API_EXPORT(void) ap_add_module(module *m) { /* This could be called from an AddModule httpd.conf command, * after the file has been linked and the module structure within it @@ -583,7 +583,7 @@ * all our current data. I.e. when doing a restart. */ -API_EXPORT(void) remove_module(module *m) +API_EXPORT(void) ap_remove_module(module *m) { module *modp; @@ -602,7 +602,7 @@ } if (!modp) { /* Uh-oh, this module doesn't exist */ - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, NULL, "Cannot remove module %s: not found in module list", m->name); return; @@ -617,27 +617,27 @@ } -void setup_prelinked_modules() +void ap_setup_prelinked_modules() { module **m; /* First, set all module indices, and init total_modules. */ total_modules = 0; - for (m = preloaded_modules; *m; ++m, ++total_modules) { + for (m = ap_preloaded_modules; *m; ++m, ++total_modules) { (*m)->module_index = total_modules; } - for (m = prelinked_modules; *m; ++m) { - add_module(*m); + for (m = ap_prelinked_modules; *m; ++m) { + ap_add_module(*m); } } -API_EXPORT(const char *) find_module_name(module *m) +API_EXPORT(const char *) ap_find_module_name(module *m) { return m->name; } -API_EXPORT(module *) find_linked_module(const char *name) +API_EXPORT(module *) ap_find_linked_module(const char *name) { module *modp; @@ -649,16 +649,16 @@ } /* Add a named module. Returns 1 if module found, 0 otherwise. */ -API_EXPORT(int) add_named_module(const char *name) +API_EXPORT(int) ap_add_named_module(const char *name) { module *modp; int i = 0; - for (modp = preloaded_modules[i]; modp; modp = preloaded_modules[++i]) { + for (modp = ap_preloaded_modules[i]; modp; modp = ap_preloaded_modules[++i]) { if (strcmp(modp->name, name) == 0) { /* Only add modules that are not already enabled. */ if (modp->next == NULL) { - add_module(modp); + ap_add_module(modp); } return 1; } @@ -668,7 +668,7 @@ } /* Clear the internal list of modules, in preparation for starting over. */ -API_EXPORT(void) clear_module_list() +API_EXPORT(void) ap_clear_module_list() { module **m = &top_module; module **next_m; @@ -680,7 +680,7 @@ } /* This is required; so we add it always. */ - add_named_module("http_core.c"); + ap_add_named_module("http_core.c"); } /***************************************************************** @@ -699,7 +699,7 @@ const char *errmsg; if ((parms->override & cmd->req_override) == 0) - return pstrcat(parms->pool, cmd->name, " not allowed here", NULL); + return ap_pstrcat(parms->pool, cmd->name, " not allowed here", NULL); parms->info = cmd->cmd_data; parms->cmd = cmd; @@ -711,17 +711,17 @@ case NO_ARGS: if (*args != 0) - return pstrcat(parms->pool, cmd->name, " takes no arguments", + return ap_pstrcat(parms->pool, cmd->name, " takes no arguments", NULL); return ((const char *(*)(cmd_parms *, void *)) (cmd->func)) (parms, mconfig); case TAKE1: - w = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); if (*w == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, " takes one argument", + return ap_pstrcat(parms->pool, cmd->name, " takes one argument", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); return ((const char *(*)(cmd_parms *, void *, const char *)) @@ -729,11 +729,11 @@ case TAKE2: - w = getword_conf(parms->pool, &args); - w2 = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); + w2 = ap_getword_conf(parms->pool, &args); if (*w == '\0' || *w2 == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, " takes two arguments", + return ap_pstrcat(parms->pool, cmd->name, " takes two arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); return ((const char *(*)(cmd_parms *, void *, const char *, @@ -741,11 +741,11 @@ case TAKE12: - w = getword_conf(parms->pool, &args); - w2 = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); + w2 = ap_getword_conf(parms->pool, &args); if (*w == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, " takes 1-2 arguments", + return ap_pstrcat(parms->pool, cmd->name, " takes 1-2 arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); return ((const char *(*)(cmd_parms *, void *, const char *, @@ -754,12 +754,12 @@ case TAKE3: - w = getword_conf(parms->pool, &args); - w2 = getword_conf(parms->pool, &args); - w3 = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); + w2 = ap_getword_conf(parms->pool, &args); + w3 = ap_getword_conf(parms->pool, &args); if (*w == '\0' || *w2 == '\0' || *w3 == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, " takes three arguments", + return ap_pstrcat(parms->pool, cmd->name, " takes three arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); return ((const char *(*)(cmd_parms *, void *, const char *, @@ -768,12 +768,12 @@ case TAKE23: - w = getword_conf(parms->pool, &args); - w2 = getword_conf(parms->pool, &args); - w3 = *args ? getword_conf(parms->pool, &args) : NULL; + w = ap_getword_conf(parms->pool, &args); + w2 = ap_getword_conf(parms->pool, &args); + w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL; if (*w == '\0' || *w2 == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, + return ap_pstrcat(parms->pool, cmd->name, " takes two or three arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); @@ -783,12 +783,12 @@ case TAKE123: - w = getword_conf(parms->pool, &args); - w2 = *args ? getword_conf(parms->pool, &args) : NULL; - w3 = *args ? getword_conf(parms->pool, &args) : NULL; + w = ap_getword_conf(parms->pool, &args); + w2 = *args ? ap_getword_conf(parms->pool, &args) : NULL; + w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL; if (*w == '\0' || *args != 0) - return pstrcat(parms->pool, cmd->name, + return ap_pstrcat(parms->pool, cmd->name, " takes one, two or three arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); @@ -798,12 +798,12 @@ case TAKE13: - w = getword_conf(parms->pool, &args); - w2 = *args ? getword_conf(parms->pool, &args) : NULL; - w3 = *args ? getword_conf(parms->pool, &args) : NULL; + w = ap_getword_conf(parms->pool, &args); + w2 = *args ? ap_getword_conf(parms->pool, &args) : NULL; + w3 = *args ? ap_getword_conf(parms->pool, &args) : NULL; if (*w == '\0' || (*w2 && !w3) || *args != 0) - return pstrcat(parms->pool, cmd->name, + return ap_pstrcat(parms->pool, cmd->name, " takes one or three arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); @@ -813,7 +813,7 @@ case ITERATE: - while (*(w = getword_conf(parms->pool, &args)) != '\0') + while (*(w = ap_getword_conf(parms->pool, &args)) != '\0') if ((errmsg = ((const char *(*)(cmd_parms *, void *, const char *)) (cmd->func)) (parms, mconfig, w))) return errmsg; @@ -822,15 +822,15 @@ case ITERATE2: - w = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); if (*w == '\0' || *args == 0) - return pstrcat(parms->pool, cmd->name, + return ap_pstrcat(parms->pool, cmd->name, " requires at least two arguments", cmd->errmsg ? ", " : NULL, cmd->errmsg, NULL); - while (*(w2 = getword_conf(parms->pool, &args)) != '\0') + while (*(w2 = ap_getword_conf(parms->pool, &args)) != '\0') if ((errmsg = ((const char *(*)(cmd_parms *, void *, const char *, const char *)) (cmd->func)) (parms, mconfig, w, w2))) @@ -840,10 +840,10 @@ case FLAG: - w = getword_conf(parms->pool, &args); + w = ap_getword_conf(parms->pool, &args); if (*w == '\0' || (strcasecmp(w, "on") && strcasecmp(w, "off"))) - return pstrcat(parms->pool, cmd->name, " must be On or Off", + return ap_pstrcat(parms->pool, cmd->name, " must be On or Off", NULL); return ((const char *(*)(cmd_parms *, void *, int)) @@ -851,13 +851,13 @@ default: - return pstrcat(parms->pool, cmd->name, + return ap_pstrcat(parms->pool, cmd->name, " is improperly configured internally (server bug)", NULL); } } -CORE_EXPORT(const command_rec *) find_command(const char *name, const command_rec *cmds) +CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds) { while (cmds->name) if (!strcasecmp(name, cmds->name)) @@ -868,13 +868,13 @@ return NULL; } -CORE_EXPORT(const command_rec *) find_command_in_modules(const char *cmd_name, module **mod) +CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod) { const command_rec *cmdp; module *modp; for (modp = *mod; modp; modp = modp->next) - if (modp->cmds && (cmdp = find_command(cmd_name, modp->cmds))) { + if (modp->cmds && (cmdp = ap_find_command(cmd_name, modp->cmds))) { *mod = modp; return cmdp; } @@ -882,7 +882,7 @@ return NULL; } -CORE_EXPORT(const char *) handle_command(cmd_parms *parms, void *config, const char *l) +CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l) { const char *args, *cmd_name, *retval; const command_rec *cmd; @@ -892,31 +892,31 @@ return NULL; args = l; - cmd_name = getword_conf(parms->temp_pool, &args); + cmd_name = ap_getword_conf(parms->temp_pool, &args); if (*cmd_name == '\0') return NULL; do { - if (!(cmd = find_command_in_modules(cmd_name, &mod))) { + if (!(cmd = ap_find_command_in_modules(cmd_name, &mod))) { errno = EINVAL; - return pstrcat(parms->pool, "Invalid command '", cmd_name, + return ap_pstrcat(parms->pool, "Invalid command '", cmd_name, "', perhaps mis-spelled or defined by a module " "not included in the server configuration", NULL); } else { - void *mconfig = get_module_config(config, mod); + void *mconfig = ap_get_module_config(config, mod); void *sconfig = - get_module_config(parms->server->module_config, mod); + ap_get_module_config(parms->server->module_config, mod); if (!mconfig && mod->create_dir_config) { mconfig = (*mod->create_dir_config) (parms->pool, parms->path); - set_module_config(config, mod, mconfig); + ap_set_module_config(config, mod, mconfig); } if (!sconfig && mod->create_server_config) { sconfig = (*mod->create_server_config) (parms->pool, parms->server); - set_module_config(parms->server->module_config, mod, sconfig); + ap_set_module_config(parms->server->module_config, mod, sconfig); } retval = invoke_cmd(cmd, parms, mconfig, args); @@ -927,12 +927,12 @@ return retval; } -API_EXPORT(const char *) srm_command_loop(cmd_parms *parms, void *config) +API_EXPORT(const char *) ap_srm_command_loop(cmd_parms *parms, void *config) { char l[MAX_STRING_LEN]; - while (!(cfg_getline(l, MAX_STRING_LEN, parms->config_file))) { - const char *errmsg = handle_command(parms, config, l); + while (!(ap_cfg_getline(l, MAX_STRING_LEN, parms->config_file))) { + const char *errmsg = ap_handle_command(parms, config, l); if (errmsg) { return errmsg; } @@ -945,7 +945,7 @@ * Generic command functions... */ -API_EXPORT_NONSTD(const char *) set_string_slot(cmd_parms *cmd, +API_EXPORT_NONSTD(const char *) ap_set_string_slot(cmd_parms *cmd, char *struct_ptr, char *arg) { /* This one's pretty generic... */ @@ -955,18 +955,18 @@ return NULL; } -API_EXPORT_NONSTD(const char *) set_string_slot_lower(cmd_parms *cmd, +API_EXPORT_NONSTD(const char *) ap_set_string_slot_lower(cmd_parms *cmd, char *struct_ptr, char *arg) { /* This one's pretty generic... */ int offset = (int) (long) cmd->info; - str_tolower(arg); + ap_str_tolower(arg); *(char **) (struct_ptr + offset) = arg; return NULL; } -API_EXPORT_NONSTD(const char *) set_flag_slot(cmd_parms *cmd, +API_EXPORT_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, char *struct_ptr, int arg) { /* This one's pretty generic too... */ @@ -976,17 +976,17 @@ return NULL; } -API_EXPORT_NONSTD(const char *) set_file_slot(cmd_parms *cmd, char *struct_ptr, char *arg) +API_EXPORT_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, char *struct_ptr, char *arg) { /* Prepend server_root to relative arg. This allows .htaccess to be independent of server_root, so the server can be moved or mirrored with less pain. */ char *p; int offset = (int) (long) cmd->info; - if (os_is_path_absolute(arg)) + if (ap_is_path_absolute(arg)) p = arg; else - p = make_full_path(cmd->pool, server_root, arg); + p = ap_make_full_path(cmd->pool, ap_server_root, arg); *(char **) (struct_ptr + offset) = p; return NULL; } @@ -999,11 +999,11 @@ static cmd_parms default_parms = {NULL, 0, -1, NULL, NULL, NULL, NULL, NULL, NULL}; -API_EXPORT(char *) server_root_relative(pool *p, char *file) +API_EXPORT(char *) ap_server_root_relative(pool *p, char *file) { - if(os_is_path_absolute(file)) + if(ap_is_path_absolute(file)) return file; - return make_full_path(p, server_root, file); + return ap_make_full_path(p, ap_server_root, file); } @@ -1062,37 +1062,37 @@ parms.temp_pool = ptemp; parms.server = s; parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT); - parms.config_file = pcfg_open_custom(p, "-c/-C directives", + parms.config_file = ap_pcfg_open_custom(p, "-c/-C directives", &arr_parms, NULL, arr_elts_getstr, arr_elts_close); - errmsg = srm_command_loop(&parms, s->lookup_defaults); + errmsg = ap_srm_command_loop(&parms, s->lookup_defaults); if (errmsg) { fprintf(stderr, "Syntax error in -C/-c directive:\n%s\n", errmsg); exit(1); } - cfg_closefile(parms.config_file); + ap_cfg_closefile(parms.config_file); } -void process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp) +void ap_process_resource_config(server_rec *s, char *fname, pool *p, pool *ptemp) { const char *errmsg; cmd_parms parms; struct stat finfo; - fname = server_root_relative(p, fname); + fname = ap_server_root_relative(p, fname); - if (!(strcmp(fname, server_root_relative(p, RESOURCE_CONFIG_FILE))) || - !(strcmp(fname, server_root_relative(p, ACCESS_CONFIG_FILE)))) { + if (!(strcmp(fname, ap_server_root_relative(p, RESOURCE_CONFIG_FILE))) || + !(strcmp(fname, ap_server_root_relative(p, ACCESS_CONFIG_FILE)))) { if (stat(fname, &finfo) == -1) return; } /* don't require conf/httpd.conf if we have a -C or -c switch */ - if((server_pre_read_config->nelts || server_post_read_config->nelts) && - !(strcmp(fname, server_root_relative(p, SERVER_CONFIG_FILE)))) { + if((ap_server_pre_read_config->nelts || ap_server_post_read_config->nelts) && + !(strcmp(fname, ap_server_root_relative(p, SERVER_CONFIG_FILE)))) { if (stat(fname, &finfo) == -1) return; } @@ -1105,14 +1105,14 @@ parms.server = s; parms.override = (RSRC_CONF | OR_ALL) & ~(OR_AUTHCFG | OR_LIMIT); - if (!(parms.config_file = pcfg_openfile(p,fname))) { + if (!(parms.config_file = ap_pcfg_openfile(p,fname))) { perror("fopen"); fprintf(stderr, "httpd: could not open document config file %s\n", fname); exit(1); } - errmsg = srm_command_loop(&parms, s->lookup_defaults); + errmsg = ap_srm_command_loop(&parms, s->lookup_defaults); if (errmsg) { fprintf(stderr, "Syntax error on line %d of %s:\n", @@ -1121,11 +1121,11 @@ exit(1); } - cfg_closefile(parms.config_file); + ap_cfg_closefile(parms.config_file); } -int parse_htaccess(void **result, request_rec *r, int override, +int ap_parse_htaccess(void **result, request_rec *r, int override, const char *d, const char *access_name) { configfile_t *f = NULL; @@ -1149,25 +1149,25 @@ parms.pool = r->pool; parms.temp_pool = r->pool; parms.server = r->server; - parms.path = pstrdup(r->pool, d); + parms.path = ap_pstrdup(r->pool, d); /* loop through the access names and find the first one */ while (!f && access_name[0]) { - char *w = getword_conf(r->pool, &access_name); - filename = make_full_path(r->pool, d, w); - f = pcfg_openfile(r->pool, filename); + char *w = ap_getword_conf(r->pool, &access_name); + filename = ap_make_full_path(r->pool, d, w); + f = ap_pcfg_openfile(r->pool, filename); } if (f) { - dc = create_per_dir_config(r->pool); + dc = ap_create_per_dir_config(r->pool); parms.config_file = f; - errmsg = srm_command_loop(&parms, dc); + errmsg = ap_srm_command_loop(&parms, dc); - cfg_closefile(f); + ap_cfg_closefile(f); if (errmsg) { - aplog_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, r->server, "%s: %s", + ap_log_error(APLOG_MARK, APLOG_ALERT|APLOG_NOERRNO, r->server, "%s: %s", filename, errmsg); return HTTP_INTERNAL_SERVER_ERROR; } @@ -1178,7 +1178,7 @@ if (errno == ENOENT || errno == ENOTDIR) dc = NULL; else { - aplog_error(APLOG_MARK, APLOG_CRIT, r->server, + ap_log_error(APLOG_MARK, APLOG_CRIT, r->server, "%s pcfg_openfile: unable to check htaccess file, ensure it is readable", filename); return HTTP_FORBIDDEN; @@ -1186,7 +1186,7 @@ } /* cache it */ - new = palloc(r->pool, sizeof(struct htaccess_result)); + new = ap_palloc(r->pool, sizeof(struct htaccess_result)); new->dir = parms.path; new->override = override; new->htaccess = dc; @@ -1198,10 +1198,10 @@ } -CORE_EXPORT(const char *) init_virtual_host(pool *p, const char *hostname, +CORE_EXPORT(const char *) ap_init_virtual_host(pool *p, const char *hostname, server_rec *main_server, server_rec **ps) { - server_rec *s = (server_rec *) pcalloc(p, sizeof(server_rec)); + server_rec *s = (server_rec *) ap_pcalloc(p, sizeof(server_rec)); #ifdef RLIMIT_NOFILE struct rlimit limits; @@ -1232,18 +1232,18 @@ s->next = NULL; s->is_virtual = 1; - s->names = make_array(p, 4, sizeof(char **)); - s->wild_names = make_array(p, 4, sizeof(char **)); + s->names = ap_make_array(p, 4, sizeof(char **)); + s->wild_names = ap_make_array(p, 4, sizeof(char **)); s->module_config = create_empty_config(p); - s->lookup_defaults = create_per_dir_config(p); + s->lookup_defaults = ap_create_per_dir_config(p); - s->server_uid = user_id; - s->server_gid = group_id; + s->server_uid = ap_user_id; + s->server_gid = ap_group_id; *ps = s; - return parse_vhost_addrs(p, hostname, s); + return ap_parse_vhost_addrs(p, hostname, s); } @@ -1256,7 +1256,7 @@ virt->module_config); virt->lookup_defaults = - merge_per_dir_configs(p, main_server->lookup_defaults, + ap_merge_per_dir_configs(p, main_server->lookup_defaults, virt->lookup_defaults); if (virt->server_admin == NULL) @@ -1285,9 +1285,9 @@ /* XXX: this is really something that should be dealt with by a * post-config api phase */ - core_reorder_directories(p, virt); + ap_core_reorder_directories(p, virt); } - core_reorder_directories(p, main_server); + ap_core_reorder_directories(p, main_server); } /***************************************************************** @@ -1299,31 +1299,31 @@ { /* ServerRoot, server_confname set in httpd.c */ - standalone = 1; - user_name = DEFAULT_USER; - user_id = uname2id(DEFAULT_USER); - group_id = gname2id(DEFAULT_GROUP); - daemons_to_start = DEFAULT_START_DAEMON; - daemons_min_free = DEFAULT_MIN_FREE_DAEMON; - daemons_max_free = DEFAULT_MAX_FREE_DAEMON; - daemons_limit = HARD_SERVER_LIMIT; - pid_fname = DEFAULT_PIDLOG; - scoreboard_fname = DEFAULT_SCOREBOARD; - lock_fname = DEFAULT_LOCKFILE; - max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD; - bind_address.s_addr = htonl(INADDR_ANY); - listeners = NULL; - listenbacklog = DEFAULT_LISTENBACKLOG; + ap_standalone = 1; + ap_user_name = DEFAULT_USER; + ap_user_id = ap_uname2id(DEFAULT_USER); + ap_group_id = ap_gname2id(DEFAULT_GROUP); + ap_daemons_to_start = DEFAULT_START_DAEMON; + ap_daemons_min_free = DEFAULT_MIN_FREE_DAEMON; + ap_daemons_max_free = DEFAULT_MAX_FREE_DAEMON; + ap_daemons_limit = HARD_SERVER_LIMIT; + ap_pid_fname = DEFAULT_PIDLOG; + ap_scoreboard_fname = DEFAULT_SCOREBOARD; + ap_lock_fname = DEFAULT_LOCKFILE; + ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD; + ap_bind_address.s_addr = htonl(INADDR_ANY); + ap_listeners = NULL; + ap_listenbacklog = DEFAULT_LISTENBACKLOG; /* Global virtual host hash bucket pointers. Init to null. */ - init_vhost_config(p); + ap_init_vhost_config(p); - ap_cpystrn(coredump_dir, server_root, sizeof(coredump_dir)); + ap_cpystrn(ap_coredump_dir, ap_server_root, sizeof(ap_coredump_dir)); } static server_rec *init_server_config(pool *p) { - server_rec *s = (server_rec *) pcalloc(p, sizeof(server_rec)); + server_rec *s = (server_rec *) ap_pcalloc(p, sizeof(server_rec)); s->port = 0; s->server_admin = DEFAULT_ADMIN; @@ -1338,7 +1338,7 @@ s->keep_alive_max = DEFAULT_KEEPALIVE; s->keep_alive = 1; s->next = NULL; - s->addrs = pcalloc(p, sizeof(server_addr_rec)); + s->addrs = ap_pcalloc(p, sizeof(server_addr_rec)); /* NOT virtual host; don't match any real network interface */ s->addrs->host_addr.s_addr = htonl(INADDR_ANY); s->addrs->host_port = 0; /* matches any port */ @@ -1356,22 +1356,22 @@ { listen_rec *new; - if (listeners != NULL) { + if (ap_listeners != NULL) { return; } /* allocate a default listener */ - new = pcalloc(p, sizeof(listen_rec)); + new = ap_pcalloc(p, sizeof(listen_rec)); new->local_addr.sin_family = AF_INET; - new->local_addr.sin_addr = bind_address; + new->local_addr.sin_addr = ap_bind_address; new->local_addr.sin_port = htons(s->port ? s->port : DEFAULT_HTTP_PORT); new->fd = -1; new->used = 0; new->next = NULL; - listeners = new; + ap_listeners = new; } -server_rec *read_config(pool *p, pool *ptemp, char *confname) +server_rec *ap_read_config(pool *p, pool *ptemp, char *confname) { server_rec *s = init_server_config(p); @@ -1379,23 +1379,23 @@ /* All server-wide config files now have the SAME syntax... */ - process_command_config(s, server_pre_read_config, p, ptemp); + process_command_config(s, ap_server_pre_read_config, p, ptemp); - process_resource_config(s, confname, p, ptemp); - process_resource_config(s, s->srm_confname, p, ptemp); - process_resource_config(s, s->access_confname, p, ptemp); + ap_process_resource_config(s, confname, p, ptemp); + ap_process_resource_config(s, s->srm_confname, p, ptemp); + ap_process_resource_config(s, s->access_confname, p, ptemp); - process_command_config(s, server_post_read_config, p, ptemp); + process_command_config(s, ap_server_post_read_config, p, ptemp); fixup_virtual_hosts(p, s); default_listeners(p, s); - fini_vhost_config(p, s); + ap_fini_vhost_config(p, s); return s; } -void init_modules(pool *p, server_rec *s) +void ap_init_modules(pool *p, server_rec *s) { module *m; @@ -1406,7 +1406,7 @@ init_handlers(p); } -void child_init_modules(pool *p, server_rec *s) +void ap_child_init_modules(pool *p, server_rec *s) { module *m; @@ -1415,7 +1415,7 @@ (*m->child_init) (s, p); } -void child_exit_modules(pool *p, server_rec *s) +void ap_child_exit_modules(pool *p, server_rec *s) { module *m; @@ -1510,26 +1510,26 @@ * the directive arguments, in what module they are handled, and in * what parts of the configuration they are allowed. Used for httpd -h. */ -void show_directives() +void ap_show_directives() { const command_rec *pc; int n; - for (n = 0; preloaded_modules[n]; ++n) - for (pc = preloaded_modules[n]->cmds; pc && pc->name; ++pc) { - printf("%s (%s)\n", pc->name, preloaded_modules[n]->name); + for (n = 0; ap_preloaded_modules[n]; ++n) + for (pc = ap_preloaded_modules[n]->cmds; pc && pc->name; ++pc) { + printf("%s (%s)\n", pc->name, ap_preloaded_modules[n]->name); if (pc->errmsg) printf("\t%s\n", pc->errmsg); - show_overrides(pc, preloaded_modules[n]); + show_overrides(pc, ap_preloaded_modules[n]); } } /* Show the preloaded module names. Used for httpd -l. */ -void show_modules() +void ap_show_modules() { int n; printf("Compiled-in modules:\n"); - for (n = 0; preloaded_modules[n]; ++n) - printf(" %s\n", preloaded_modules[n]->name); + for (n = 0; ap_preloaded_modules[n]; ++n) + printf(" %s\n", ap_preloaded_modules[n]->name); } 1.181 +291 -291 apache-1.3/src/main/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_core.c,v retrieving revision 1.180 retrieving revision 1.181 diff -u -r1.180 -r1.181 --- http_core.c 1998/03/31 12:52:42 1.180 +++ http_core.c 1998/04/11 12:00:29 1.181 @@ -107,13 +107,13 @@ static void *create_core_dir_config (pool *a, char *dir) { core_dir_config *conf = - (core_dir_config *)pcalloc(a, sizeof(core_dir_config)); + (core_dir_config *)ap_pcalloc(a, sizeof(core_dir_config)); if (!dir || dir[strlen(dir) - 1] == '/') conf->d = dir; - else if (strncmp(dir,"proxy:",6)==0) conf->d = pstrdup (a, dir); - else conf->d = pstrcat (a, dir, "/", NULL); - conf->d_is_fnmatch = conf->d ? (is_fnmatch (conf->d) != 0) : 0; - conf->d_components = conf->d ? count_dirs (conf->d) : 0; + else if (strncmp(dir,"proxy:",6)==0) conf->d = ap_pstrdup (a, dir); + else conf->d = ap_pstrcat (a, dir, "/", NULL); + conf->d_is_fnmatch = conf->d ? (ap_is_fnmatch (conf->d) != 0) : 0; + conf->d_components = conf->d ? ap_count_dirs (conf->d) : 0; conf->opts = dir ? OPT_UNSET : OPT_UNSET|OPT_ALL; conf->opts_add = conf->opts_remove = OPT_NONE; @@ -137,7 +137,7 @@ conf->limit_nproc = NULL; #endif - conf->sec = make_array (a, 2, sizeof(void *)); + conf->sec = ap_make_array (a, 2, sizeof(void *)); return (void *)conf; } @@ -147,12 +147,12 @@ core_dir_config *base = (core_dir_config *)basev; core_dir_config *new = (core_dir_config *)newv; core_dir_config *conf = - (core_dir_config *)palloc (a, sizeof(core_dir_config)); + (core_dir_config *)ap_palloc (a, sizeof(core_dir_config)); int i; memcpy ((char *)conf, (const char *)base, sizeof(core_dir_config)); if( base->response_code_strings ) { - conf->response_code_strings = palloc(a, + conf->response_code_strings = ap_palloc(a, sizeof(*conf->response_code_strings) * RESPONSE_CODES ); memcpy( conf->response_code_strings, base->response_code_strings, sizeof(*conf->response_code_strings) * RESPONSE_CODES ); @@ -183,15 +183,15 @@ } if (!(new->override & OR_UNSET)) conf->override = new->override; - if (new->default_type) conf->default_type = new->default_type; + if (new->ap_default_type) conf->ap_default_type = new->ap_default_type; - if (new->auth_type) conf->auth_type = new->auth_type; - if (new->auth_name) conf->auth_name = new->auth_name; - if (new->requires) conf->requires = new->requires; + if (new->ap_auth_type) conf->ap_auth_type = new->ap_auth_type; + if (new->ap_auth_name) conf->ap_auth_name = new->ap_auth_name; + if (new->ap_requires) conf->ap_requires = new->ap_requires; if( new->response_code_strings ) { if( conf->response_code_strings == NULL ) { - conf->response_code_strings = palloc(a, + conf->response_code_strings = ap_palloc(a, sizeof(*conf->response_code_strings) * RESPONSE_CODES ); memcpy( conf->response_code_strings, new->response_code_strings, sizeof(*conf->response_code_strings) * RESPONSE_CODES ); @@ -219,7 +219,7 @@ if (new->limit_nproc) conf->limit_nproc = new->limit_nproc; #endif - conf->sec = append_arrays (a, base->sec, new->sec); + conf->sec = ap_append_arrays (a, base->sec, new->sec); if (new->satisfy != SATISFY_NOSPEC) conf->satisfy = new->satisfy; return (void*)conf; @@ -228,13 +228,13 @@ static void *create_core_server_config (pool *a, server_rec *s) { core_server_config *conf = - (core_server_config *)pcalloc(a, sizeof(core_server_config)); + (core_server_config *)ap_pcalloc(a, sizeof(core_server_config)); int is_virtual = s->is_virtual; conf->access_name = is_virtual ? NULL : DEFAULT_ACCESS_FNAME; - conf->document_root = is_virtual ? NULL : DOCUMENT_LOCATION; - conf->sec = make_array (a, 40, sizeof(void *)); - conf->sec_url = make_array (a, 40, sizeof(void *)); + conf->ap_document_root = is_virtual ? NULL : DOCUMENT_LOCATION; + conf->sec = ap_make_array (a, 40, sizeof(void *)); + conf->sec_url = ap_make_array (a, 40, sizeof(void *)); return (void *)conf; } @@ -244,13 +244,13 @@ core_server_config *base = (core_server_config *)basev; core_server_config *virt = (core_server_config *)virtv; core_server_config *conf = - (core_server_config *)pcalloc(p, sizeof(core_server_config)); + (core_server_config *)ap_pcalloc(p, sizeof(core_server_config)); *conf = *virt; if (!conf->access_name) conf->access_name = base->access_name; - if (!conf->document_root) conf->document_root = base->document_root; - conf->sec = append_arrays (p, base->sec, virt->sec); - conf->sec_url = append_arrays (p, base->sec_url, virt->sec_url); + if (!conf->ap_document_root) conf->ap_document_root = base->ap_document_root; + conf->sec = ap_append_arrays (p, base->sec, virt->sec); + conf->sec_url = ap_append_arrays (p, base->sec_url, virt->sec_url); return conf; } @@ -259,27 +259,27 @@ * these are part of the core server config. */ -CORE_EXPORT(void) add_per_dir_conf (server_rec *s, void *dir_config) +CORE_EXPORT(void) ap_add_per_dir_conf (server_rec *s, void *dir_config) { - core_server_config *sconf = get_module_config (s->module_config, + core_server_config *sconf = ap_get_module_config (s->module_config, &core_module); - void **new_space = (void **) push_array (sconf->sec); + void **new_space = (void **) ap_push_array (sconf->sec); *new_space = dir_config; } -CORE_EXPORT(void) add_per_url_conf (server_rec *s, void *url_config) +CORE_EXPORT(void) ap_add_per_url_conf (server_rec *s, void *url_config) { - core_server_config *sconf = get_module_config (s->module_config, + core_server_config *sconf = ap_get_module_config (s->module_config, &core_module); - void **new_space = (void **) push_array (sconf->sec_url); + void **new_space = (void **) ap_push_array (sconf->sec_url); *new_space = url_config; } static void add_file_conf (core_dir_config *conf, void *url_config) { - void **new_space = (void **) push_array (conf->sec); + void **new_space = (void **) ap_push_array (conf->sec); *new_space = url_config; } @@ -318,8 +318,8 @@ core_dir_config *core_a; core_dir_config *core_b; - core_a = (core_dir_config *)get_module_config (a->elt, &core_module); - core_b = (core_dir_config *)get_module_config (b->elt, &core_module); + core_a = (core_dir_config *)ap_get_module_config (a->elt, &core_module); + core_b = (core_dir_config *)ap_get_module_config (b->elt, &core_module); if (IS_SPECIAL(core_a)) { if (!IS_SPECIAL(core_b)) { return 1; @@ -340,7 +340,7 @@ return a->orig_index - b->orig_index; } -void core_reorder_directories (pool *p, server_rec *s) +void ap_core_reorder_directories (pool *p, server_rec *s) { core_server_config *sconf; array_header *sec; @@ -353,13 +353,13 @@ * and we need some scratch space to do it. The old array and the * scratch space are never freed. */ - sconf = get_module_config (s->module_config, &core_module); + sconf = ap_get_module_config (s->module_config, &core_module); sec = sconf->sec; nelts = sec->nelts; elts = (void **)sec->elts; /* build our sorting space */ - sortbin = palloc (p, sec->nelts * sizeof (*sortbin)); + sortbin = ap_palloc (p, sec->nelts * sizeof (*sortbin)); for (i = 0; i < nelts; ++i) { sortbin[i].orig_index = i; sortbin[i].elt = elts[i]; @@ -368,9 +368,9 @@ qsort (sortbin, nelts, sizeof (*sortbin), reorder_sorter); /* and now build a new array */ - sec = make_array (p, nelts, sizeof (void *)); + sec = ap_make_array (p, nelts, sizeof (void *)); for (i = 0; i < nelts; ++i) { - *(void **)push_array (sec) = sortbin[i].elt; + *(void **)ap_push_array (sec) = sortbin[i].elt; } sconf->sec = sec; @@ -384,67 +384,67 @@ * here... */ -API_EXPORT(int) allow_options (request_rec *r) +API_EXPORT(int) ap_allow_options (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); return conf->opts; } -API_EXPORT(int) allow_overrides (request_rec *r) +API_EXPORT(int) ap_allow_overrides (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); return conf->override; } -API_EXPORT(char *) auth_type (request_rec *r) +API_EXPORT(char *) ap_auth_type (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - return conf->auth_type; + return conf->ap_auth_type; } -API_EXPORT(char *) auth_name (request_rec *r) +API_EXPORT(char *) ap_auth_name (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - return conf->auth_name; + return conf->ap_auth_name; } -API_EXPORT(char *) default_type (request_rec *r) +API_EXPORT(char *) ap_default_type (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - return conf->default_type ? conf->default_type : DEFAULT_CONTENT_TYPE; + return conf->ap_default_type ? conf->ap_default_type : DEFAULT_CONTENT_TYPE; } -API_EXPORT(char *) document_root (request_rec *r) /* Don't use this!!! */ +API_EXPORT(char *) ap_document_root (request_rec *r) /* Don't use this!!! */ { core_server_config *conf = - (core_server_config *)get_module_config(r->server->module_config, + (core_server_config *)ap_get_module_config(r->server->module_config, &core_module); - return conf->document_root; + return conf->ap_document_root; } -API_EXPORT(array_header *) requires (request_rec *r) +API_EXPORT(array_header *) ap_requires (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - return conf->requires; + return conf->ap_requires; } -API_EXPORT(int) satisfies (request_rec *r) +API_EXPORT(int) ap_satisfies (request_rec *r) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); return conf->satisfy; } @@ -454,10 +454,10 @@ * modules). */ -char *response_code_string (request_rec *r, int error_index) +char *ap_response_code_string (request_rec *r, int error_index) { core_dir_config *conf = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); if( conf->response_code_strings == NULL ) { return NULL; @@ -495,7 +495,7 @@ conn->double_reverse = -1; } -API_EXPORT(const char *) get_remote_host(conn_rec *conn, void *dir_config, int type) +API_EXPORT(const char *) ap_get_remote_host(conn_rec *conn, void *dir_config, int type) { struct in_addr *iaddr; struct hostent *hptr; @@ -507,7 +507,7 @@ /* If we haven't checked the host name, and we want to */ if (dir_config) { hostname_lookups = - ((core_dir_config *)get_module_config(dir_config, &core_module)) + ((core_dir_config *)ap_get_module_config(dir_config, &core_module)) ->hostname_lookups; if (hostname_lookups == HOSTNAME_LOOKUP_UNSET) { hostname_lookups = HOSTNAME_LOOKUP_OFF; @@ -522,14 +522,14 @@ && (type == REMOTE_DOUBLE_REV || hostname_lookups != HOSTNAME_LOOKUP_OFF)) { #ifdef STATUS - old_stat = update_child_status(conn->child_num, SERVER_BUSY_DNS, + old_stat = ap_update_child_status(conn->child_num, SERVER_BUSY_DNS, (request_rec*)NULL); #endif /* STATUS */ iaddr = &(conn->remote_addr.sin_addr); hptr = gethostbyaddr((char *)iaddr, sizeof(struct in_addr), AF_INET); if (hptr != NULL) { - conn->remote_host = pstrdup(conn->pool, (void *)hptr->h_name); - str_tolower (conn->remote_host); + conn->remote_host = ap_pstrdup(conn->pool, (void *)hptr->h_name); + ap_str_tolower (conn->remote_host); if (hostname_lookups == HOSTNAME_LOOKUP_DOUBLE) { do_double_reverse (conn); @@ -549,7 +549,7 @@ } #ifdef STATUS if (old_stat != SERVER_DEAD) { - (void)update_child_status(conn->child_num,old_stat,(request_rec*)NULL); + (void)ap_update_child_status(conn->child_num,old_stat,(request_rec*)NULL); } #endif /* STATUS */ @@ -567,7 +567,7 @@ } } -API_EXPORT(const char *) get_remote_logname(request_rec *r) +API_EXPORT(const char *) ap_get_remote_logname(request_rec *r) { core_dir_config *dir_conf; @@ -576,10 +576,10 @@ /* If we haven't checked the identity, and we want to */ dir_conf = (core_dir_config *) - get_module_config(r->per_dir_config, &core_module); + ap_get_module_config(r->per_dir_config, &core_module); if (dir_conf->do_rfc1413 & 1) - return rfc1413(r->connection, r->server); + return ap_rfc1413(r->connection, r->server); else return NULL; } @@ -590,10 +590,10 @@ * trust the port passed in the client's headers, we always use the * port of the actual socket. */ -API_EXPORT(const char *) get_server_name(const request_rec *r) +API_EXPORT(const char *) ap_get_server_name(const request_rec *r) { core_dir_config *d = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); if (d->use_canonical_name & 1) { return r->server->server_hostname; @@ -601,11 +601,11 @@ return r->hostname ? r->hostname : r->server->server_hostname; } -API_EXPORT(unsigned) get_server_port(const request_rec *r) +API_EXPORT(unsigned) ap_get_server_port(const request_rec *r) { unsigned port; core_dir_config *d = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); port = r->server->port ? r->server->port : default_port(r); @@ -616,12 +616,12 @@ : port; } -API_EXPORT(char *) construct_url(pool *p, const char *uri, const request_rec *r) +API_EXPORT(char *) ap_construct_url(pool *p, const char *uri, const request_rec *r) { unsigned port; const char *host; core_dir_config *d = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); if (d->use_canonical_name & 1) { port = r->server->port ? r->server->port : default_port(r); @@ -638,9 +638,9 @@ host = r->hostname ? r->hostname : r->server->server_hostname; } if (is_default_port(port, r)) { - return pstrcat(p, http_method(r), "://", host, uri, NULL); + return ap_pstrcat(p, http_method(r), "://", host, uri, NULL); } - return psprintf(p, "%s://%s:%u%s", http_method(r), host, port, uri); + return ap_psprintf(p, "%s://%s:%u%s", http_method(r), host, port, uri); } /***************************************************************** @@ -659,21 +659,21 @@ static const char end_ifmodule_section[] = "</IfModule>"; -API_EXPORT(const char *) check_cmd_context(cmd_parms *cmd, unsigned forbidden) +API_EXPORT(const char *) ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden) { const char *gt = (cmd->cmd->name[0] == '<' && cmd->cmd->name[strlen(cmd->cmd->name)-1] != '>') ? ">" : ""; if ((forbidden & NOT_IN_VIRTUALHOST) && cmd->server->is_virtual) - return pstrcat(cmd->pool, cmd->cmd->name, gt, + return ap_pstrcat(cmd->pool, cmd->cmd->name, gt, " cannot occur within <VirtualHost> section", NULL); if ((forbidden & NOT_IN_LIMIT) && cmd->limited != -1) - return pstrcat(cmd->pool, cmd->cmd->name, gt, + return ap_pstrcat(cmd->pool, cmd->cmd->name, gt, " cannot occur within <Limit> section", NULL); if ((forbidden & NOT_IN_DIR_LOC_FILE) == NOT_IN_DIR_LOC_FILE && cmd->path != NULL) - return pstrcat(cmd->pool, cmd->cmd->name, gt, + return ap_pstrcat(cmd->pool, cmd->cmd->name, gt, " cannot occur within <Directory/Location/Files> section", NULL); if (((forbidden & NOT_IN_DIRECTORY) && (cmd->end_token == end_directory_section @@ -683,7 +683,7 @@ ((forbidden & NOT_IN_FILES) && (cmd->end_token == end_files_section || cmd->end_token == end_filesmatch_section))) - return pstrcat(cmd->pool, cmd->cmd->name, gt, + return ap_pstrcat(cmd->pool, cmd->cmd->name, gt, " cannot occur within <", cmd->end_token+2, " section", NULL); @@ -693,24 +693,24 @@ static const char *set_access_name (cmd_parms *cmd, void *dummy, char *arg) { void *sconf = cmd->server->module_config; - core_server_config *conf = get_module_config (sconf, &core_module); + core_server_config *conf = ap_get_module_config (sconf, &core_module); - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; - conf->access_name = pstrdup(cmd->pool, arg); + conf->access_name = ap_pstrdup(cmd->pool, arg); return NULL; } static const char *set_document_root (cmd_parms *cmd, void *dummy, char *arg) { void *sconf = cmd->server->module_config; - core_server_config *conf = get_module_config (sconf, &core_module); + core_server_config *conf = ap_get_module_config (sconf, &core_module); - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; - if (!is_directory (arg)) { + if (!ap_is_directory (arg)) { if (cmd->server->is_virtual) { fprintf (stderr, "Warning: DocumentRoot [%s] does not exist\n", arg); } @@ -719,7 +719,7 @@ } } - conf->document_root = arg; + conf->ap_document_root = arg; return NULL; } @@ -729,30 +729,30 @@ int error_number, index_number, idx500; char *w; - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; /* 1st parameter should be a 3 digit number, which we recognize; * convert it into an array index */ - w = getword_conf_nc (cmd->pool, &line); + w = ap_getword_conf_nc (cmd->pool, &line); error_number = atoi(w); - idx500 = index_of_response(HTTP_INTERNAL_SERVER_ERROR); + idx500 = ap_index_of_response(HTTP_INTERNAL_SERVER_ERROR); if (error_number == HTTP_INTERNAL_SERVER_ERROR) index_number = idx500; - else if ((index_number = index_of_response(error_number)) == idx500) - return pstrcat(cmd->pool, "Unsupported HTTP response code ", w, NULL); + else if ((index_number = ap_index_of_response(error_number)) == idx500) + return ap_pstrcat(cmd->pool, "Unsupported HTTP response code ", w, NULL); /* Store it... */ if( conf->response_code_strings == NULL ) { - conf->response_code_strings = pcalloc(cmd->pool, + conf->response_code_strings = ap_pcalloc(cmd->pool, sizeof(*conf->response_code_strings) * RESPONSE_CODES ); } - conf->response_code_strings[index_number] = pstrdup (cmd->pool, line); + conf->response_code_strings[index_number] = ap_pstrdup (cmd->pool, line); return NULL; } @@ -770,14 +770,14 @@ { char *w; - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) { return err; } d->override = OR_NONE; while(l[0]) { - w = getword_conf (cmd->pool, &l); + w = ap_getword_conf (cmd->pool, &l); if(!strcasecmp(w,"Limit")) d->override |= OR_LIMIT; else if(!strcasecmp(w,"Options")) @@ -793,7 +793,7 @@ else if(!strcasecmp(w,"All")) d->override = OR_ALL; else - return pstrcat (cmd->pool, "Illegal override option ", w, NULL); + return ap_pstrcat (cmd->pool, "Illegal override option ", w, NULL); d->override &= ~OR_UNSET; } @@ -807,7 +807,7 @@ char action; while(l[0]) { - char *w = getword_conf(cmd->pool, &l); + char *w = ap_getword_conf(cmd->pool, &l); action = '\0'; if (*w == '+' || *w == '-') @@ -838,7 +838,7 @@ else if(!strcasecmp(w,"All")) opt = OPT_ALL; else - return pstrcat (cmd->pool, "Illegal option ", w, NULL); + return ap_pstrcat (cmd->pool, "Illegal option ", w, NULL); /* we ensure the invariant (d->opts_add & d->opts_remove) == 0 */ if (action == '-') { @@ -874,21 +874,21 @@ { require_line *r; - if (!c->requires) - c->requires = make_array (cmd->pool, 2, sizeof(require_line)); + if (!c->ap_requires) + c->ap_requires = ap_make_array (cmd->pool, 2, sizeof(require_line)); - r = (require_line *)push_array (c->requires); - r->requirement = pstrdup (cmd->pool, arg); + r = (require_line *)ap_push_array (c->ap_requires); + r->requirement = ap_pstrdup (cmd->pool, arg); r->method_mask = cmd->limited; return NULL; } -CORE_EXPORT_NONSTD(const char *) limit_section (cmd_parms *cmd, void *dummy, const char *arg) +CORE_EXPORT_NONSTD(const char *) ap_limit_section (cmd_parms *cmd, void *dummy, const char *arg) { - const char *limited_methods = getword(cmd->pool,&arg,'>'); + const char *limited_methods = ap_getword(cmd->pool,&arg,'>'); int limited = 0; - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; /* XXX: NB: Currently, we have no way of checking @@ -897,7 +897,7 @@ */ while(limited_methods[0]) { - char *method = getword_conf (cmd->pool, &limited_methods); + char *method = ap_getword_conf (cmd->pool, &limited_methods); if(!strcasecmp(method,"GET")) limited |= (1 << M_GET); else if(!strcasecmp(method,"PUT")) limited |= (1 << M_PUT); else if(!strcasecmp(method,"POST")) limited |= (1 << M_POST); @@ -926,9 +926,9 @@ static const char *missing_endsection (cmd_parms *cmd, int nest) { if (nest < 2) - return psprintf(cmd->pool, "Missing %s directive at end-of-file", + return ap_psprintf(cmd->pool, "Missing %s directive at end-of-file", cmd->end_token); - return psprintf(cmd->pool, "%d missing %s directives at end-of-file", + return ap_psprintf(cmd->pool, "%d missing %s directives at end-of-file", nest, cmd->end_token); } @@ -945,11 +945,11 @@ static const char *end_nested_section(cmd_parms *cmd, void *dummy) { if (cmd->end_token == NULL) { - return pstrcat(cmd->pool, cmd->cmd->name, + return ap_pstrcat(cmd->pool, cmd->cmd->name, " without matching <", cmd->cmd->name + 2, " section", NULL); } if (cmd->cmd->name != cmd->end_token) { - return pstrcat(cmd->pool, "Expected ", cmd->end_token, " but saw ", + return ap_pstrcat(cmd->pool, "Expected ", cmd->end_token, " but saw ", cmd->cmd->name, NULL); } return cmd->end_token; @@ -962,17 +962,17 @@ int old_overrides = cmd->override; char *old_path = cmd->path; core_dir_config *conf; - void *new_dir_conf = create_per_dir_config (cmd->pool); + void *new_dir_conf = ap_create_per_dir_config (cmd->pool); regex_t *r = NULL; const char *old_end_token; const command_rec *thiscmd = cmd->cmd; - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; if (endp) *endp = '\0'; - cmd->path = getword_conf (cmd->pool, &arg); + cmd->path = ap_getword_conf (cmd->pool, &arg); #ifdef __EMX__ /* Fix OS/2 HPFS filename case problem. */ cmd->path = strlwr(cmd->path); @@ -980,20 +980,20 @@ cmd->override = OR_ALL|ACCESS_CONF; if (thiscmd->cmd_data) { /* <DirectoryMatch> */ - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); } else if (!strcmp(cmd->path, "~")) { - cmd->path = getword_conf (cmd->pool, &arg); - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); + cmd->path = ap_getword_conf (cmd->pool, &arg); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); } else { /* Ensure that the pathname is canonical */ - cmd->path = os_canonical_filename(cmd->pool, cmd->path); + cmd->path = ap_canonical_filename(cmd->pool, cmd->path); } old_end_token = cmd->end_token; cmd->end_token = thiscmd->cmd_data ? end_directorymatch_section : end_directory_section; - errmsg = srm_command_loop (cmd, new_dir_conf); + errmsg = ap_srm_command_loop (cmd, new_dir_conf); if (errmsg == NULL) { errmsg = missing_endsection(cmd, 1); } @@ -1001,13 +1001,13 @@ if (errmsg != (thiscmd->cmd_data ? end_directorymatch_section : end_directory_section)) return errmsg; - conf = (core_dir_config *)get_module_config(new_dir_conf, &core_module); + conf = (core_dir_config *)ap_get_module_config(new_dir_conf, &core_module); conf->r = r; - add_per_dir_conf (cmd->server, new_dir_conf); + ap_add_per_dir_conf (cmd->server, new_dir_conf); if (*arg != '\0') - return pstrcat (cmd->pool, "Multiple ", thiscmd->name, + return ap_pstrcat (cmd->pool, "Multiple ", thiscmd->name, "> arguments not (yet) supported.", NULL); cmd->path = old_path; @@ -1027,27 +1027,27 @@ const char *old_end_token; const command_rec *thiscmd = cmd->cmd; - void *new_url_conf = create_per_dir_config (cmd->pool); + void *new_url_conf = ap_create_per_dir_config (cmd->pool); - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; if (endp) *endp = '\0'; - cmd->path = getword_conf (cmd->pool, &arg); + cmd->path = ap_getword_conf (cmd->pool, &arg); cmd->override = OR_ALL|ACCESS_CONF; if (thiscmd->cmd_data) { /* <LocationMatch> */ - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED); } else if (!strcmp(cmd->path, "~")) { - cmd->path = getword_conf (cmd->pool, &arg); - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED); + cmd->path = ap_getword_conf (cmd->pool, &arg); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED); } old_end_token = cmd->end_token; cmd->end_token = thiscmd->cmd_data ? end_locationmatch_section : end_location_section; - errmsg = srm_command_loop (cmd, new_url_conf); + errmsg = ap_srm_command_loop (cmd, new_url_conf); if (errmsg == NULL) { errmsg = missing_endsection(cmd, 1); } @@ -1055,15 +1055,15 @@ if (errmsg != (thiscmd->cmd_data ? end_locationmatch_section : end_location_section)) return errmsg; - conf = (core_dir_config *)get_module_config(new_url_conf, &core_module); - conf->d = pstrdup(cmd->pool, cmd->path); /* No mangling, please */ - conf->d_is_fnmatch = is_fnmatch( conf->d ) != 0; + conf = (core_dir_config *)ap_get_module_config(new_url_conf, &core_module); + conf->d = ap_pstrdup(cmd->pool, cmd->path); /* No mangling, please */ + conf->d_is_fnmatch = ap_is_fnmatch( conf->d ) != 0; conf->r = r; - add_per_url_conf (cmd->server, new_url_conf); + ap_add_per_url_conf (cmd->server, new_url_conf); if (*arg != '\0') - return pstrcat (cmd->pool, "Multiple ", thiscmd->name, + return ap_pstrcat (cmd->pool, "Multiple ", thiscmd->name, "> arguments not (yet) supported.", NULL); cmd->path = old_path; @@ -1083,33 +1083,33 @@ const char *old_end_token; const command_rec *thiscmd = cmd->cmd; - void *new_file_conf = create_per_dir_config (cmd->pool); + void *new_file_conf = ap_create_per_dir_config (cmd->pool); - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT | NOT_IN_LOCATION); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT | NOT_IN_LOCATION); if (err != NULL) return err; if (endp) *endp = '\0'; - cmd->path = getword_conf (cmd->pool, &arg); + cmd->path = ap_getword_conf (cmd->pool, &arg); /* Only if not an .htaccess file */ if (!old_path) cmd->override = OR_ALL|ACCESS_CONF; if (thiscmd->cmd_data) { /* <FilesMatch> */ - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); } else if (!strcmp(cmd->path, "~")) { - cmd->path = getword_conf (cmd->pool, &arg); - r = pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); + cmd->path = ap_getword_conf (cmd->pool, &arg); + r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE); } else { /* Ensure that the pathname is canonical */ - cmd->path = os_canonical_filename(cmd->pool, cmd->path); + cmd->path = ap_canonical_filename(cmd->pool, cmd->path); } old_end_token = cmd->end_token; cmd->end_token = thiscmd->cmd_data ? end_filesmatch_section : end_files_section; - errmsg = srm_command_loop (cmd, new_file_conf); + errmsg = ap_srm_command_loop (cmd, new_file_conf); if (errmsg == NULL) { errmsg = missing_endsection(cmd, 1); } @@ -1117,15 +1117,15 @@ if (errmsg != (thiscmd->cmd_data ? end_filesmatch_section : end_files_section)) return errmsg; - conf = (core_dir_config *)get_module_config(new_file_conf, &core_module); + conf = (core_dir_config *)ap_get_module_config(new_file_conf, &core_module); conf->d = cmd->path; - conf->d_is_fnmatch = is_fnmatch(conf->d) != 0; + conf->d_is_fnmatch = ap_is_fnmatch(conf->d) != 0; conf->r = r; add_file_conf (c, new_file_conf); if (*arg != '\0') - return pstrcat (cmd->pool, "Multiple ", thiscmd->name, + return ap_pstrcat (cmd->pool, "Multiple ", thiscmd->name, "> arguments not (yet) supported.", NULL); cmd->path = old_path; @@ -1154,12 +1154,12 @@ if (endp) *endp = '\0'; if (not) arg++; - found = find_linked_module(arg); + found = ap_find_linked_module(arg); if ((!not && found) || (not && !found)) return NULL; - while (nest && !(cfg_getline (l, MAX_STRING_LEN, cmd->config_file))) { + while (nest && !(ap_cfg_getline (l, MAX_STRING_LEN, cmd->config_file))) { if (!strncasecmp(l, "<IfModule", 9)) nest++; if (!strcasecmp(l, "</IfModule>")) @@ -1183,7 +1183,7 @@ pool *p = cmd->pool, *ptemp = cmd->temp_pool; const char *old_end_token; - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; if (endp) *endp = '\0'; @@ -1196,7 +1196,7 @@ if (main_server->is_virtual) return "<VirtualHost> doesn't nest!"; - errmsg = init_virtual_host (p, arg, main_server, &s); + errmsg = ap_init_virtual_host (p, arg, main_server, &s); if (errmsg) return errmsg; @@ -1206,7 +1206,7 @@ old_end_token = cmd->end_token; cmd->end_token = end_virtualhost_section; cmd->server = s; - errmsg = srm_command_loop (cmd, s->lookup_defaults); + errmsg = ap_srm_command_loop (cmd, s->lookup_defaults); cmd->server = main_server; if (errmsg == NULL) { errmsg = missing_endsection(cmd, 1); @@ -1214,10 +1214,10 @@ cmd->end_token = old_end_token; if (s->srm_confname) - process_resource_config (s, s->srm_confname, p, ptemp); + ap_process_resource_config (s, s->srm_confname, p, ptemp); if (s->access_confname) - process_resource_config (s, s->access_confname, p, ptemp); + ap_process_resource_config (s, s->access_confname, p, ptemp); if (errmsg == end_virtualhost_section) return NULL; @@ -1229,11 +1229,11 @@ if (!cmd->server->names) return "ServerAlias only used in <VirtualHost>"; while (*arg) { - char **item, *name = getword_conf(cmd->pool, &arg); - if (is_matchexp(name)) - item = (char **) push_array(cmd->server->wild_names); + char **item, *name = ap_getword_conf(cmd->pool, &arg); + if (ap_is_matchexp(name)) + item = (char **) ap_push_array(cmd->server->wild_names); else - item = (char **) push_array(cmd->server->names); + item = (char **) ap_push_array(cmd->server->names); *item = name; } return NULL; @@ -1241,20 +1241,20 @@ static const char *add_module_command (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - if (add_named_module (arg)) + if (ap_add_named_module (arg)) return NULL; return "required module not found"; } static const char *clear_module_list_command (cmd_parms *cmd, void *dummy) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - clear_module_list (); + ap_clear_module_list (); return NULL; } @@ -1266,7 +1266,7 @@ int offset = (int)(long)cmd->info; char *struct_ptr = (char *)cmd->server; - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; *(char **)(struct_ptr + offset) = arg; @@ -1275,11 +1275,11 @@ static const char *server_type (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - if (!strcasecmp (arg, "inetd")) standalone = 0; - else if (!strcasecmp (arg, "standalone")) standalone = 1; + if (!strcasecmp (arg, "inetd")) ap_standalone = 0; + else if (!strcasecmp (arg, "standalone")) ap_standalone = 1; else return "ServerType must be either 'inetd' or 'standalone'"; return NULL; @@ -1287,14 +1287,14 @@ static const char *server_port (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); int port; if (err != NULL) return err; port = atoi(arg); if (port <= 0 || port >= 65536) /* 65536 == 1<<16 */ - return pstrcat(cmd->temp_pool, "The port number \"", arg, + return ap_pstrcat(cmd->temp_pool, "The port number \"", arg, "\" is outside the appropriate range (i.e. 1..65535).", NULL); cmd->server->port = port; @@ -1304,7 +1304,7 @@ static const char *set_signature_flag (cmd_parms *cmd, core_dir_config *d, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; if (strcasecmp(arg, "On") == 0) @@ -1321,7 +1321,7 @@ static const char *set_send_buffer_size (cmd_parms *cmd, void *dummy, char *arg) { int s = atoi (arg); - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; if (s < 512 && s != 0) { @@ -1333,18 +1333,18 @@ static const char *set_user (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; if (!cmd->server->is_virtual) { - user_name = arg; - cmd->server->server_uid = user_id = uname2id(arg); + ap_user_name = arg; + cmd->server->server_uid = ap_user_id = ap_uname2id(arg); } else { - if (suexec_enabled) - cmd->server->server_uid = uname2id(arg); + if (ap_suexec_enabled) + cmd->server->server_uid = ap_uname2id(arg); else { - cmd->server->server_uid = user_id; + cmd->server->server_uid = ap_user_id; fprintf(stderr, "Warning: User directive in <VirtualHost> " "requires SUEXEC wrapper.\n"); @@ -1369,16 +1369,16 @@ static const char *set_group (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; if (!cmd->server->is_virtual) - cmd->server->server_gid = group_id = gname2id(arg); + cmd->server->server_gid = ap_group_id = ap_gname2id(arg); else { - if (suexec_enabled) - cmd->server->server_gid = gname2id(arg); + if (ap_suexec_enabled) + cmd->server->server_gid = ap_gname2id(arg); else { - cmd->server->server_gid = group_id; + cmd->server->server_gid = ap_group_id; fprintf(stderr, "Warning: Group directive in <VirtualHost> requires SUEXEC wrapper.\n"); } @@ -1389,16 +1389,16 @@ static const char *set_server_root (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - if (!is_directory (arg)) return "ServerRoot must be a valid directory"; - ap_cpystrn (server_root, arg, sizeof(server_root)); + if (!ap_is_directory (arg)) return "ServerRoot must be a valid directory"; + ap_cpystrn (ap_server_root, arg, sizeof(ap_server_root)); return NULL; } static const char *set_timeout (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; cmd->server->timeout = atoi (arg); @@ -1408,7 +1408,7 @@ static const char *set_keep_alive_timeout (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; cmd->server->keep_alive_timeout = atoi (arg); @@ -1417,7 +1417,7 @@ static const char *set_keep_alive (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; /* We've changed it to On/Off, but used to use numbers @@ -1432,7 +1432,7 @@ static const char *set_keep_alive_max (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; cmd->server->keep_alive_max = atoi (arg); @@ -1441,36 +1441,36 @@ static const char *set_pidfile (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; if (cmd->server->is_virtual) return "PidFile directive not allowed in <VirtualHost>"; - pid_fname = arg; + ap_pid_fname = arg; return NULL; } static const char *set_scoreboard (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - scoreboard_fname = arg; + ap_scoreboard_fname = arg; return NULL; } static const char *set_lockfile (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - lock_fname = arg; + ap_lock_fname = arg; return NULL; } static const char *set_idcheck (cmd_parms *cmd, core_dir_config *d, int arg) { - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; d->do_rfc1413 = arg != 0; @@ -1480,7 +1480,7 @@ static const char *set_hostname_lookups (cmd_parms *cmd, core_dir_config *d, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; if (!strcasecmp (arg, "on")) { @@ -1497,7 +1497,7 @@ static const char *set_serverpath (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; cmd->server->path = arg; @@ -1507,7 +1507,7 @@ static const char *set_content_md5 (cmd_parms *cmd, core_dir_config *d, int arg) { - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; d->content_md5 = arg != 0; @@ -1517,7 +1517,7 @@ static const char *set_use_canonical_name (cmd_parms *cmd, core_dir_config *d, int arg) { - const char *err = check_cmd_context(cmd, NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_LIMIT); if (err != NULL) return err; @@ -1528,24 +1528,24 @@ static const char *set_daemons_to_start (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - daemons_to_start = atoi (arg); + ap_daemons_to_start = atoi (arg); return NULL; } static const char *set_min_free_servers (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - daemons_min_free = atoi (arg); - if (daemons_min_free <= 0) { + ap_daemons_min_free = atoi (arg); + if (ap_daemons_min_free <= 0) { fprintf(stderr, "WARNING: detected MinSpareServers set to non-positive.\n"); fprintf(stderr, "Resetting to 1 to avoid almost certain Apache failure.\n"); fprintf(stderr, "Please read the documentation.\n"); - daemons_min_free = 1; + ap_daemons_min_free = 1; } return NULL; @@ -1553,56 +1553,56 @@ static const char *set_max_free_servers (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - daemons_max_free = atoi (arg); + ap_daemons_max_free = atoi (arg); return NULL; } static const char *set_server_limit (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - daemons_limit = atoi (arg); - if (daemons_limit > HARD_SERVER_LIMIT) { + ap_daemons_limit = atoi (arg); + if (ap_daemons_limit > HARD_SERVER_LIMIT) { fprintf(stderr, "WARNING: MaxClients of %d exceeds compile time limit " - "of %d servers,\n", daemons_limit, HARD_SERVER_LIMIT); + "of %d servers,\n", ap_daemons_limit, HARD_SERVER_LIMIT); fprintf(stderr, " lowering MaxClients to %d. To increase, please " "see the\n", HARD_SERVER_LIMIT); fprintf(stderr, " HARD_SERVER_LIMIT define in src/httpd.h.\n"); - daemons_limit = HARD_SERVER_LIMIT; - } else if (daemons_limit < 1) { + ap_daemons_limit = HARD_SERVER_LIMIT; + } else if (ap_daemons_limit < 1) { fprintf (stderr, "WARNING: Require MaxClients > 0, setting to 1\n"); - daemons_limit = 1; + ap_daemons_limit = 1; } return NULL; } static const char *set_max_requests (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - max_requests_per_child = atoi (arg); + ap_max_requests_per_child = atoi (arg); return NULL; } static const char *set_threads (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - threads_per_child = atoi (arg); + ap_threads_per_child = atoi (arg); return NULL; } static const char *set_excess_requests (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - excess_requests_per_child = atoi (arg); + ap_excess_requests_per_child = atoi (arg); return NULL; } @@ -1617,16 +1617,16 @@ rlim_t cur = 0; rlim_t max = 0; - *plimit = (struct rlimit *)pcalloc(cmd->pool,sizeof **plimit); + *plimit = (struct rlimit *)ap_pcalloc(cmd->pool,sizeof **plimit); limit = *plimit; if ((getrlimit(type, limit)) != 0) { *plimit = NULL; - aplog_error(APLOG_MARK, APLOG_ERR, cmd->server, + ap_log_error(APLOG_MARK, APLOG_ERR, cmd->server, "%s: getrlimit failed", cmd->cmd->name); return; } - if ((str = getword_conf(cmd->pool, &arg))) { + if ((str = ap_getword_conf(cmd->pool, &arg))) { if (!strcasecmp(str, "max")) { cur = limit->rlim_max; } @@ -1635,19 +1635,19 @@ } } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, "Invalid parameters for %s", cmd->cmd->name); return; } - if (arg2 && (str = getword_conf(cmd->pool, &arg2))) + if (arg2 && (str = ap_getword_conf(cmd->pool, &arg2))) max = atol(str); /* if we aren't running as root, cannot increase max */ if (geteuid()) { limit->rlim_cur = cur; if (max) - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, "Must be uid 0 to raise maximum %s", cmd->cmd->name); } else { @@ -1663,7 +1663,7 @@ static const char *no_set_limit (cmd_parms *cmd, core_dir_config *conf, char *arg, char *arg2) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, cmd->server, "%s not supported on this platform", cmd->cmd->name); return NULL; } @@ -1704,10 +1704,10 @@ static const char *set_bind_address (cmd_parms *cmd, void *dummy, char *arg) { - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; - bind_address.s_addr = get_virthost_addr (arg, NULL); + ap_bind_address.s_addr = ap_get_virthost_addr (arg, NULL); return NULL; } @@ -1717,7 +1717,7 @@ char *ports; unsigned short port; - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; ports=strchr(ips, ':'); @@ -1730,20 +1730,20 @@ } else ports = ips; - new=pcalloc(cmd->pool, sizeof(listen_rec)); + new=ap_pcalloc(cmd->pool, sizeof(listen_rec)); new->local_addr.sin_family = AF_INET; if (ports == ips) /* no address */ new->local_addr.sin_addr.s_addr = htonl(INADDR_ANY); else - new->local_addr.sin_addr.s_addr = get_virthost_addr(ips, NULL); + new->local_addr.sin_addr.s_addr = ap_get_virthost_addr(ips, NULL); port=atoi(ports); if(!port) return "Port must be numeric"; new->local_addr.sin_port = htons(port); new->fd = -1; new->used = 0; - new->next = listeners; - listeners = new; + new->next = ap_listeners; + ap_listeners = new; return NULL; } @@ -1751,34 +1751,34 @@ { int b; - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; b = atoi (arg); if (b < 1) return "ListenBacklog must be > 0"; - listenbacklog = b; + ap_listenbacklog = b; return NULL; } static const char *set_coredumpdir (cmd_parms *cmd, void *dummy, char *arg) { struct stat finfo; - const char *err = check_cmd_context(cmd, GLOBAL_ONLY); + const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY); if (err != NULL) return err; if ((stat(arg, &finfo) == -1) || !S_ISDIR(finfo.st_mode)) { - return pstrcat(cmd->pool, "CoreDumpDirectory ", arg, + return ap_pstrcat(cmd->pool, "CoreDumpDirectory ", arg, " does not exist or is not a directory", NULL); } - ap_cpystrn(coredump_dir, arg, sizeof(coredump_dir)); + ap_cpystrn(ap_coredump_dir, arg, sizeof(ap_coredump_dir)); return NULL; } static const char *include_config (cmd_parms *cmd, void *dummy, char *name) { - name = server_root_relative(cmd->pool, name); + name = ap_server_root_relative(cmd->pool, name); - process_resource_config(cmd->server, name, cmd->pool, cmd->temp_pool); + ap_process_resource_config(cmd->server, name, cmd->pool, cmd->temp_pool); return NULL; } @@ -1787,10 +1787,10 @@ { char *str; - const char *err = check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); + const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT); if (err != NULL) return err; - if ((str = getword_conf(cmd->pool, &arg))) { + if ((str = ap_getword_conf(cmd->pool, &arg))) { if (!strcasecmp(str, "emerg")) cmd->server->loglevel = APLOG_EMERG; else if (!strcasecmp(str, "alert")) @@ -1816,11 +1816,11 @@ return NULL; } -API_EXPORT(const char *) psignature(const char *prefix, request_rec *r) +API_EXPORT(const char *) ap_psignature(const char *prefix, request_rec *r) { char sport[20]; core_dir_config *conf = - (core_dir_config *) get_module_config(r->per_dir_config, &core_module); + (core_dir_config *) ap_get_module_config(r->per_dir_config, &core_module); if (conf->server_signature == srv_sig_off) return ""; @@ -1828,12 +1828,12 @@ ap_snprintf(sport, sizeof sport, "%u", (unsigned) r->server->port); if (conf->server_signature == srv_sig_withmail) { - return pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION + return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION " Server at <A HREF=\"mailto:", r->server->server_admin, "\">", r->server->server_hostname, "</A> Port ", sport, "</ADDRESS>\n", NULL); } - return pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION + return ap_pstrcat(r->pool, prefix, "<ADDRESS>" SERVER_BASEVERSION " Server at ", r->server->server_hostname, "</A> Port ", sport, "</ADDRESS>\n", NULL); } @@ -1846,7 +1846,7 @@ { core_dir_config *aconfig = (core_dir_config *)mconfig; - aconfig->auth_name = ap_escape_quotes(cmd->pool, word1); + aconfig->ap_auth_name = ap_escape_quotes(cmd->pool, word1); return NULL; } @@ -1866,7 +1866,7 @@ { end_virtualhost_section, end_nested_section, NULL, RSRC_CONF, NO_ARGS, "Marks end of <VirtualHost>" }, { "<Files", filesection, NULL, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" }, { end_files_section, end_nested_section, NULL, OR_ALL, NO_ARGS, "Marks end of <Files>" }, -{ "<Limit", limit_section, NULL, OR_ALL, RAW_ARGS, "Container for authentication directives when accessed using specified HTTP methods" }, +{ "<Limit", ap_limit_section, NULL, OR_ALL, RAW_ARGS, "Container for authentication directives when accessed using specified HTTP methods" }, { "</Limit>", endlimit_section, NULL, OR_ALL, NO_ARGS, "Marks end of <Limit>" }, { "<IfModule", start_ifmod, NULL, OR_ALL, RAW_ARGS, "Container for directives based on existance of specified modules" }, { end_ifmodule_section, end_ifmod, NULL, OR_ALL, NO_ARGS, "Marks end of <IfModule>" }, @@ -1876,7 +1876,7 @@ { end_locationmatch_section, end_nested_section, NULL, ACCESS_CONF, NO_ARGS, "Marks end of <LocationMatch>" }, { "<FilesMatch", filesection, (void*)1, OR_ALL, RAW_ARGS, "Container for directives affecting files matching specified patterns" }, { end_filesmatch_section, end_nested_section, NULL, OR_ALL, NO_ARGS, "Marks end of <FilesMatch>" }, -{ "AuthType", set_string_slot, (void*)XtOffsetOf(core_dir_config, auth_type), +{ "AuthType", ap_set_string_slot, (void*)XtOffsetOf(core_dir_config, ap_auth_type), OR_AUTHCFG, TAKE1, "An HTTP authorization type (e.g., \"Basic\")" }, { "AuthName", set_authname, NULL, OR_AUTHCFG, TAKE1, "The authentication realm (e.g. \"Members Only\")" }, @@ -1891,8 +1891,8 @@ { "ErrorDocument", set_error_document, NULL, OR_FILEINFO, RAW_ARGS, "Change responses for HTTP errors" }, { "AllowOverride", set_override, NULL, ACCESS_CONF, RAW_ARGS, "Controls what groups of directives can be configured by per-directory config files" }, { "Options", set_options, NULL, OR_OPTIONS, RAW_ARGS, "Set a number of attributes for a given directory" }, -{ "DefaultType", set_string_slot, - (void*)XtOffsetOf (core_dir_config, default_type), +{ "DefaultType", ap_set_string_slot, + (void*)XtOffsetOf (core_dir_config, ap_default_type), OR_FILEINFO, TAKE1, "the default MIME type for untypable files" }, /* Old server config file commands */ @@ -1979,7 +1979,7 @@ { "CoreDumpDirectory", set_coredumpdir, NULL, RSRC_CONF, TAKE1, "The location of the directory Apache changes to before dumping core" }, { "Include", include_config, NULL, RSRC_CONF, TAKE1, "config file to be included" }, { "LogLevel", set_loglevel, NULL, RSRC_CONF, TAKE1, "set level of verbosity in error logging" }, -{ "NameVirtualHost", set_name_virtual_host, NULL, RSRC_CONF, TAKE1, +{ "NameVirtualHost", ap_set_name_virtual_host, NULL, RSRC_CONF, TAKE1, "a numeric ip address:port, or the name of a host" }, { NULL }, }; @@ -1992,11 +1992,11 @@ static int core_translate (request_rec *r) { void *sconf = r->server->module_config; - core_server_config *conf = get_module_config (sconf, &core_module); + core_server_config *conf = ap_get_module_config (sconf, &core_module); if (r->proxyreq) return HTTP_FORBIDDEN; if ((r->uri[0] != '/') && strcmp(r->uri, "*")) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid URI in request %s", r->the_request); return BAD_REQUEST; } @@ -2006,10 +2006,10 @@ (r->server->path[r->server->pathlen - 1] == '/' || r->uri[r->server->pathlen] == '/' || r->uri[r->server->pathlen] == '\0')) - r->filename = pstrcat (r->pool, conf->document_root, + r->filename = ap_pstrcat (r->pool, conf->ap_document_root, (r->uri + r->server->pathlen), NULL); else - r->filename = pstrcat (r->pool, conf->document_root, r->uri, NULL); + r->filename = ap_pstrcat (r->pool, conf->ap_document_root, r->uri, NULL); return OK; } @@ -2041,7 +2041,7 @@ static int default_handler (request_rec *r) { core_dir_config *d = - (core_dir_config *)get_module_config(r->per_dir_config, &core_module); + (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); int rangestatus, errstatus; FILE *f; #ifdef USE_MMAP_FILES @@ -2051,23 +2051,23 @@ /* This handler has no use for a request body (yet), but we still * need to read and discard it if the client sent one. */ - if ((errstatus = discard_request_body(r)) != OK) + if ((errstatus = ap_discard_request_body(r)) != OK) return errstatus; r->allowed |= (1 << M_GET) | (1 << M_OPTIONS); if (r->method_number == M_INVALID) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid method in request %s", r->the_request); return NOT_IMPLEMENTED; } - if (r->method_number == M_OPTIONS) return send_http_options(r); + if (r->method_number == M_OPTIONS) return ap_send_http_options(r); if (r->method_number == M_PUT) return METHOD_NOT_ALLOWED; if (r->finfo.st_mode == 0 || (r->path_info && *r->path_info)) { - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, "File does not exist: %s", r->path_info ? - pstrcat(r->pool, r->filename, r->path_info, NULL) + ap_pstrcat(r->pool, r->filename, r->path_info, NULL) : r->filename); return NOT_FOUND; } @@ -2075,27 +2075,27 @@ #if defined(__EMX__) || defined(WIN32) /* Need binary mode for OS/2 */ - f = pfopen (r->pool, r->filename, "rb"); + f = ap_pfopen (r->pool, r->filename, "rb"); #else - f = pfopen (r->pool, r->filename, "r"); + f = ap_pfopen (r->pool, r->filename, "r"); #endif if (f == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "file permissions deny server access: %s", r->filename); return FORBIDDEN; } - update_mtime (r, r->finfo.st_mtime); - set_last_modified(r); - set_etag(r); - if (((errstatus = meets_conditions(r)) != OK) - || (errstatus = set_content_length (r, r->finfo.st_size))) { + ap_update_mtime (r, r->finfo.st_mtime); + ap_set_last_modified(r); + ap_set_etag(r); + if (((errstatus = ap_meets_conditions(r)) != OK) + || (errstatus = ap_set_content_length (r, r->finfo.st_size))) { return errstatus; } #ifdef USE_MMAP_FILES - block_alarms(); + ap_block_alarms(); if ((r->finfo.st_size >= MMAP_THRESHOLD) && ( !r->header_only || (d->content_md5 & 1))) { /* we need to protect ourselves in case we die while we've got the @@ -2103,7 +2103,7 @@ mm = mmap (NULL, r->finfo.st_size, PROT_READ, MAP_PRIVATE, fileno(f), 0); if (mm == (caddr_t)-1) { - aplog_error(APLOG_MARK, APLOG_CRIT, r->server, + ap_log_error(APLOG_MARK, APLOG_CRIT, r->server, "default_handler: mmap failed: %s", r->filename); } } else { @@ -2111,14 +2111,14 @@ } if (mm == (caddr_t)-1) { - unblock_alarms(); + ap_unblock_alarms(); #endif if (d->content_md5 & 1) { - table_setn(r->headers_out, "Content-MD5", ap_md5digest(r->pool, f)); + ap_table_setn(r->headers_out, "Content-MD5", ap_md5digest(r->pool, f)); } - rangestatus = set_byterange(r); + rangestatus = ap_set_byterange(r); #ifdef CHARSET_EBCDIC /* To make serving of "raw ASCII text" files easy (they serve faster * since they don't have to be converted from EBCDIC), a new @@ -2130,16 +2130,16 @@ os_checkconv(r); #endif /*CHARSET_EBCDIC*/ - send_http_header (r); + ap_send_http_header (r); if (!r->header_only) { if (!rangestatus) - send_fd (f, r); + ap_send_fd (f, r); else { long offset, length; - while (each_byterange(r, &offset, &length)) { + while (ap_each_byterange(r, &offset, &length)) { fseek(f, offset, SEEK_SET); - send_fd_length(f, r, length); + ap_send_fd_length(f, r, length); } } } @@ -2148,38 +2148,38 @@ } else { struct mmap *mmd; - mmd = palloc (r->pool, sizeof (*mmd)); + mmd = ap_palloc (r->pool, sizeof (*mmd)); mmd->mm = mm; mmd->length = r->finfo.st_size; - register_cleanup (r->pool, (void *)mmd, mmap_cleanup, mmap_cleanup); - unblock_alarms(); + ap_register_cleanup (r->pool, (void *)mmd, mmap_cleanup, mmap_cleanup); + ap_unblock_alarms(); if (d->content_md5 & 1) { AP_MD5_CTX context; - MD5Init(&context); - MD5Update(&context, (void *)mm, r->finfo.st_size); - table_setn(r->headers_out, "Content-MD5", + ap_MD5Init(&context); + ap_MD5Update(&context, (void *)mm, r->finfo.st_size); + ap_table_setn(r->headers_out, "Content-MD5", ap_md5contextTo64(r->pool, &context)); } - rangestatus = set_byterange(r); - send_http_header (r); + rangestatus = ap_set_byterange(r); + ap_send_http_header (r); if (!r->header_only) { if (!rangestatus) - send_mmap (mm, r, 0, r->finfo.st_size); + ap_send_mmap (mm, r, 0, r->finfo.st_size); else { long offset, length; - while (each_byterange(r, &offset, &length)) { - send_mmap(mm, r, offset, length); + while (ap_each_byterange(r, &offset, &length)) { + ap_send_mmap(mm, r, offset, length); } } } } #endif - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return OK; } 1.51 +50 -50 apache-1.3/src/main/http_log.c Index: http_log.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_log.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- http_log.c 1998/03/31 12:52:43 1.50 +++ http_log.c 1998/04/11 12:00:29 1.51 @@ -162,7 +162,7 @@ */ int child_pid = 0; - cleanup_for_exec(); + ap_cleanup_for_exec(); #ifdef SIGHUP /* No concept of a child process on Win32 */ signal (SIGHUP, SIG_IGN); @@ -218,8 +218,8 @@ } #endif else { - fname = server_root_relative (p, s->error_fname); - if(!(s->error_log = pfopen(p, fname, "a"))) { + fname = ap_server_root_relative (p, s->error_fname); + if(!(s->error_log = ap_pfopen(p, fname, "a"))) { perror("fopen"); fprintf(stderr,"httpd: could not open error log file %s.\n", fname); exit(1); @@ -227,7 +227,7 @@ } } -void open_logs (server_rec *s_main, pool *p) +void ap_open_logs (server_rec *s_main, pool *p) { server_rec *virt, *q; int replace_stderr; @@ -239,7 +239,7 @@ /* replace stderr with this new log */ fflush(stderr); if (dup2(fileno(s_main->error_log), 2) == -1) { - aplog_error(APLOG_MARK, APLOG_CRIT, s_main, + ap_log_error(APLOG_MARK, APLOG_CRIT, s_main, "unable to replace stderr with error_log"); } else { replace_stderr = 0; @@ -250,7 +250,7 @@ * of the submitter. */ if (replace_stderr && freopen("/dev/null", "w", stderr) == NULL) { - aplog_error(APLOG_MARK, APLOG_CRIT, s_main, + ap_log_error(APLOG_MARK, APLOG_CRIT, s_main, "unable to replace stderr with /dev/null"); } @@ -269,12 +269,12 @@ } } -API_EXPORT(void) error_log2stderr (server_rec *s) { +API_EXPORT(void) ap_error_log2stderr (server_rec *s) { if(fileno(s->error_log) != STDERR_FILENO) dup2(fileno(s->error_log),STDERR_FILENO); } -API_EXPORT(void) aplog_error (const char *file, int line, int level, +API_EXPORT(void) ap_log_error (const char *file, int line, int level, const server_rec *s, const char *fmt, ...) { va_list args; @@ -307,7 +307,7 @@ } if (logf) { - len = ap_snprintf(errstr, sizeof(errstr), "[%s] ", get_time()); + len = ap_snprintf(errstr, sizeof(errstr), "[%s] ", ap_get_time()); } else { len = 0; } @@ -389,56 +389,56 @@ } -void log_pid (pool *p, char *pid_fname) +void ap_log_pid (pool *p, char *ap_pid_fname) { FILE *pid_file; - if (!pid_fname) return; - pid_fname = server_root_relative (p, pid_fname); - if(!(pid_file = fopen(pid_fname,"w"))) { + if (!ap_pid_fname) return; + ap_pid_fname = ap_server_root_relative (p, ap_pid_fname); + if(!(pid_file = fopen(ap_pid_fname,"w"))) { perror("fopen"); - fprintf(stderr,"httpd: could not log pid to file %s\n", pid_fname); + fprintf(stderr,"httpd: could not log pid to file %s\n", ap_pid_fname); exit(1); } fprintf(pid_file,"%ld\n",(long)getpid()); fclose(pid_file); } -API_EXPORT(void) log_error (const char *err, server_rec *s) +API_EXPORT(void) ap_log_error_old (const char *err, server_rec *s) { - aplog_error(APLOG_MARK, APLOG_ERR, s, err); + ap_log_error(APLOG_MARK, APLOG_ERR, s, err); } -API_EXPORT(void) log_unixerr (const char *routine, const char *file, +API_EXPORT(void) ap_log_unixerr (const char *routine, const char *file, const char *msg, server_rec *s) { - aplog_error(file, 0, APLOG_ERR, s, msg); + ap_log_error(file, 0, APLOG_ERR, s, msg); } -API_EXPORT(void) log_printf (const server_rec *s, const char *fmt, ...) +API_EXPORT(void) ap_log_printf (const server_rec *s, const char *fmt, ...) { char buf[MAX_STRING_LEN]; va_list args; va_start(args, fmt); ap_vsnprintf(buf, sizeof(buf), fmt, args); - aplog_error(APLOG_MARK, APLOG_ERR, s, buf); + ap_log_error(APLOG_MARK, APLOG_ERR, s, buf); va_end(args); } -API_EXPORT(void) log_reason (const char *reason, const char *file, request_rec *r) +API_EXPORT(void) ap_log_reason (const char *reason, const char *file, request_rec *r) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "access to %s failed for %s, reason: %s", file, - get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME), + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME), reason); } -API_EXPORT(void) log_assert (const char *szExp, const char *szFile, int nLine) +API_EXPORT(void) ap_log_assert (const char *szExp, const char *szFile, int nLine) { fprintf(stderr, "[%s] file %s, line %d, assertion \"%s\" failed\n", - get_time(), szFile, nLine, szExp); + ap_get_time(), szFile, nLine, szExp); #ifndef WIN32 /* unix assert does an abort leading to a core dump */ abort(); @@ -457,7 +457,7 @@ { int pid; - block_alarms(); + ap_block_alarms(); pid = fork(); if (pid == 0) { /* XXX: this needs porting to OS2 and WIN32 */ @@ -469,7 +469,7 @@ close (STDIN_FILENO); dup2 (pl->fds[0], STDIN_FILENO); - cleanup_for_exec (); + ap_cleanup_for_exec (); signal (SIGCHLD, SIG_DFL); /* for HPUX */ signal (SIGHUP, SIG_IGN); execl (SHELL_PATH, SHELL_PATH, "-c", pl->program, NULL); @@ -481,12 +481,12 @@ if (pid == -1) { fprintf (stderr, "piped_log_spawn: unable to fork(): %s\n", strerror (errno)); - unblock_alarms (); + ap_unblock_alarms (); return -1; } - unblock_alarms(); + ap_unblock_alarms(); pl->pid = pid; - register_other_child (pid, piped_log_maintenance, pl, pl->fds[1]); + ap_register_other_child (pid, piped_log_maintenance, pl, pl->fds[1]); return 0; } @@ -499,7 +499,7 @@ case OC_REASON_DEATH: case OC_REASON_LOST: pl->pid = -1; - unregister_other_child (pl); + ap_unregister_other_child (pl); if (pl->program == NULL) { /* during a restart */ break; @@ -539,7 +539,7 @@ if (pl->pid != -1) { kill (pl->pid, SIGTERM); } - unregister_other_child (pl); + ap_unregister_other_child (pl); close (pl->fds[0]); close (pl->fds[1]); } @@ -554,41 +554,41 @@ } -API_EXPORT(piped_log *) open_piped_log (pool *p, const char *program) +API_EXPORT(piped_log *) ap_open_piped_log (pool *p, const char *program) { piped_log *pl; - pl = palloc (p, sizeof (*pl)); + pl = ap_palloc (p, sizeof (*pl)); pl->p = p; - pl->program = pstrdup (p, program); + pl->program = ap_pstrdup (p, program); pl->pid = -1; - block_alarms (); + ap_block_alarms (); if (pipe (pl->fds) == -1) { int save_errno = errno; - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; return NULL; } - register_cleanup (p, pl, piped_log_cleanup, piped_log_cleanup_for_exec); + ap_register_cleanup (p, pl, piped_log_cleanup, piped_log_cleanup_for_exec); if (piped_log_spawn (pl) == -1) { int save_errno = errno; - kill_cleanup (p, pl, piped_log_cleanup); + ap_kill_cleanup (p, pl, piped_log_cleanup); close (pl->fds[0]); close (pl->fds[1]); - unblock_alarms (); + ap_unblock_alarms (); errno = save_errno; return NULL; } - unblock_alarms (); + ap_unblock_alarms (); return pl; } -API_EXPORT(void) close_piped_log (piped_log *pl) +API_EXPORT(void) ap_close_piped_log (piped_log *pl) { - block_alarms (); + ap_block_alarms (); piped_log_cleanup (pl); - kill_cleanup (pl->p, pl, piped_log_cleanup); - unblock_alarms (); + ap_kill_cleanup (pl->p, pl, piped_log_cleanup); + ap_unblock_alarms (); } #else @@ -600,7 +600,7 @@ */ int child_pid = 1; - cleanup_for_exec(); + ap_cleanup_for_exec(); #ifdef SIGHUP signal (SIGHUP, SIG_IGN); #endif @@ -619,7 +619,7 @@ } -API_EXPORT(piped_log *) open_piped_log (pool *p, const char *program) +API_EXPORT(piped_log *) ap_open_piped_log (pool *p, const char *program) { piped_log *pl; FILE *dummy; @@ -630,15 +630,15 @@ fprintf (stderr, "Couldn't fork child for piped log process\n"); exit (1); } - pl = palloc (p, sizeof (*pl)); + pl = ap_palloc (p, sizeof (*pl)); pl->p = p; pl->write_f = dummy; return pl; } -API_EXPORT(void) close_piped_log (piped_log *pl) +API_EXPORT(void) ap_close_piped_log (piped_log *pl) { - pfclose (pl->p, pl->write_f); + ap_pfclose (pl->p, pl->write_f); } #endif 1.324 +491 -491 apache-1.3/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_main.c,v retrieving revision 1.323 retrieving revision 1.324 diff -u -r1.323 -r1.324 --- http_main.c 1998/04/10 10:34:35 1.323 +++ http_main.c 1998/04/11 12:00:29 1.324 @@ -138,11 +138,11 @@ # ifdef _DEBUG # ifndef DEBUG_TO_CONSOLE -# define APD1(a) aplog_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a) -# define APD2(a,b) aplog_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b) -# define APD3(a,b,c) aplog_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c) -# define APD4(a,b,c,d) aplog_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c,d) -# define APD5(a,b,c,d,e) aplog_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c,d,e) +# define APD1(a) ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a) +# define APD2(a,b) ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b) +# define APD3(a,b,c) ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c) +# define APD4(a,b,c,d) ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c,d) +# define APD5(a,b,c,d,e) ap_log_error(APLOG_MARK,APLOG_DEBUG|APLOG_NOERRNO,server_conf,a,b,c,d,e) # else # define APD1(a) printf("%s\n",a) # define APD2(a,b) do { printf(a,b);putchar('\n'); } while(0); @@ -165,9 +165,9 @@ * main/util_script.c would not be linked into a minimal httpd. * And the extra prototype is to make gcc -Wmissing-prototypes quiet. */ -extern void force_library_loading(void); -void force_library_loading(void) { - add_cgi_vars(NULL); +extern void ap_force_library_loading(void); +void ap_force_library_loading(void) { + ap_add_cgi_vars(NULL); } #include "explain.h" @@ -214,7 +214,7 @@ #ifndef MULTITHREAD /* this just need to be anything non-NULL */ -void *dummy_mutex = &dummy_mutex; +void *ap_dummy_mutex = &ap_dummy_mutex; #endif /* @@ -222,28 +222,28 @@ * for the most part the only code that acts on 'em. (Hmmm... mod_main.c?) */ -int standalone; -uid_t user_id; -char *user_name; -gid_t group_id; +int ap_standalone; +uid_t ap_user_id; +char *ap_user_name; +gid_t ap_group_id; #ifdef MULTIPLE_GROUPS gid_t group_id_list[NGROUPS_MAX]; #endif -int max_requests_per_child; -int threads_per_child; -int excess_requests_per_child; -char *pid_fname; -char *scoreboard_fname; -char *lock_fname; -char *server_argv0; -struct in_addr bind_address; -int daemons_to_start; -int daemons_min_free; -int daemons_max_free; -int daemons_limit; -time_t restart_time; -int suexec_enabled = 0; -int listenbacklog; +int ap_max_requests_per_child; +int ap_threads_per_child; +int ap_excess_requests_per_child; +char *ap_pid_fname; +char *ap_scoreboard_fname; +char *ap_lock_fname; +char *ap_server_argv0; +struct in_addr ap_bind_address; +int ap_daemons_to_start; +int ap_daemons_min_free; +int ap_daemons_max_free; +int ap_daemons_limit; +time_t ap_restart_time; +int ap_suexec_enabled = 0; +int ap_listenbacklog; /* * The max child slot ever assigned, preserved across restarts. Necessary @@ -269,15 +269,15 @@ * * Note that listeners != NULL is ensured by read_config(). */ -listen_rec *listeners; +listen_rec *ap_listeners; static listen_rec *head_listener; -API_VAR_EXPORT char server_root[MAX_STRING_LEN]; -char server_confname[MAX_STRING_LEN]; -char coredump_dir[MAX_STRING_LEN]; +API_VAR_EXPORT char ap_server_root[MAX_STRING_LEN]; +char ap_server_confname[MAX_STRING_LEN]; +char ap_coredump_dir[MAX_STRING_LEN]; -array_header *server_pre_read_config; -array_header *server_post_read_config; +array_header *ap_server_pre_read_config; +array_header *ap_server_post_read_config; /* *Non*-shared http_main globals... */ @@ -333,7 +333,7 @@ static int my_child_num; #endif -scoreboard *scoreboard_image = NULL; +scoreboard *ap_scoreboard_image = NULL; static APACHE_TLS int volatile exit_after_unblock = 0; @@ -341,8 +341,8 @@ static void __attribute__((noreturn)) clean_child_exit(int code) { if (pchild) { - child_exit_modules(pchild, server_conf); - destroy_pool(pchild); + ap_child_exit_modules(pchild, server_conf); + ap_destroy_pool(pchild); } exit(code); } @@ -351,8 +351,8 @@ static void expand_lock_fname(pool *p) { /* XXXX possibly bogus cast */ - lock_fname = psprintf(p, "%s.%lu", - server_root_relative(p, lock_fname), (unsigned long)getpid()); + ap_lock_fname = ap_psprintf(p, "%s.%lu", + ap_server_root_relative(p, ap_lock_fname), (unsigned long)getpid()); } #endif @@ -443,7 +443,7 @@ static void accept_mutex_child_init(pool *p) { - register_cleanup(p, NULL, accept_mutex_child_cleanup, null_cleanup); + ap_register_cleanup(p, NULL, accept_mutex_child_cleanup, ap_null_cleanup); } static void accept_mutex_cleanup(void *foo) @@ -489,7 +489,7 @@ sigdelset(&accept_block_mask, SIGHUP); sigdelset(&accept_block_mask, SIGTERM); sigdelset(&accept_block_mask, SIGUSR1); - register_cleanup(p, NULL, accept_mutex_cleanup, null_cleanup); + ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup); } static void accept_mutex_on() @@ -594,8 +594,8 @@ /* restrict it to use only by the appropriate user_id ... not that this * stops CGIs from acquiring it and dinking around with it. */ - buf.sem_perm.uid = user_id; - buf.sem_perm.gid = group_id; + buf.sem_perm.uid = ap_user_id; + buf.sem_perm.gid = ap_group_id; buf.sem_perm.mode = 0600; ick.buf = &buf; if (semctl(sem_id, 0, IPC_SET, ick) < 0) { @@ -603,7 +603,7 @@ exit(1); } } - register_cleanup(p, NULL, accept_mutex_cleanup, null_cleanup); + ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup); /* pre-initialize these */ op_on.sem_num = 0; @@ -657,13 +657,13 @@ unlock_it.l_pid = 0; /* pid not actually interesting */ expand_lock_fname(p); - lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644); + lock_fd = ap_popenf(p, ap_lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0644); if (lock_fd == -1) { perror("open"); - fprintf(stderr, "Cannot open lock file: %s\n", lock_fname); + fprintf(stderr, "Cannot open lock file: %s\n", ap_lock_fname); exit(1); } - unlink(lock_fname); + unlink(ap_lock_fname); } static void accept_mutex_on(void) @@ -675,7 +675,7 @@ } if (ret < 0) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "fcntl: F_SETLKW: Error getting accept lock, exiting! " "Perhaps you need to use the LockFile directive to place " "your lock file on a local disk!"); @@ -691,7 +691,7 @@ /* nop */ } if (ret < 0) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "fcntl: F_SETLKW: Error freeing accept lock, exiting! " "Perhaps you need to use the LockFile directive to place " "your lock file on a local disk!"); @@ -705,7 +705,7 @@ static void accept_mutex_cleanup(void *foo) { - unlink(lock_fname); + unlink(ap_lock_fname); } /* @@ -715,10 +715,10 @@ static void accept_mutex_child_init(pool *p) { - lock_fd = popenf(p, lock_fname, O_WRONLY, 0600); + lock_fd = ap_popenf(p, ap_lock_fname, O_WRONLY, 0600); if (lock_fd == -1) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, - "Child cannot open lock file: %s\n", lock_fname); + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, + "Child cannot open lock file: %s\n", ap_lock_fname); clean_child_exit(1); } } @@ -730,14 +730,14 @@ static void accept_mutex_init(pool *p) { expand_lock_fname(p); - unlink(lock_fname); - lock_fd = popenf(p, lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600); + unlink(ap_lock_fname); + lock_fd = ap_popenf(p, ap_lock_fname, O_CREAT | O_WRONLY | O_EXCL, 0600); if (lock_fd == -1) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, - "Parent cannot open lock file: %s\n", lock_fname); + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, + "Parent cannot open lock file: %s\n", ap_lock_fname); exit(1); } - register_cleanup(p, NULL, accept_mutex_cleanup, null_cleanup); + ap_register_cleanup(p, NULL, accept_mutex_cleanup, ap_null_cleanup); } static void accept_mutex_on(void) @@ -748,7 +748,7 @@ continue; if (ret < 0) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "flock: LOCK_EX: Error getting accept lock. Exiting!"); clean_child_exit(1); } @@ -757,7 +757,7 @@ static void accept_mutex_off(void) { if (flock(lock_fd, LOCK_UN) < 0) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "flock: LOCK_UN: Error freeing accept lock. Exiting!"); clean_child_exit(1); } @@ -784,7 +784,7 @@ * when it's safe in the single Listen case. */ #ifdef SINGLE_LISTEN_UNSERIALIZED_ACCEPT -#define SAFE_ACCEPT(stmt) do {if(listeners->next != listeners) {stmt;}} while(0) +#define SAFE_ACCEPT(stmt) do {if(ap_listeners->next != ap_listeners) {stmt;}} while(0) #else #define SAFE_ACCEPT(stmt) do {stmt;} while(0) #endif @@ -855,18 +855,18 @@ dirconf = current_conn->server->lookup_defaults; if (!current_conn->keptalive) { if (sig == SIGPIPE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, current_conn->server, "%s client stopped connection before %s completed", - get_remote_host(current_conn, dirconf, REMOTE_NAME), + ap_get_remote_host(current_conn, dirconf, REMOTE_NAME), timeout_name ? timeout_name : "request"); } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, current_conn->server, "%s timed out for %s", timeout_name ? timeout_name : "request", - get_remote_host(current_conn, dirconf, REMOTE_NAME)); + ap_get_remote_host(current_conn, dirconf, REMOTE_NAME)); } } @@ -886,18 +886,18 @@ } if (!current_conn->keptalive) - log_transaction(log_req); + ap_log_transaction(log_req); - bsetflag(timeout_req->connection->client, B_EOUT, 1); - bclose(timeout_req->connection->client); + ap_bsetflag(timeout_req->connection->client, B_EOUT, 1); + ap_bclose(timeout_req->connection->client); - if (!standalone) + if (!ap_standalone) exit(0); ap_longjmp(jmpbuffer, 1); } else { /* abort the connection */ - bsetflag(current_conn->client, B_EOUT, 1); + ap_bsetflag(current_conn->client, B_EOUT, 1); current_conn->aborted = 1; } } @@ -908,12 +908,12 @@ * which is itself being cleared); we have to support that here. */ -API_EXPORT(void) block_alarms() +API_EXPORT(void) ap_block_alarms() { ++alarms_blocked; } -API_EXPORT(void) unblock_alarms() +API_EXPORT(void) ap_unblock_alarms() { --alarms_blocked; if (alarms_blocked == 0) { @@ -951,7 +951,7 @@ } #endif -unsigned int set_callback_and_alarm(void (*fn) (int), int x) +unsigned int ap_set_callback_and_alarm(void (*fn) (int), int x) { unsigned int old; @@ -981,9 +981,9 @@ /* Just note the timeout in our scoreboard, no need to call the system. * We also note that the virtual time has gone forward. */ - old = scoreboard_image->servers[my_child_num].timeout_len; - scoreboard_image->servers[my_child_num].timeout_len = x; - ++scoreboard_image->servers[my_child_num].cur_vtime; + old = ap_scoreboard_image->servers[my_child_num].timeout_len; + ap_scoreboard_image->servers[my_child_num].timeout_len = x; + ++ap_scoreboard_image->servers[my_child_num].cur_vtime; } #endif #endif @@ -992,7 +992,7 @@ #ifdef WIN32 -API_EXPORT(int) check_alarm(void) +API_EXPORT(int) ap_check_alarm(void) { if (alarm_expiry_time) { unsigned int t; @@ -1018,21 +1018,21 @@ * as long as it hasn't expired already. */ -API_EXPORT(void) reset_timeout(request_rec *r) +API_EXPORT(void) ap_reset_timeout(request_rec *r) { int i; if (timeout_name) { /* timeout has been set */ - i = set_callback_and_alarm(alarm_fn, r->server->timeout); + i = ap_set_callback_and_alarm(alarm_fn, r->server->timeout); if (i == 0) /* timeout already expired, so set it back to 0 */ - set_callback_and_alarm(alarm_fn, 0); + ap_set_callback_and_alarm(alarm_fn, 0); } } -void keepalive_timeout(char *name, request_rec *r) +void ap_keepalive_timeout(char *name, request_rec *r) { unsigned int to; @@ -1043,30 +1043,30 @@ to = r->server->keep_alive_timeout; else to = r->server->timeout; - set_callback_and_alarm(timeout, to); + ap_set_callback_and_alarm(timeout, to); } -API_EXPORT(void) hard_timeout(char *name, request_rec *r) +API_EXPORT(void) ap_hard_timeout(char *name, request_rec *r) { timeout_req = r; timeout_name = name; - set_callback_and_alarm(timeout, r->server->timeout); + ap_set_callback_and_alarm(timeout, r->server->timeout); } -API_EXPORT(void) soft_timeout(char *name, request_rec *r) +API_EXPORT(void) ap_soft_timeout(char *name, request_rec *r) { timeout_name = name; - set_callback_and_alarm(timeout, r->server->timeout); + ap_set_callback_and_alarm(timeout, r->server->timeout); } -API_EXPORT(void) kill_timeout(request_rec *dummy) +API_EXPORT(void) ap_kill_timeout(request_rec *dummy) { - set_callback_and_alarm(NULL, 0); + ap_set_callback_and_alarm(NULL, 0); timeout_req = NULL; timeout_name = NULL; } @@ -1108,7 +1108,7 @@ if (setsockopt(s, SOL_SOCKET, SO_LINGER, (char *) &li, sizeof(struct linger)) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "setsockopt: (SO_LINGER)"); /* not a fatal error */ } @@ -1132,7 +1132,7 @@ if (!current_conn) { ap_longjmp(jmpbuffer, 1); } - bsetflag(current_conn->client, B_EOUT, 1); + ap_bsetflag(current_conn->client, B_EOUT, 1); current_conn->aborted = 1; } @@ -1140,7 +1140,7 @@ { timeout_name = "lingering close"; - set_callback_and_alarm(lingerout, MAX_SECS_TO_LINGER); + ap_set_callback_and_alarm(lingerout, MAX_SECS_TO_LINGER); } /* Since many clients will abort a connection instead of closing it, @@ -1163,20 +1163,20 @@ /* Send any leftover data to the client, but never try to again */ - if (bflush(r->connection->client) == -1) { - kill_timeout(r); - bclose(r->connection->client); + if (ap_bflush(r->connection->client) == -1) { + ap_kill_timeout(r); + ap_bclose(r->connection->client); return; } - bsetflag(r->connection->client, B_EOUT, 1); + ap_bsetflag(r->connection->client, B_EOUT, 1); /* Close our half of the connection --- send the client a FIN */ lsd = r->connection->client->fd; if ((shutdown(lsd, 1) != 0) || r->connection->aborted) { - kill_timeout(r); - bclose(r->connection->client); + ap_kill_timeout(r); + ap_bclose(r->connection->client); return; } @@ -1215,9 +1215,9 @@ /* Should now have seen final ack. Safe to finally kill socket */ - bclose(r->connection->client); + ap_bclose(r->connection->client); - kill_timeout(r); + ap_kill_timeout(r); } #endif /* ndef NO_LINGCLOSE */ @@ -1226,13 +1226,13 @@ */ #ifndef NO_OTHER_CHILD -API_EXPORT(void) register_other_child(int pid, +API_EXPORT(void) ap_register_other_child(int pid, void (*maintenance) (int reason, void *, int status), void *data, int write_fd) { other_child_rec *ocr; - ocr = palloc(pconf, sizeof(*ocr)); + ocr = ap_palloc(pconf, sizeof(*ocr)); ocr->pid = pid; ocr->maintenance = maintenance; ocr->data = data; @@ -1245,7 +1245,7 @@ * scanning the other_children list, all scanners should protect themself * by loading ocr->next before calling any maintenance function. */ -API_EXPORT(void) unregister_other_child(void *data) +API_EXPORT(void) ap_unregister_other_child(void *data) { other_child_rec **pocr, *nocr; @@ -1295,7 +1295,7 @@ if (rc == -1) { /* XXX: uhh this could be really bad, we could have a bad file * descriptor due to a bug in one of the maintenance routines */ - log_unixerr("probe_writable_fds", "select", + ap_log_unixerr("probe_writable_fds", "select", "could not probe writable fds", server_conf); return; } @@ -1348,19 +1348,19 @@ static void reinit_scoreboard(pool *p) { - ap_assert(!scoreboard_image); - scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE); - memset(scoreboard_image, 0, SCOREBOARD_SIZE); + ap_assert(!ap_scoreboard_image); + ap_scoreboard_image = (scoreboard *) malloc(SCOREBOARD_SIZE); + memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); } void cleanup_scoreboard() { - ap_assert(scoreboard_image); - free(scoreboard_image); - scoreboard_image = NULL; + ap_assert(ap_scoreboard_image); + free(ap_scoreboard_image); + ap_scoreboard_image = NULL; } -API_EXPORT(void) sync_scoreboard_image() +API_EXPORT(void) ap_sync_scoreboard_image() { } @@ -1428,8 +1428,8 @@ if (rc != 0) { fprintf(stderr, "httpd: Could not uopen() newly created OS/2 Shared memory pool.\n"); } - scoreboard_image = (scoreboard *) m; - scoreboard_image->global.exit_generation = 0; + ap_scoreboard_image = (scoreboard *) m; + ap_scoreboard_image->global.exit_generation = 0; } static void reopen_scoreboard(pool *p) @@ -1444,7 +1444,7 @@ } rc = _uopen((Heap_t) m); - scoreboard_image = (scoreboard *) m; + ap_scoreboard_image = (scoreboard *) m; } #elif defined(USE_POSIX_SCOREBOARD) @@ -1479,7 +1479,7 @@ static void cleanup_shared_mem(void *d) { - shm_unlink(scoreboard_fname); + shm_unlink(ap_scoreboard_fname); } static void setup_shared_mem(pool *p) @@ -1487,27 +1487,27 @@ caddr_t m; int fd; - fd = shm_open(scoreboard_fname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); + fd = shm_open(ap_scoreboard_fname, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); if (fd == -1) { perror("httpd: could not open(create) scoreboard"); exit(1); } if (ltrunc(fd, (off_t) SCOREBOARD_SIZE, SEEK_SET) == -1) { perror("httpd: could not ltrunc scoreboard"); - shm_unlink(scoreboard_fname); + shm_unlink(ap_scoreboard_fname); exit(1); } if ((m = (caddr_t) mmap((caddr_t) 0, (size_t) SCOREBOARD_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t) 0)) == (caddr_t) - 1) { perror("httpd: cannot mmap scoreboard"); - shm_unlink(scoreboard_fname); + shm_unlink(ap_scoreboard_fname); exit(1); } close(fd); - register_cleanup(p, NULL, cleanup_shared_mem, null_cleanup); - scoreboard_image = (scoreboard *) m; - scoreboard_image->global.exit_generation = 0; + ap_register_cleanup(p, NULL, cleanup_shared_mem, ap_null_cleanup); + ap_scoreboard_image = (scoreboard *) m; + ap_scoreboard_image->global.exit_generation = 0; } static void reopen_scoreboard(pool *p) @@ -1567,8 +1567,8 @@ } close(fd); #endif - scoreboard_image = (scoreboard *) m; - scoreboard_image->global.exit_generation = 0; + ap_scoreboard_image = (scoreboard *) m; + ap_scoreboard_image->global.exit_generation = 0; } static void reopen_scoreboard(pool *p) @@ -1589,17 +1589,17 @@ if ((shmid = shmget(shmkey, SCOREBOARD_SIZE, IPC_CREAT | SHM_R | SHM_W)) == -1) { #ifdef LINUX if (errno == ENOSYS) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_EMERG, server_conf, "httpd: Your kernel was built without CONFIG_SYSVIPC\n" "httpd: please consult the Apache FAQ for details\n"); } #endif - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "could not call shmget"); exit(1); } - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, "created shared memory segment #%d", shmid); #ifdef MOVEBREAK @@ -1613,28 +1613,28 @@ * attach the segment and then move break back down. Ugly */ if ((obrk = sbrk(MOVEBREAK)) == (char *) -1) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "sbrk() could not move break"); } #endif #define BADSHMAT ((scoreboard *)(-1)) - if ((scoreboard_image = (scoreboard *) shmat(shmid, 0, 0)) == BADSHMAT) { - aplog_error(APLOG_MARK, APLOG_EMERG, server_conf, "shmat error"); + if ((ap_scoreboard_image = (scoreboard *) shmat(shmid, 0, 0)) == BADSHMAT) { + ap_log_error(APLOG_MARK, APLOG_EMERG, server_conf, "shmat error"); /* * We exit below, after we try to remove the segment */ } else { /* only worry about permissions if we attached the segment */ if (shmctl(shmid, IPC_STAT, &shmbuf) != 0) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "shmctl() could not stat segment #%d", shmid); } else { - shmbuf.shm_perm.uid = user_id; - shmbuf.shm_perm.gid = group_id; + shmbuf.shm_perm.uid = ap_user_id; + shmbuf.shm_perm.gid = ap_group_id; if (shmctl(shmid, IPC_SET, &shmbuf) != 0) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "shmctl() could not set segment #%d", shmid); } } @@ -1644,22 +1644,22 @@ * (small) tables. */ if (shmctl(shmid, IPC_RMID, NULL) != 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "shmctl: IPC_RMID: could not remove shared memory segment #%d", shmid); } - if (scoreboard_image == BADSHMAT) /* now bailout */ + if (ap_scoreboard_image == BADSHMAT) /* now bailout */ exit(1); #ifdef MOVEBREAK if (obrk == (char *) -1) return; /* nothing else to do */ if (sbrk(-(MOVEBREAK)) == (char *) -1) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "sbrk() could not move break back"); } #endif - scoreboard_image->global.exit_generation = 0; + ap_scoreboard_image->global.exit_generation = 0; } static void reopen_scoreboard(pool *p) @@ -1706,17 +1706,17 @@ static void cleanup_scoreboard_file(void *foo) { - unlink(scoreboard_fname); + unlink(ap_scoreboard_fname); } void reopen_scoreboard(pool *p) { if (scoreboard_fd != -1) - pclosef(p, scoreboard_fd); + ap_pclosef(p, scoreboard_fd); - scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0666); + scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0666); if (scoreboard_fd == -1) { - perror(scoreboard_fname); + perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); clean_child_exit(1); } @@ -1727,30 +1727,30 @@ static void reinit_scoreboard(pool *p) { int exit_gen = 0; - if (scoreboard_image) - exit_gen = scoreboard_image->global.exit_generation; + if (ap_scoreboard_image) + exit_gen = ap_scoreboard_image->global.exit_generation; #ifndef SCOREBOARD_FILE - if (scoreboard_image == NULL) { + if (ap_scoreboard_image == NULL) { setup_shared_mem(p); } - memset(scoreboard_image, 0, SCOREBOARD_SIZE); - scoreboard_image->global.exit_generation = exit_gen; + memset(ap_scoreboard_image, 0, SCOREBOARD_SIZE); + ap_scoreboard_image->global.exit_generation = exit_gen; #else - scoreboard_image = &_scoreboard_image; - scoreboard_fname = server_root_relative(p, scoreboard_fname); + ap_scoreboard_image = &_scoreboard_image; + ap_scoreboard_fname = ap_server_root_relative(p, ap_scoreboard_fname); - scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644); + scoreboard_fd = ap_popenf(p, ap_scoreboard_fname, O_CREAT | O_BINARY | O_RDWR, 0644); if (scoreboard_fd == -1) { - perror(scoreboard_fname); + perror(ap_scoreboard_fname); fprintf(stderr, "Cannot open scoreboard file:\n"); exit(1); } - register_cleanup(p, NULL, cleanup_scoreboard_file, null_cleanup); + ap_register_cleanup(p, NULL, cleanup_scoreboard_file, ap_null_cleanup); - memset((char *) scoreboard_image, 0, sizeof(*scoreboard_image)); - scoreboard_image->global.exit_generation = exit_gen; - force_write(scoreboard_fd, scoreboard_image, sizeof(*scoreboard_image)); + memset((char *) ap_scoreboard_image, 0, sizeof(*ap_scoreboard_image)); + ap_scoreboard_image->global.exit_generation = exit_gen; + force_write(scoreboard_fd, ap_scoreboard_image, sizeof(*ap_scoreboard_image)); #endif } @@ -1765,19 +1765,19 @@ * anyway. */ -ap_inline void sync_scoreboard_image(void) +ap_inline void ap_sync_scoreboard_image(void) { #ifdef SCOREBOARD_FILE lseek(scoreboard_fd, 0L, 0); - force_read(scoreboard_fd, scoreboard_image, sizeof(*scoreboard_image)); + force_read(scoreboard_fd, ap_scoreboard_image, sizeof(*ap_scoreboard_image)); #endif } #endif /* MULTITHREAD */ -API_EXPORT(int) exists_scoreboard_image(void) +API_EXPORT(int) ap_exists_scoreboard_image(void) { - return (scoreboard_image ? 1 : 0); + return (ap_scoreboard_image ? 1 : 0); } static ap_inline void put_scoreboard_info(int child_num, @@ -1793,11 +1793,11 @@ static void __attribute__((noreturn)) clean_parent_exit(int code) { /* Clear the pool - including any registered cleanups */ - destroy_pool(pconf); + ap_destroy_pool(pconf); exit(code); } -int update_child_status(int child_num, int status, request_rec *r) +int ap_update_child_status(int child_num, int status, request_rec *r) { int old_status; short_score *ss; @@ -1805,8 +1805,8 @@ if (child_num < 0) return -1; - sync_scoreboard_image(); - ss = &scoreboard_image->servers[child_num]; + ap_sync_scoreboard_image(); + ss = &ap_scoreboard_image->servers[child_num]; old_status = ss->status; ss->status = status; #ifdef OPTIMIZE_TIMEOUTS @@ -1830,7 +1830,7 @@ } if (r) { conn_rec *c = r->connection; - ap_cpystrn(ss->client, get_remote_host(c, r->per_dir_config, + ap_cpystrn(ss->client, ap_get_remote_host(c, r->per_dir_config, REMOTE_NOLOOKUP), sizeof(ss->client)); ap_cpystrn(ss->request, (r->the_request ? r->the_request : "NULL"), sizeof(ss->request)); @@ -1847,14 +1847,14 @@ { #ifdef SCOREBOARD_FILE lseek(scoreboard_fd, - (char *) &scoreboard_image->global -(char *) scoreboard_image, 0); - force_write(scoreboard_fd, &scoreboard_image->global, - sizeof scoreboard_image->global); + (char *) &ap_scoreboard_image->global -(char *) ap_scoreboard_image, 0); + force_write(scoreboard_fd, &ap_scoreboard_image->global, + sizeof ap_scoreboard_image->global); #endif } #if defined(STATUS) -void time_process_request(int child_num, int status) +void ap_time_process_request(int child_num, int status) { short_score *ss; #if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES) @@ -1864,8 +1864,8 @@ if (child_num < 0) return; - sync_scoreboard_image(); - ss = &scoreboard_image->servers[child_num]; + ap_sync_scoreboard_image(); + ss = &ap_scoreboard_image->servers[child_num]; if (status == START_PREQUEST) { #if defined(NO_GETTIMEOFDAY) @@ -1903,11 +1903,11 @@ long int bs = 0; short_score *ss; - sync_scoreboard_image(); - ss = &scoreboard_image->servers[child_num]; + ap_sync_scoreboard_image(); + ss = &ap_scoreboard_image->servers[child_num]; if (r->sent_bodyct) - bgetopt(r->connection->client, BO_BYTECT, &bs); + ap_bgetopt(r->connection->client, BO_BYTECT, &bs); #ifndef NO_TIMES times(&ss->times); @@ -1930,7 +1930,7 @@ int i; for (i = 0; i < max_daemons_limit; ++i) - if (scoreboard_image->parent[i].pid == pid) + if (ap_scoreboard_image->parent[i].pid == pid) return i; return -1; @@ -1948,7 +1948,7 @@ other_child_rec *ocr, *nocr; #endif - sync_scoreboard_image(); + ap_sync_scoreboard_image(); for (tries = terminate ? 4 : 1; tries <= 9; ++tries) { /* don't want to hold up progress any more than @@ -1963,14 +1963,14 @@ /* now see who is done */ not_dead_yet = 0; for (i = 0; i < max_daemons_limit; ++i) { - int pid = scoreboard_image->parent[i].pid; + int pid = ap_scoreboard_image->parent[i].pid; if (pid == my_pid || pid == 0) continue; waitret = waitpid(pid, &status, WNOHANG); if (waitret == pid || waitret == -1) { - scoreboard_image->parent[i].pid = 0; + ap_scoreboard_image->parent[i].pid = 0; continue; } ++not_dead_yet; @@ -1980,7 +1980,7 @@ break; case 3: /* 344ms */ /* perhaps it missed the SIGHUP, lets try again */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, "child process %d did not exit, sending another SIGHUP", pid); @@ -1993,7 +1993,7 @@ break; case 7: /* 1.4sec */ /* ok, now it's being annoying */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, "child process %d still did not exit, sending a SIGTERM", pid); @@ -2001,7 +2001,7 @@ break; case 8: /* 6 sec */ /* die child scum */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, "child process %d still did not exit, sending a SIGKILL", pid); kill(pid, SIGKILL); @@ -2012,7 +2012,7 @@ * exited, we will likely fail to bind to the port * after the restart. */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, "could not make child process %d exit, " "attempting to continue anyway", pid); break; @@ -2062,12 +2062,12 @@ int ret = 0; for (n = 0; n < max_daemons_limit; ++n) { - if (scoreboard_image->servers[n].status != SERVER_DEAD - && waitpid(scoreboard_image->parent[n].pid, &status, WNOHANG) + if (ap_scoreboard_image->servers[n].status != SERVER_DEAD + && waitpid(ap_scoreboard_image->parent[n].pid, &status, WNOHANG) == -1 && errno == ECHILD) { - sync_scoreboard_image(); - update_child_status(n, SERVER_DEAD, NULL); + ap_sync_scoreboard_image(); + ap_update_child_status(n, SERVER_DEAD, NULL); ret = 1; } } @@ -2097,9 +2097,9 @@ for (pi = round * MAXWAITOBJ; (pi < (round + 1) * MAXWAITOBJ) && (pi < HARD_SERVER_LIMIT); pi++) { - if (scoreboard_image->servers[pi].status != SERVER_DEAD) { + if (ap_scoreboard_image->servers[pi].status != SERVER_DEAD) { e[hi] = pi; - h[hi++] = (HANDLE) scoreboard_image->parent[pi].pid; + h[hi++] = (HANDLE) ap_scoreboard_image->parent[pi].pid; } } @@ -2108,9 +2108,9 @@ if (rv == -1) err = GetLastError(); if ((WAIT_OBJECT_0 <= (unsigned int) rv) && ((unsigned int) rv < (WAIT_OBJECT_0 + hi))) - return (scoreboard_image->parent[e[rv - WAIT_OBJECT_0]].pid); + return (ap_scoreboard_image->parent[e[rv - WAIT_OBJECT_0]].pid); else if ((WAIT_ABANDONED_0 <= (unsigned int) rv) && ((unsigned int) rv < (WAIT_ABANDONED_0 + hi))) - return (scoreboard_image->parent[e[rv - WAIT_ABANDONED_0]].pid); + return (ap_scoreboard_image->parent[e[rv - WAIT_ABANDONED_0]].pid); } } @@ -2181,9 +2181,9 @@ ap_snprintf(emsg, sizeof(emsg), "httpd: caught %s, attempting to dump core in %s", - s, coredump_dir); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, emsg); - chdir(coredump_dir); + s, ap_coredump_dir); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, emsg); + chdir(ap_coredump_dir); abort(); exit(1); } @@ -2252,13 +2252,13 @@ /* Um, problem, can't signal the main loop, which means we can't * signal ourselves to die. Ignore for now... */ - aplog_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, "OpenEvent on apache-signal event"); return; } if (SetEvent(e) == 0) { /* Same problem as above */ - aplog_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, "SetEvent on apache-signal event"); return; } @@ -2283,7 +2283,7 @@ * child to force an exit) and so do an exit anyway. */ -void start_shutdown(void) +void ap_start_shutdown(void) { if (shutdown_pending == 1) { /* Um, is this _probably_ not an error, if the user has @@ -2300,7 +2300,7 @@ } /* do a graceful restart if graceful == 1 */ -void start_restart(int graceful) +void ap_start_restart(int graceful) { if (restart_pending == 1) { /* Probably not an error - don't bother reporting it */ @@ -2316,15 +2316,15 @@ static void sig_term(int sig) { - start_shutdown(); + ap_start_shutdown(); } static void restart(int sig) { #ifndef WIN32 - start_restart(sig == SIGUSR1); + ap_start_restart(sig == SIGUSR1); #else - start_restart(1); + ap_start_restart(1); #endif } @@ -2344,37 +2344,37 @@ sa.sa_flags = SA_RESETHAND; #endif if (sigaction(SIGSEGV, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGSEGV)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGSEGV)"); #ifdef SIGBUS if (sigaction(SIGBUS, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGBUS)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGBUS)"); #endif #ifdef SIGABORT if (sigaction(SIGABORT, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGABORT)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGABORT)"); #endif #ifdef SIGABRT if (sigaction(SIGABRT, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGABRT)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGABRT)"); #endif sa.sa_flags = 0; } sa.sa_handler = sig_term; if (sigaction(SIGTERM, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGTERM)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGTERM)"); #ifdef SIGINT if (sigaction(SIGINT, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGINT)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGINT)"); #endif #ifdef SIGXCPU sa.sa_handler = SIG_DFL; if (sigaction(SIGXCPU, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGXCPU)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGXCPU)"); #endif #ifdef SIGXFSZ sa.sa_handler = SIG_DFL; if (sigaction(SIGXFSZ, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGXFSZ)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGXFSZ)"); #endif /* we want to ignore HUPs and USR1 while we're busy processing one */ @@ -2382,9 +2382,9 @@ sigaddset(&sa.sa_mask, SIGUSR1); sa.sa_handler = restart; if (sigaction(SIGHUP, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGHUP)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGHUP)"); if (sigaction(SIGUSR1, &sa, NULL) < 0) - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGUSR1)"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "sigaction(SIGUSR1)"); #else if (!one_process) { signal(SIGSEGV, sig_coredump); @@ -2500,12 +2500,12 @@ /* Get username if passed as a uid */ - if (user_name[0] == '#') { + if (ap_user_name[0] == '#') { struct passwd *ent; - uid_t uid = atoi(&user_name[1]); + uid_t uid = atoi(&ap_user_name[1]); if ((ent = getpwuid(uid)) == NULL) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "getpwuid: couldn't determine user name from uid %u, " "you probably need to modify the User directive", (unsigned)uid); @@ -2515,30 +2515,30 @@ name = ent->pw_name; } else - name = user_name; + name = ap_user_name; #ifndef __EMX__ /* OS/2 dosen't support groups. */ /* Reset `groups' attributes. */ - if (initgroups(name, group_id) == -1) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + if (initgroups(name, ap_group_id) == -1) { + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "initgroups: unable to set groups for User %s " - "and Group %u", name, (unsigned)group_id); + "and Group %u", name, (unsigned)ap_group_id); exit(1); } #ifdef MULTIPLE_GROUPS if (getgroups(NGROUPS_MAX, group_id_list) == -1) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "getgroups: unable to get group list"); exit(1); } #endif - if (setgid(group_id) == -1) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + if (setgid(ap_group_id) == -1) { + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setgid: unable to set group id to Group %u", - (unsigned)group_id); + (unsigned)ap_group_id); exit(1); } #endif @@ -2553,14 +2553,14 @@ struct stat wrapper; if ((stat(SUEXEC_BIN, &wrapper)) != 0) - return (suexec_enabled); + return (ap_suexec_enabled); if ((wrapper.st_mode & S_ISUID) && wrapper.st_uid == 0) { - suexec_enabled = 1; + ap_suexec_enabled = 1; fprintf(stderr, "Configuring Apache for use with suexec wrapper.\n"); } #endif /* ndef WIN32 */ - return (suexec_enabled); + return (ap_suexec_enabled); } /***************************************************************** @@ -2573,7 +2573,7 @@ const struct sockaddr_in *saddr, int child_num) { - conn_rec *conn = (conn_rec *) pcalloc(p, sizeof(conn_rec)); + conn_rec *conn = (conn_rec *) ap_pcalloc(p, sizeof(conn_rec)); /* Got a connection structure, so initialize what fields we can * (the rest are zeroed out by pcalloc). @@ -2584,12 +2584,12 @@ conn->pool = p; conn->local_addr = *saddr; conn->server = server; /* just a guess for now */ - update_vhost_given_ip(conn); + ap_update_vhost_given_ip(conn); conn->base_server = conn->server; conn->client = inout; conn->remote_addr = *remaddr; - conn->remote_ip = pstrdup(conn->pool, + conn->remote_ip = ap_pstrdup(conn->pool, inet_ntoa(conn->remote_addr.sin_addr)); return conn; @@ -2611,7 +2611,7 @@ if (setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &just_say_no, sizeof(int)) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "setsockopt: (TCP_NODELAY)"); } } @@ -2634,11 +2634,11 @@ ap_snprintf(addr, sizeof(addr), "port %d", ntohs(server->sin_port)); /* note that because we're about to slack we don't use psocket */ - block_alarms(); + ap_block_alarms(); if ((s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) { - aplog_error(APLOG_MARK, APLOG_CRIT, server_conf, + ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf, "make_sock: failed to get a socket for %s", addr); - unblock_alarms(); + ap_unblock_alarms(); exit(1); } @@ -2659,17 +2659,17 @@ #ifndef WORKAROUND_SOLARIS_BUG s = ap_slack(s, AP_SLACK_HIGH); - note_cleanups_for_socket(p, s); /* arrange to close on exec or restart */ + ap_note_cleanups_for_socket(p, s); /* arrange to close on exec or restart */ #endif #ifndef MPE /* MPE does not support SO_REUSEADDR and SO_KEEPALIVE */ #ifndef _OSD_POSIX if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(int)) < 0) { - aplog_error(APLOG_MARK, APLOG_CRIT, server_conf, + ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf, "make_sock: for %s, setsockopt: (SO_REUSEADDR)", addr); close(s); - unblock_alarms(); + ap_unblock_alarms(); return -1; } #endif /*_OSD_POSIX*/ @@ -2677,10 +2677,10 @@ #ifndef BEOS /* BeOS does not support SO_KEEPALIVE */ if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (char *) &one, sizeof(int)) < 0) { - aplog_error(APLOG_MARK, APLOG_CRIT, server_conf, + ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf, "make_sock: for %s, setsockopt: (SO_KEEPALIVE)", addr); close(s); - unblock_alarms(); + ap_unblock_alarms(); return -1; } #endif @@ -2712,7 +2712,7 @@ if (server_conf->send_buffer_size) { if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &server_conf->send_buffer_size, sizeof(int)) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "make_sock: failed to set SendBufferSize for %s, " "using default", addr); /* not a fatal error */ @@ -2726,14 +2726,14 @@ GETPRIVMODE(); #endif if (bind(s, (struct sockaddr *) server, sizeof(struct sockaddr_in)) == -1) { - aplog_error(APLOG_MARK, APLOG_CRIT, server_conf, + ap_log_error(APLOG_MARK, APLOG_CRIT, server_conf, "make_sock: could not bind to %s", addr); #ifdef MPE if (ntohs(server->sin_port) < 1024) GETUSERMODE(); #endif close(s); - unblock_alarms(); + ap_unblock_alarms(); exit(1); } #ifdef MPE @@ -2741,25 +2741,25 @@ GETUSERMODE(); #endif - if (listen(s, listenbacklog) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + if (listen(s, ap_listenbacklog) == -1) { + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "make_sock: unable to listen for connections on %s", addr); close(s); - unblock_alarms(); + ap_unblock_alarms(); exit(1); } #ifdef WORKAROUND_SOLARIS_BUG s = ap_slack(s, AP_SLACK_HIGH); - note_cleanups_for_socket(p, s); /* arrange to close on exec or restart */ + ap_note_cleanups_for_socket(p, s); /* arrange to close on exec or restart */ #endif - unblock_alarms(); + ap_unblock_alarms(); #ifndef WIN32 /* protect various fd_sets */ if (s >= FD_SETSIZE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, "make_sock: problem listening on %s, filedescriptor (%u) " "larger than FD_SETSIZE (%u) " "found, you probably need to rebuild Apache with a " @@ -2791,10 +2791,10 @@ listen_rec *lr; ap_assert(old_listeners == NULL); - if (listeners == NULL) { + if (ap_listeners == NULL) { return; } - lr = listeners; + lr = ap_listeners; do { listen_rec *nr = malloc(sizeof *nr); if (nr == NULL) { @@ -2802,12 +2802,12 @@ exit(1); } *nr = *lr; - kill_cleanups_for_socket(p, nr->fd); + ap_kill_cleanups_for_socket(p, nr->fd); nr->next = old_listeners; ap_assert(!nr->used); old_listeners = nr; lr = lr->next; - } while (lr && lr != listeners); + } while (lr && lr != ap_listeners); } @@ -2847,14 +2847,14 @@ listenmaxfd = -1; FD_ZERO(&listenfds); - lr = listeners; + lr = ap_listeners; for (;;) { fd = find_listener(lr); if (fd < 0) { fd = make_sock(p, &lr->local_addr); } else { - note_cleanups_for_socket(p, fd); + ap_note_cleanups_for_socket(p, fd); } if (fd >= 0) { FD_SET(fd, &listenfds); @@ -2867,16 +2867,16 @@ lr = lr->next; } /* turn the list into a ring */ - lr->next = listeners; - head_listener = listeners; + lr->next = ap_listeners; + head_listener = ap_listeners; close_unused_listeners(); #ifdef NO_SERIALIZED_ACCEPT /* warn them about the starvation problem if they're using multiple * sockets */ - if (listeners->next != listeners) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, NULL, + if (ap_listeners->next != ap_listeners) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, NULL, "You cannot use multiple Listens safely on your system, " "proceeding anyway. See src/PORTING, search for " "SERIALIZED_ACCEPT."); @@ -2954,10 +2954,10 @@ #ifdef SERVER_SUBVERSION printf("Server base version: %s\n", SERVER_BASEVERSION); printf("Server sub-version: %s\n", SERVER_SUBVERSION); - printf("Server built: %s\n", apapi_get_server_built()); + printf("Server built: %s\n", ap_get_server_built()); #else - printf("Server version: %s\n", apapi_get_server_version()); - printf("Server built: %s\n", apapi_get_server_built()); + printf("Server version: %s\n", ap_get_server_version()); + printf("Server built: %s\n", ap_get_server_built()); #endif printf("Server's Module Magic Number: %u\n", MODULE_MAGIC_NUMBER); printf("Server compiled with....\n"); @@ -3070,15 +3070,15 @@ AMCSocketInitialize(); #endif /* WIN32 */ - pconf = init_alloc(); - ptrans = make_sub_pool(pconf); + pconf = ap_init_alloc(); + ptrans = ap_make_sub_pool(pconf); - util_init(); - util_uri_init(); + ap_util_init(); + ap_util_uri_init(); - pcommands = make_sub_pool(NULL); - server_pre_read_config = make_array(pcommands, 1, sizeof(char *)); - server_post_read_config = make_array(pcommands, 1, sizeof(char *)); + pcommands = ap_make_sub_pool(NULL); + ap_server_pre_read_config = ap_make_array(pcommands, 1, sizeof(char *)); + ap_server_post_read_config = ap_make_array(pcommands, 1, sizeof(char *)); } #ifndef MULTITHREAD @@ -3094,10 +3094,10 @@ static int requests_this_child; static fd_set main_fds; -API_EXPORT(void) child_terminate(request_rec *r) +API_EXPORT(void) ap_child_terminate(request_rec *r) { r->connection->keepalive = 0; - requests_this_child = max_requests_per_child = 1; + requests_this_child = ap_max_requests_per_child = 1; } static void child_main(int child_num_arg) @@ -3117,7 +3117,7 @@ * be either a broken module, or a broken configuration (i.e. network * problems, file locking problems, whatever). -djg */ - block_alarms(); + ap_block_alarms(); my_pid = getpid(); csd = -1; @@ -3128,7 +3128,7 @@ /* Get a sub pool for global allocations in this child, so that * we can have cleanups occur when the child exits. */ - pchild = make_sub_pool(pconf); + pchild = ap_make_sub_pool(pconf); /* needs to be done before we switch UIDs so we have permissions */ reopen_scoreboard(pchild); @@ -3137,11 +3137,11 @@ set_group_privs(); #ifdef MPE /* Only try to switch if we're running as MANAGER.SYS */ - if (geteuid() == 1 && user_id > 1) { + if (geteuid() == 1 && ap_user_id > 1) { GETPRIVMODE(); - if (setuid(user_id) == -1) { + if (setuid(ap_user_id) == -1) { GETUSERMODE(); - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setuid: unable to change uid"); exit(1); } @@ -3149,19 +3149,19 @@ } #else /* Only try to switch if we're running as root */ - if (!geteuid() && setuid(user_id) == -1) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + if (!geteuid() && setuid(ap_user_id) == -1) { + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setuid: unable to change uid"); clean_child_exit(1); } #endif - child_init_modules(pchild, server_conf); + ap_child_init_modules(pchild, server_conf); /* done with the initialization critical section */ - unblock_alarms(); + ap_unblock_alarms(); - (void) update_child_status(my_child_num, SERVER_READY, (request_rec *) NULL); + (void) ap_update_child_status(my_child_num, SERVER_READY, (request_rec *) NULL); /* * Setup the jump buffers so that we can return here after @@ -3199,23 +3199,23 @@ * (Re)initialize this child to a pre-connection state. */ - kill_timeout(0); /* Cancel any outstanding alarms. */ + ap_kill_timeout(0); /* Cancel any outstanding alarms. */ timeout_req = NULL; /* No request in progress */ current_conn = NULL; - clear_pool(ptrans); + ap_clear_pool(ptrans); - sync_scoreboard_image(); - if (scoreboard_image->global.exit_generation >= generation) { + ap_sync_scoreboard_image(); + if (ap_scoreboard_image->global.exit_generation >= generation) { clean_child_exit(0); } - if ((max_requests_per_child > 0 - && ++requests_this_child >= max_requests_per_child)) { + if ((ap_max_requests_per_child > 0 + && ++requests_this_child >= ap_max_requests_per_child)) { clean_child_exit(0); } - (void) update_child_status(my_child_num, SERVER_READY, (request_rec *) NULL); + (void) ap_update_child_status(my_child_num, SERVER_READY, (request_rec *) NULL); /* * Wait for an acceptable connection to arrive. @@ -3225,7 +3225,7 @@ SAFE_ACCEPT(accept_mutex_on()); for (;;) { - if (listeners->next != listeners) { + if (ap_listeners->next != ap_listeners) { /* more than one socket */ memcpy(&main_fds, &listenfds, sizeof(fd_set)); srv = ap_select(listenmaxfd + 1, &main_fds, NULL, NULL, NULL); @@ -3237,7 +3237,7 @@ * on Linux 2.0.x we seem to end up with EFAULT * occasionally, and we'd loop forever due to it. */ - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, "select: (listen)"); + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "select: (listen)"); clean_child_exit(1); } @@ -3251,7 +3251,7 @@ } else { /* only one socket, just pretend we did the other stuff */ - sd = listeners->fd; + sd = ap_listeners->fd; } /* if we accept() something we don't want to die, so we have to @@ -3327,7 +3327,7 @@ break; default: - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "accept: (client socket)"); clean_child_exit(1); } @@ -3342,8 +3342,8 @@ /* or maybe we missed a signal, you never know on systems * without reliable signals */ - sync_scoreboard_image(); - if (scoreboard_image->global.exit_generation >= generation) { + ap_sync_scoreboard_image(); + if (ap_scoreboard_image->global.exit_generation >= generation) { clean_child_exit(0); } } @@ -3355,11 +3355,11 @@ */ signal(SIGUSR1, SIG_IGN); - note_cleanups_for_fd(ptrans, csd); + ap_note_cleanups_for_fd(ptrans, csd); /* protect various fd_sets */ if (csd >= FD_SETSIZE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, "[csd] filedescriptor (%u) larger than FD_SETSIZE (%u) " "found, you probably need to rebuild Apache with a " "larger FD_SETSIZE", csd, FD_SETSIZE); @@ -3373,16 +3373,16 @@ clen = sizeof(sa_server); if (getsockname(csd, &sa_server, &clen) < 0) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname"); + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "getsockname"); continue; } sock_disable_nagle(csd); - (void) update_child_status(my_child_num, SERVER_BUSY_READ, + (void) ap_update_child_status(my_child_num, SERVER_BUSY_READ, (request_rec *) NULL); - conn_io = bcreate(ptrans, B_RDWR | B_SOCKET); + conn_io = ap_bcreate(ptrans, B_RDWR | B_SOCKET); #ifdef B_SFIO (void) sfdisc(conn_io->sf_in, SF_POPDISC); @@ -3397,22 +3397,22 @@ dupped_csd = csd; #if defined(NEED_DUPPED_CSD) if ((dupped_csd = dup(csd)) < 0) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "dup: couldn't duplicate csd"); dupped_csd = csd; /* Oh well... */ } - note_cleanups_for_fd(ptrans, dupped_csd); + ap_note_cleanups_for_fd(ptrans, dupped_csd); /* protect various fd_sets */ if (dupped_csd >= FD_SETSIZE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, "[dupped_csd] filedescriptor (%u) larger than FD_SETSIZE (%u) " "found, you probably need to rebuild Apache with a " "larger FD_SETSIZE", dupped_csd, FD_SETSIZE); continue; } #endif - bpushfd(conn_io, csd, dupped_csd); + ap_bpushfd(conn_io, csd, dupped_csd); current_conn = new_connection(ptrans, server_conf, conn_io, (struct sockaddr_in *) &sa_client, @@ -3424,15 +3424,15 @@ * until no requests are left or we decide to close. */ - while ((r = read_request(current_conn)) != NULL) { + while ((r = ap_read_request(current_conn)) != NULL) { /* read_request_line has already done a * signal (SIGUSR1, SIG_IGN); */ - (void) update_child_status(my_child_num, SERVER_BUSY_WRITE, r); + (void) ap_update_child_status(my_child_num, SERVER_BUSY_WRITE, r); - process_request(r); + ap_process_request(r); #if defined(STATUS) increment_counts(my_child_num, r); @@ -3441,13 +3441,13 @@ if (!current_conn->keepalive || current_conn->aborted) break; - destroy_pool(r->pool); - (void) update_child_status(my_child_num, SERVER_BUSY_KEEPALIVE, + ap_destroy_pool(r->pool); + (void) ap_update_child_status(my_child_num, SERVER_BUSY_KEEPALIVE, (request_rec *) NULL); - sync_scoreboard_image(); - if (scoreboard_image->global.exit_generation >= generation) { - bclose(conn_io); + ap_sync_scoreboard_image(); + if (ap_scoreboard_image->global.exit_generation >= generation) { + ap_bclose(conn_io); clean_child_exit(0); } @@ -3475,7 +3475,7 @@ */ #ifdef NO_LINGCLOSE - bclose(conn_io); /* just close it */ + ap_bclose(conn_io); /* just close it */ #else if (r && r->connection && !r->connection->aborted @@ -3485,8 +3485,8 @@ lingering_close(r); } else { - bsetflag(conn_io, B_EOUT, 1); - bclose(conn_io); + ap_bsetflag(conn_io, B_EOUT, 1); + ap_bclose(conn_io); } #endif } @@ -3512,15 +3512,15 @@ head_listener = head_listener->next; Explain1("Starting new child in slot %d", slot); - (void) update_child_status(slot, SERVER_STARTING, (request_rec *) NULL); + (void) ap_update_child_status(slot, SERVER_STARTING, (request_rec *) NULL); if ((pid = fork()) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, s, "fork: Unable to fork new process"); + ap_log_error(APLOG_MARK, APLOG_ERR, s, "fork: Unable to fork new process"); /* fork didn't succeed. Fix the scoreboard or else * it will say SERVER_STARTING forever and ever */ - (void) update_child_status(slot, SERVER_DEAD, (request_rec *) NULL); + (void) ap_update_child_status(slot, SERVER_DEAD, (request_rec *) NULL); /* In case system resources are maxxed out, we don't want Apache running away with the CPU trying to fork over and @@ -3539,7 +3539,7 @@ int status = bindprocessor(BINDPROCESS, (int)getpid(), PROCESSOR_CLASS_ANY); if (status != OK) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, "processor unbind failed %d\n", status); } #endif @@ -3556,12 +3556,12 @@ } #ifdef OPTIMIZE_TIMEOUTS - scoreboard_image->parent[slot].last_rtime = now; + ap_scoreboard_image->parent[slot].last_rtime = now; #endif - scoreboard_image->parent[slot].pid = pid; + ap_scoreboard_image->parent[slot].pid = pid; #ifdef SCOREBOARD_FILE lseek(scoreboard_fd, XtOffsetOf(scoreboard, parent[slot]), 0); - force_write(scoreboard_fd, &scoreboard_image->parent[slot], + force_write(scoreboard_fd, &ap_scoreboard_image->parent[slot], sizeof(parent_score)); #endif @@ -3575,8 +3575,8 @@ int i; time_t now = time(0); - for (i = 0; number_to_start && i < daemons_limit; ++i) { - if (scoreboard_image->servers[i].status != SERVER_DEAD) { + for (i = 0; number_to_start && i < ap_daemons_limit; ++i) { + if (ap_scoreboard_image->servers[i].status != SERVER_DEAD) { continue; } if (make_child(server_conf, i, now) < 0) { @@ -3619,13 +3619,13 @@ last_non_dead = -1; total_non_dead = 0; - sync_scoreboard_image(); - for (i = 0; i < daemons_limit; ++i) { + ap_sync_scoreboard_image(); + for (i = 0; i < ap_daemons_limit; ++i) { int status; if (i >= max_daemons_limit && free_length == idle_spawn_rate) break; - ss = &scoreboard_image->servers[i]; + ss = &ap_scoreboard_image->servers[i]; status = ss->status; if (status == SERVER_DEAD) { /* try to keep children numbers as low as possible */ @@ -3658,7 +3658,7 @@ if (ss->timeout_len) { /* if it's a live server, with a live timeout then * start checking its timeout */ - parent_score *ps = &scoreboard_image->parent[i]; + parent_score *ps = &ap_scoreboard_image->parent[i]; if (ss->cur_vtime != ps->last_vtime) { /* it has made progress, so update its last_rtime, * last_vtime */ @@ -3675,22 +3675,22 @@ } } max_daemons_limit = last_non_dead + 1; - if (idle_count > daemons_max_free) { + if (idle_count > ap_daemons_max_free) { /* kill off one child... we use SIGUSR1 because that'll cause it to * shut down gracefully, in case it happened to pick up a request * while we were counting */ - kill(scoreboard_image->parent[to_kill].pid, SIGUSR1); + kill(ap_scoreboard_image->parent[to_kill].pid, SIGUSR1); idle_spawn_rate = 1; } - else if (idle_count < daemons_min_free) { + else if (idle_count < ap_daemons_min_free) { /* terminate the free list */ if (free_length == 0) { /* only report this condition once */ static int reported = 0; if (!reported) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, server_conf, "server reached MaxClients setting, consider" " raising the MaxClients setting"); reported = 1; @@ -3699,7 +3699,7 @@ } else { if (idle_spawn_rate >= 8) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, "server seems busy, (you may need " "to increase StartServers, or Min/MaxSpareServers), " "spawning %d children, there are %d idle, and " @@ -3737,7 +3737,7 @@ { int remaining_children_to_start; - standalone = 1; + ap_standalone = 1; is_graceful = 0; ++generation; @@ -3754,37 +3754,37 @@ do { copy_listeners(pconf); if (!is_graceful) { - restart_time = time(NULL); + ap_restart_time = time(NULL); } #ifdef SCOREBOARD_FILE else if (scoreboard_fd != -1) { - kill_cleanup(pconf, NULL, cleanup_scoreboard_file); - kill_cleanups_for_fd(pconf, scoreboard_fd); + ap_kill_cleanup(pconf, NULL, cleanup_scoreboard_file); + ap_kill_cleanups_for_fd(pconf, scoreboard_fd); } #endif - clear_pool(pconf); - ptrans = make_sub_pool(pconf); + ap_clear_pool(pconf); + ptrans = ap_make_sub_pool(pconf); - server_conf = read_config(pconf, ptrans, server_confname); + server_conf = ap_read_config(pconf, ptrans, ap_server_confname); setup_listeners(pconf); - open_logs(server_conf, pconf); - log_pid(pconf, pid_fname); - init_modules(pconf, server_conf); + ap_open_logs(server_conf, pconf); + ap_log_pid(pconf, ap_pid_fname); + ap_init_modules(pconf, server_conf); SAFE_ACCEPT(accept_mutex_init(pconf)); if (!is_graceful) { reinit_scoreboard(pconf); } #ifdef SCOREBOARD_FILE else { - scoreboard_fname = server_root_relative(pconf, scoreboard_fname); - note_cleanups_for_fd(pconf, scoreboard_fd); + ap_scoreboard_fname = ap_server_root_relative(pconf, ap_scoreboard_fname); + ap_note_cleanups_for_fd(pconf, scoreboard_fd); } #endif set_signals(); - if (daemons_max_free < daemons_min_free + 1) /* Don't thrash... */ - daemons_max_free = daemons_min_free + 1; + if (ap_daemons_max_free < ap_daemons_min_free + 1) /* Don't thrash... */ + ap_daemons_max_free = ap_daemons_min_free + 1; /* If we're doing a graceful_restart then we're going to see a lot * of children exiting immediately when we get into the main loop @@ -3794,9 +3794,9 @@ * start more than that, so we'll just keep track of how many we're * supposed to start up without the 1 second penalty between each fork. */ - remaining_children_to_start = daemons_to_start; - if (remaining_children_to_start > daemons_limit) { - remaining_children_to_start = daemons_limit; + remaining_children_to_start = ap_daemons_to_start; + if (remaining_children_to_start > ap_daemons_limit) { + remaining_children_to_start = ap_daemons_limit; } if (!is_graceful) { startup_children(remaining_children_to_start); @@ -3808,11 +3808,11 @@ hold_off_on_exponential_spawning = 10; } - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, "%s configured -- resuming normal operations", - apapi_get_server_version()); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, - "Server built: %s", apapi_get_server_built()); + ap_get_server_version()); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, server_conf, + "Server built: %s", ap_get_server_built()); restart_pending = shutdown_pending = 0; while (!restart_pending && !shutdown_pending) { @@ -3826,14 +3826,14 @@ */ if (pid >= 0) { /* Child died... note that it's gone in the scoreboard. */ - sync_scoreboard_image(); + ap_sync_scoreboard_image(); child_slot = find_child_by_pid(pid); Explain2("Reaping child %d slot %d", pid, child_slot); if (child_slot >= 0) { - (void) update_child_status(child_slot, SERVER_DEAD, + (void) ap_update_child_status(child_slot, SERVER_DEAD, (request_rec *) NULL); if (remaining_children_to_start - && child_slot < daemons_limit) { + && child_slot < ap_daemons_limit) { /* we're still doing a 1-for-1 replacement of dead * children with new children */ @@ -3851,7 +3851,7 @@ * scoreboard. Somehow we don't know about this * child. */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, server_conf, "long lost child came home! (pid %d)", pid); } /* Don't perform idle maintenance when a child dies, @@ -3883,10 +3883,10 @@ * Kill child processes, tell them to call child_exit, etc... */ if (ap_killpg(pgrp, SIGTERM) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGTERM"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGTERM"); } reclaim_child_processes(1); /* Start with SIGTERM */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, "httpd: caught SIGTERM, shutting down"); clean_parent_exit(0); @@ -3908,15 +3908,15 @@ /* USE WITH CAUTION: Graceful restarts are not known to work * in various configurations on the architectures we support. */ - scoreboard_image->global.exit_generation = generation; + ap_scoreboard_image->global.exit_generation = generation; update_scoreboard_global(); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, "SIGUSR1 received. Doing graceful restart"); /* kill off the idle ones */ if (ap_killpg(pgrp, SIGUSR1) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGUSR1"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGUSR1"); } #ifndef SCOREBOARD_FILE /* This is mostly for debugging... so that we know what is still @@ -3924,10 +3924,10 @@ * do it if we're in a SCOREBOARD_FILE because it'll cause * corruption too easily. */ - sync_scoreboard_image(); - for (i = 0; i < daemons_limit; ++i) { - if (scoreboard_image->servers[i].status != SERVER_DEAD) { - scoreboard_image->servers[i].status = SERVER_GRACEFUL; + ap_sync_scoreboard_image(); + for (i = 0; i < ap_daemons_limit; ++i) { + if (ap_scoreboard_image->servers[i].status != SERVER_DEAD) { + ap_scoreboard_image->servers[i].status = SERVER_GRACEFUL; } } #endif @@ -3935,10 +3935,10 @@ else { /* Kill 'em off */ if (ap_killpg(pgrp, SIGHUP) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGHUP"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "killpg SIGHUP"); } reclaim_child_processes(0); /* Not when just starting up */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, server_conf, "SIGHUP received. Attempting to restart"); } ++generation; @@ -3962,11 +3962,11 @@ common_init(); - server_argv0 = argv[0]; - ap_cpystrn(server_root, HTTPD_ROOT, sizeof(server_root)); - ap_cpystrn(server_confname, SERVER_CONFIG_FILE, sizeof(server_confname)); + ap_server_argv0 = argv[0]; + ap_cpystrn(ap_server_root, HTTPD_ROOT, sizeof(ap_server_root)); + ap_cpystrn(ap_server_confname, SERVER_CONFIG_FILE, sizeof(ap_server_confname)); - setup_prelinked_modules(); + ap_setup_prelinked_modules(); #ifdef DEBUG_SIGSTOP while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlL:Z:")) != -1) { @@ -3976,31 +3976,31 @@ char **new; switch (c) { case 'c': - new = (char **)push_array(server_post_read_config); - *new = pstrdup(pcommands, optarg); + new = (char **)ap_push_array(ap_server_post_read_config); + *new = ap_pstrdup(pcommands, optarg); break; case 'C': - new = (char **)push_array(server_pre_read_config); - *new = pstrdup(pcommands, optarg); + new = (char **)ap_push_array(ap_server_pre_read_config); + *new = ap_pstrdup(pcommands, optarg); break; case 'd': - ap_cpystrn(server_root, optarg, sizeof(server_root)); + ap_cpystrn(ap_server_root, optarg, sizeof(ap_server_root)); break; case 'f': - ap_cpystrn(server_confname, optarg, sizeof(server_confname)); + ap_cpystrn(ap_server_confname, optarg, sizeof(ap_server_confname)); break; case 'v': - printf("Server version: %s\n", apapi_get_server_version()); - printf("Server built: %s\n", apapi_get_server_built()); + printf("Server version: %s\n", ap_get_server_version()); + printf("Server built: %s\n", ap_get_server_built()); exit(0); case 'V': show_compile_settings(); exit(0); case 'h': - show_directives(); + ap_show_directives(); exit(0); case 'l': - show_modules(); + ap_show_modules(); exit(0); case 'X': ++one_process; /* Weird debugging mode. */ @@ -4025,17 +4025,17 @@ } #ifdef __EMX__ - printf("%s \n", apapi_get_server_version()); + printf("%s \n", ap_get_server_version()); #endif - suexec_enabled = init_suexec(); - server_conf = read_config(pconf, ptrans, server_confname); + ap_suexec_enabled = init_suexec(); + server_conf = ap_read_config(pconf, ptrans, ap_server_confname); - child_timeouts = !standalone || one_process; + child_timeouts = !ap_standalone || one_process; - if (standalone) { - open_logs(server_conf, pconf); - init_modules(pconf, server_conf); + if (ap_standalone) { + ap_open_logs(server_conf, pconf); + ap_init_modules(pconf, server_conf); STANDALONE_MAIN(argc, argv); } else { @@ -4046,18 +4046,18 @@ NET_SIZE_T l; /* Yes this is called twice. */ - init_modules(pconf, server_conf); - open_logs(server_conf, pconf); - init_modules(pconf, server_conf); + ap_init_modules(pconf, server_conf); + ap_open_logs(server_conf, pconf); + ap_init_modules(pconf, server_conf); set_group_privs(); #ifdef MPE /* Only try to switch if we're running as MANAGER.SYS */ - if (geteuid() == 1 && user_id > 1) { + if (geteuid() == 1 && ap_user_id > 1) { GETPRIVMODE(); - if (setuid(user_id) == -1) { + if (setuid(ap_user_id) == -1) { GETUSERMODE(); - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setuid: unable to change uid"); exit(1); } @@ -4065,8 +4065,8 @@ } #else /* Only try to switch if we're running as root */ - if (!geteuid() && setuid(user_id) == -1) { - aplog_error(APLOG_MARK, APLOG_ALERT, server_conf, + if (!geteuid() && setuid(ap_user_id) == -1) { + ap_log_error(APLOG_MARK, APLOG_ALERT, server_conf, "setuid: unable to change uid"); exit(1); } @@ -4089,7 +4089,7 @@ exit(1); } server_conf->port = ntohs(((struct sockaddr_in *) &sa_server)->sin_port); - cio = bcreate(ptrans, B_RDWR | B_SOCKET); + cio = ap_bcreate(ptrans, B_RDWR | B_SOCKET); #ifdef MPE /* HP MPE 5.5 inetd only passes the incoming socket as stdin (fd 0), whereas HPUX inetd passes the incoming socket as stdin (fd 0) and stdout (fd 1). @@ -4105,18 +4105,18 @@ conn = new_connection(ptrans, server_conf, cio, (struct sockaddr_in *) &sa_client, (struct sockaddr_in *) &sa_server, -1); - r = read_request(conn); + r = ap_read_request(conn); if (r) - process_request(r); /* else premature EOF (ignore) */ + ap_process_request(r); /* else premature EOF (ignore) */ while (r && conn->keepalive && !conn->aborted) { - destroy_pool(r->pool); - r = read_request(conn); + ap_destroy_pool(r->pool); + r = ap_read_request(conn); if (r) - process_request(r); + ap_process_request(r); } - bclose(cio); + ap_bclose(cio); } exit(0); } @@ -4236,7 +4236,7 @@ ap_assert(allowed_globals.jobmutex); /* TODO: If too many jobs in queue, sleep, check for problems */ - acquire_mutex(allowed_globals.jobmutex); + ap_acquire_mutex(allowed_globals.jobmutex); new_job = (joblist *) malloc(sizeof(joblist)); new_job->next = NULL; new_job->sock = sock; @@ -4247,7 +4247,7 @@ allowed_globals.jobhead = new_job; allowed_globals.jobcount++; release_semaphore(allowed_globals.jobsemaphore); - release_mutex(allowed_globals.jobmutex); + ap_release_mutex(allowed_globals.jobmutex); } int remove_job() @@ -4278,10 +4278,10 @@ #ifdef UNGRACEFUL_RESTART if (!allowed_globals.jobhead) { #else - acquire_mutex(allowed_globals.jobmutex); + ap_acquire_mutex(allowed_globals.jobmutex); if (allowed_globals.exit_now && !allowed_globals.jobhead) { #endif - release_mutex(allowed_globals.jobmutex); + ap_release_mutex(allowed_globals.jobmutex); return (-1); } job = allowed_globals.jobhead; @@ -4289,7 +4289,7 @@ allowed_globals.jobhead = job->next; if (allowed_globals.jobhead == NULL) allowed_globals.jobtail = NULL; - release_mutex(allowed_globals.jobmutex); + ap_release_mutex(allowed_globals.jobmutex); sock = job->sock; free(job); return (sock); @@ -4325,9 +4325,9 @@ int dupped_csd = -1; int srv = 0; - ptrans = make_sub_pool(pconf); + ptrans = ap_make_sub_pool(pconf); - (void) update_child_status(child_num, SERVER_READY, (request_rec *) NULL); + (void) ap_update_child_status(child_num, SERVER_READY, (request_rec *) NULL); /* * Setup the jump buffers so that we can return here after @@ -4350,16 +4350,16 @@ * (Re)initialize this child to a pre-connection state. */ - set_callback_and_alarm(NULL, 0); /* Cancel any outstanding alarms. */ + ap_set_callback_and_alarm(NULL, 0); /* Cancel any outstanding alarms. */ timeout_req = NULL; /* No request in progress */ current_conn = NULL; #ifdef SIGPIPE signal(SIGPIPE, timeout); #endif - clear_pool(ptrans); + ap_clear_pool(ptrans); - (void) update_child_status(child_num, SERVER_READY, (request_rec *) NULL); + (void) ap_update_child_status(child_num, SERVER_READY, (request_rec *) NULL); /* Get job from the job list. This will block until a job is ready. * If -1 is returned then the main thread wants us to exit. @@ -4369,7 +4369,7 @@ break; /* time to exit */ requests_this_child++; - note_cleanups_for_socket(ptrans, csd); + ap_note_cleanups_for_socket(ptrans, csd); /* * We now have a connection, so set it up with the appropriate @@ -4378,7 +4378,7 @@ clen = sizeof(sa_server); if (getsockname(csd, &sa_server, &clen) < 0) { - aplog_error(APLOG_MARK, APLOG_WARNING, server_conf, "getsockname"); + ap_log_error(APLOG_MARK, APLOG_WARNING, server_conf, "getsockname"); continue; } clen = sizeof(sa_client); @@ -4390,20 +4390,20 @@ sock_disable_nagle(csd); - (void) update_child_status(child_num, SERVER_BUSY_READ, + (void) ap_update_child_status(child_num, SERVER_BUSY_READ, (request_rec *) NULL); - conn_io = bcreate(ptrans, B_RDWR | B_SOCKET); + conn_io = ap_bcreate(ptrans, B_RDWR | B_SOCKET); dupped_csd = csd; #if defined(NEED_DUPPED_CSD) if ((dupped_csd = dup(csd)) < 0) { - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "dup: couldn't duplicate csd"); dupped_csd = csd; /* Oh well... */ } - note_cleanups_for_socket(ptrans, dupped_csd); + ap_note_cleanups_for_socket(ptrans, dupped_csd); #endif - bpushfd(conn_io, csd, dupped_csd); + ap_bpushfd(conn_io, csd, dupped_csd); current_conn = new_connection(ptrans, server_conf, conn_io, (struct sockaddr_in *) &sa_client, @@ -4415,10 +4415,10 @@ * until no requests are left or we decide to close. */ - while ((r = read_request(current_conn)) != NULL) { - (void) update_child_status(child_num, SERVER_BUSY_WRITE, r); + while ((r = ap_read_request(current_conn)) != NULL) { + (void) ap_update_child_status(child_num, SERVER_BUSY_WRITE, r); - process_request(r); + ap_process_request(r); #if defined(STATUS) increment_counts(child_num, r); @@ -4427,11 +4427,11 @@ if (!current_conn->keepalive || current_conn->aborted) break; - destroy_pool(r->pool); - (void) update_child_status(child_num, SERVER_BUSY_KEEPALIVE, + ap_destroy_pool(r->pool); + (void) ap_update_child_status(child_num, SERVER_BUSY_KEEPALIVE, (request_rec *) NULL); - sync_scoreboard_image(); + ap_sync_scoreboard_image(); } /* @@ -4439,10 +4439,10 @@ * in our buffers. If possible, try to avoid a hard close until the * client has ACKed our FIN and/or has stopped sending us data. */ - kill_cleanups_for_socket(ptrans, csd); + ap_kill_cleanups_for_socket(ptrans, csd); #ifdef NO_LINGCLOSE - bclose(conn_io); /* just close it */ + ap_bclose(conn_io); /* just close it */ #else if (r && r->connection && !r->connection->aborted @@ -4452,13 +4452,13 @@ lingering_close(r); } else { - bsetflag(conn_io, B_EOUT, 1); - bclose(conn_io); + ap_bsetflag(conn_io, B_EOUT, 1); + ap_bclose(conn_io); } #endif } - destroy_pool(ptrans); - (void) update_child_status(child_num, SERVER_DEAD, NULL); + ap_destroy_pool(ptrans); + (void) ap_update_child_status(child_num, SERVER_DEAD, NULL); } @@ -4527,13 +4527,13 @@ int count_select_errors = 0; pool *pchild; - pchild = make_sub_pool(pconf); + pchild = ap_make_sub_pool(pconf); - standalone = 1; + ap_standalone = 1; sd = -1; - nthreads = threads_per_child; - max_jobs_after_exit_request = excess_requests_per_child; - max_jobs_per_exe = max_requests_per_child; + nthreads = ap_threads_per_child; + max_jobs_after_exit_request = ap_excess_requests_per_child; + max_jobs_per_exe = ap_max_requests_per_child; if (nthreads <= 0) nthreads = 40; if (max_jobs_per_exe <= 0) @@ -4549,25 +4549,25 @@ ++generation; copy_listeners(pconf); - restart_time = time(NULL); + ap_restart_time = time(NULL); reinit_scoreboard(pconf); - //acquire_mutex(start_mutex); + //ap_acquire_mutex(start_mutex); hObjects[0] = (HANDLE)start_mutex; hObjects[1] = (HANDLE)exit_event; rv = WaitForMultipleObjects(2, hObjects, FALSE, INFINITE); if (rv == WAIT_FAILED) { - aplog_error(APLOG_MARK,APLOG_ERR|APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_WIN32ERROR, server_conf, "Waiting for start_mutex or exit_event -- process will exit"); - destroy_pool(pchild); + ap_destroy_pool(pchild); cleanup_scoreboard(); exit(0); } if (rv == WAIT_OBJECT_0 + 1) { /* exit event signalled - exit now */ - destroy_pool(pchild); + ap_destroy_pool(pchild); cleanup_scoreboard(); exit(0); } @@ -4576,12 +4576,12 @@ setup_listeners(pconf); if (listenmaxfd == -1) { /* Help, no sockets were made, better log something and exit */ - aplog_error(APLOG_MARK, APLOG_CRIT|APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_CRIT|APLOG_NOERRNO, NULL, "No sockets were created for listening"); signal_parent(); /* tell parent to die */ - destroy_pool(pchild); + ap_destroy_pool(pchild); cleanup_scoreboard(); exit(0); } @@ -4601,10 +4601,10 @@ * - Exit */ - child_init_modules(pconf, server_conf); + ap_child_init_modules(pconf, server_conf); allowed_globals.jobsemaphore = create_semaphore(0); - allowed_globals.jobmutex = create_mutex(NULL); + allowed_globals.jobmutex = ap_create_mutex(NULL); /* spawn off the threads */ child_handles = (thread *) alloca(nthreads * sizeof(int)); @@ -4627,7 +4627,7 @@ if ((max_jobs_per_exe && (total_jobs > max_jobs_per_exe) && !start_exit)) { start_exit = 1; wait_time = 1; - release_mutex(start_mutex); + ap_release_mutex(start_mutex); start_mutex_released = 1; APD2("process PID %d: start mutex released\n", my_pid); } @@ -4677,10 +4677,10 @@ * select errors. This count is used to ensure we don't go into * a busy loop of continuour errors. */ - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, "select: (listen)"); + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "select: (listen)"); count_select_errors++; if (count_select_errors > MAX_SELECT_ERRORS) { - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, server_conf, "Too many errors in select loop. Child process exiting."); break; } @@ -4722,7 +4722,7 @@ #elif defined(ECONNABORTED) if (errno != ECONNABORTED) #endif - aplog_error(APLOG_MARK, APLOG_ERR, server_conf, + ap_log_error(APLOG_MARK, APLOG_ERR, server_conf, "accept: (client socket)"); } else { @@ -4736,7 +4736,7 @@ /* Get ready to shutdown and exit */ allowed_globals.exit_now = 1; if (!start_mutex_released) { - release_mutex(start_mutex); + ap_release_mutex(start_mutex); } #ifdef UNGRACEFUL_RESTART @@ -4770,10 +4770,10 @@ ap_assert(CloseHandle(allowed_globals.thread_exit_event)); #endif destroy_semaphore(allowed_globals.jobsemaphore); - destroy_mutex(allowed_globals.jobmutex); + ap_destroy_mutex(allowed_globals.jobmutex); - child_exit_modules(pconf, server_conf); - destroy_pool(pchild); + ap_child_exit_modules(pconf, server_conf); + ap_destroy_pool(pchild); cleanup_scoreboard(); @@ -4856,7 +4856,7 @@ int master_main(int argc, char **argv) { - int nchild = daemons_to_start; + int nchild = ap_daemons_to_start; event **ev; int *child; int child_num = 0; @@ -4879,13 +4879,13 @@ signal_event = OpenEvent(EVENT_ALL_ACCESS, FALSE, "apache-signal"); if (!signal_event) { - aplog_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK, APLOG_EMERG|APLOG_WIN32ERROR, server_conf, "Cannot open apache-signal event"); exit(1); } sprintf(buf, "Apache%d", getpid()); - start_mutex = create_mutex(buf); + start_mutex = ap_create_mutex(buf); ev = (event **) alloca(sizeof(event *) * nchild); child = (int *) alloca(sizeof(int) * (nchild+1)); while (processes_to_create--) { @@ -4899,14 +4899,14 @@ do { /* restart-pending */ if (!is_graceful) { - restart_time = time(NULL); + ap_restart_time = time(NULL); } - clear_pool(pconf); - pparent = make_sub_pool(pconf); + ap_clear_pool(pconf); + pparent = ap_make_sub_pool(pconf); - server_conf = read_config(pconf, pparent, server_confname); - open_logs(server_conf, pconf); - init_modules(pconf, server_conf); + server_conf = ap_read_config(pconf, pparent, ap_server_confname); + ap_open_logs(server_conf, pconf); + ap_init_modules(pconf, server_conf); if (!is_graceful) reinit_scoreboard(pconf); @@ -4921,7 +4921,7 @@ */ if (current_live_processes == 0) { /* Shouldn't happen, but better safe than sorry */ - aplog_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO, server_conf, + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO, server_conf, "master_main: no child processes alive! creating one"); create_process(process_handles, process_kill_events, ¤t_live_processes, &child_num, buf, argc, argv); if (processes_to_create) { @@ -4933,7 +4933,7 @@ FALSE, INFINITE); if (rv == WAIT_FAILED) { /* Something serious is wrong */ - aplog_error(APLOG_MARK,APLOG_CRIT|APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_WIN32ERROR, server_conf, "WaitForMultipeObjects on process handles and apache-signal -- doing shutdown"); shutdown_pending = 1; break; @@ -4958,7 +4958,7 @@ } } if (!shutdown_pending && !restart_pending) { - aplog_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO, server_conf, + ap_log_error(APLOG_MARK,APLOG_CRIT|APLOG_NOERRNO, server_conf, "master_main: no shutdown or restart variables set -- doing shutdown"); shutdown_pending = 1; } @@ -4967,7 +4967,7 @@ for (i = 0; i < current_live_processes; i++) { APD3("main process: signalling child #%d handle %d to die", i, process_handles[i]); if (SetEvent(process_kill_events[i]) == 0) - aplog_error(APLOG_MARK,APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK,APLOG_WIN32ERROR, server_conf, "SetEvent for child process in slot #%d", i); } @@ -4988,7 +4988,7 @@ for (i = 0; i < children_to_kill; i++) { APD3("main process: signalling child #%d handle %d to die", i, process_handles[i]); if (SetEvent(process_kill_events[i]) == 0) - aplog_error(APLOG_MARK,APLOG_WIN32ERROR, server_conf, + ap_log_error(APLOG_MARK,APLOG_WIN32ERROR, server_conf, "SetEvent for child process in slot #%d", i); } } @@ -5017,15 +5017,15 @@ cleanup_process(process_handles, process_kill_events, cld, ¤t_live_processes); } for (i = 0; i < current_live_processes; i++) { - aplog_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO, server_conf, + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO, server_conf, "forcing termination of child #%d (handle %d)", i, process_handles[i]); TerminateProcess((HANDLE) process_handles[i], 1); } service_set_status(SERVICE_STOPPED); - destroy_pool(pparent); + ap_destroy_pool(pparent); - destroy_mutex(start_mutex); + ap_destroy_mutex(start_mutex); return (0); } @@ -5044,12 +5044,12 @@ common_init(); - server_argv0 = argv[0]; + ap_server_argv0 = argv[0]; /* Get the serverroot from the registry, if it exists. This can be * overridden by a command line -d argument. */ - if (ap_registry_get_server_root(pconf, server_root, sizeof(server_root)) < 0) { + if (ap_registry_get_server_root(pconf, ap_server_root, sizeof(ap_server_root)) < 0) { /* The error has already been logged. Actually it won't have been, * because we haven't read the config files to find out where our * error log is. But we can't just ignore the error since we might @@ -5058,23 +5058,23 @@ exit(1); } - if (!*server_root) { - ap_cpystrn(server_root, HTTPD_ROOT, sizeof(server_root)); + if (!*ap_server_root) { + ap_cpystrn(ap_server_root, HTTPD_ROOT, sizeof(ap_server_root)); } - ap_cpystrn(server_confname, SERVER_CONFIG_FILE, sizeof(server_confname)); + ap_cpystrn(ap_server_confname, SERVER_CONFIG_FILE, sizeof(ap_server_confname)); - setup_prelinked_modules(); + ap_setup_prelinked_modules(); while ((c = getopt(argc, argv, "C:c:Xd:f:vVhlZ:ius")) != -1) { char **new; switch (c) { case 'c': - new = (char **)push_array(server_post_read_config); - *new = pstrdup(pcommands, optarg); + new = (char **)ap_push_array(ap_server_post_read_config); + *new = ap_pstrdup(pcommands, optarg); break; case 'C': - new = (char **)push_array(server_pre_read_config); - *new = pstrdup(pcommands, optarg); + new = (char **)ap_push_array(ap_server_pre_read_config); + *new = ap_pstrdup(pcommands, optarg); break; #ifdef WIN32 case 'Z': @@ -5083,7 +5083,7 @@ cp = strchr(optarg, '_'); ap_assert(cp); *cp = 0; - start_mutex = open_mutex(optarg); + start_mutex = ap_open_mutex(optarg); child = 1; break; case 'i': @@ -5097,23 +5097,23 @@ break; #endif /* WIN32 */ case 'd': - ap_cpystrn(server_root, optarg, sizeof(server_root)); + ap_cpystrn(ap_server_root, optarg, sizeof(ap_server_root)); break; case 'f': - ap_cpystrn(server_confname, optarg, sizeof(server_confname)); + ap_cpystrn(ap_server_confname, optarg, sizeof(ap_server_confname)); break; case 'v': - printf("Server version: %s\n", apapi_get_server_version()); - printf("Server built: %s\n", apapi_get_server_built()); + printf("Server version: %s\n", ap_get_server_version()); + printf("Server built: %s\n", ap_get_server_built()); exit(0); case 'V': show_compile_settings(); exit(0); case 'h': - show_directives(); + ap_show_directives(); exit(0); case 'l': - show_modules(); + ap_show_modules(); exit(0); case 'X': ++one_process; /* Weird debugging mode. */ @@ -5124,28 +5124,28 @@ } #ifdef __EMX__ - printf("%s \n", apapi_get_server_version()); + printf("%s \n", ap_get_server_version()); #endif #ifdef WIN32 if (!child) { - printf("%s \n", apapi_get_server_version()); + printf("%s \n", ap_get_server_version()); } #endif if (!child && run_as_service) { service_cd(); } - server_conf = read_config(pconf, ptrans, server_confname); - log_pid(pconf, pid_fname); - init_modules(pconf, server_conf); - suexec_enabled = init_suexec(); - open_logs(server_conf, pconf); + server_conf = ap_read_config(pconf, ptrans, ap_server_confname); + ap_log_pid(pconf, ap_pid_fname); + ap_init_modules(pconf, server_conf); + ap_suexec_enabled = init_suexec(); + ap_open_logs(server_conf, pconf); set_group_privs(); if (one_process && !exit_event) exit_event = create_event(0, 0, NULL); if (one_process && !start_mutex) - start_mutex = create_mutex(NULL); + start_mutex = ap_create_mutex(NULL); /* * In the future, the main will spawn off a couple * of children and monitor them. As soon as a child @@ -5155,7 +5155,7 @@ if (!exit_event || !start_mutex) exit(-1); worker_main(); - destroy_mutex(start_mutex); + ap_destroy_mutex(start_mutex); destroy_event(exit_event); } else { 1.211 +346 -346 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.210 retrieving revision 1.211 diff -u -r1.210 -r1.211 --- http_protocol.c 1998/04/08 06:30:47 1.210 +++ http_protocol.c 1998/04/11 12:00:30 1.211 @@ -78,7 +78,7 @@ #define SET_BYTES_SENT(r) \ do { if (r->sent_bodyct) \ - bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \ + ap_bgetopt (r->connection->client, BO_BYTECT, &r->bytes_sent); \ } while (0) @@ -119,7 +119,7 @@ static int internal_byterange(int, long *, request_rec *, char **, long *, long *); -API_EXPORT(int) set_byterange(request_rec *r) +API_EXPORT(int) ap_set_byterange(request_rec *r) { char *range, *if_range, *match; long range_start, range_end; @@ -137,52 +137,52 @@ * Navigator 2-3 and MSIE 3. */ - if (!(range = table_get(r->headers_in, "Range"))) - range = table_get(r->headers_in, "Request-Range"); + if (!(range = ap_table_get(r->headers_in, "Range"))) + range = ap_table_get(r->headers_in, "Request-Range"); if (!range || strncasecmp(range, "bytes=", 6)) { - table_setn(r->headers_out, "Accept-Ranges", "bytes"); + ap_table_setn(r->headers_out, "Accept-Ranges", "bytes"); return 0; } /* Check the If-Range header for Etag or Date */ - if ((if_range = table_get(r->headers_in, "If-Range"))) { + if ((if_range = ap_table_get(r->headers_in, "If-Range"))) { if (if_range[0] == '"') { - if (!(match = table_get(r->headers_out, "Etag")) || + if (!(match = ap_table_get(r->headers_out, "Etag")) || (strcasecmp(if_range, match) != 0)) return 0; } - else if (!(match = table_get(r->headers_out, "Last-Modified")) || + else if (!(match = ap_table_get(r->headers_out, "Last-Modified")) || (strcasecmp(if_range, match) != 0)) return 0; } if (!strchr(range, ',')) { /* A single range */ - if (!parse_byterange(pstrdup(r->pool, range + 6), r->clength, + if (!parse_byterange(ap_pstrdup(r->pool, range + 6), r->clength, &range_start, &range_end)) return 0; r->byterange = 1; - table_setn(r->headers_out, "Content-Range", - psprintf(r->pool, "bytes %ld-%ld/%ld", + ap_table_setn(r->headers_out, "Content-Range", + ap_psprintf(r->pool, "bytes %ld-%ld/%ld", range_start, range_end, r->clength)); - table_setn(r->headers_out, "Content-Length", - psprintf(r->pool, "%ld", range_end - range_start + 1)); + ap_table_setn(r->headers_out, "Content-Length", + ap_psprintf(r->pool, "%ld", range_end - range_start + 1)); } else { /* a multiple range */ - char *r_range = pstrdup(r->pool, range + 6); + char *r_range = ap_pstrdup(r->pool, range + 6); long tlength = 0; r->byterange = 2; - r->boundary = psprintf(r->pool, "%lx%lx", + r->boundary = ap_psprintf(r->pool, "%lx%lx", r->request_time, (long) getpid()); while (internal_byterange(0, &tlength, r, &r_range, NULL, NULL)); - table_setn(r->headers_out, "Content-Length", - psprintf(r->pool, "%ld", tlength)); + ap_table_setn(r->headers_out, "Content-Length", + ap_psprintf(r->pool, "%ld", tlength)); } r->status = PARTIAL_CONTENT; @@ -191,7 +191,7 @@ return 1; } -API_EXPORT(int) each_byterange(request_rec *r, long *offset, long *length) +API_EXPORT(int) ap_each_byterange(request_rec *r, long *offset, long *length) { return internal_byterange(1, NULL, r, &r->range, offset, length); } @@ -215,27 +215,27 @@ if (!**r_range) { if (r->byterange > 1) { if (realreq) - rvputs(r, "\015\012--", r->boundary, "--\015\012", NULL); + ap_rvputs(r, "\015\012--", r->boundary, "--\015\012", NULL); else *tlength += 4 + strlen(r->boundary) + 4; } return 0; } - range = getword_nc(r->pool, r_range, ','); + range = ap_getword_nc(r->pool, r_range, ','); if (!parse_byterange(range, r->clength, &range_start, &range_end)) /* Skip this one */ return internal_byterange(realreq, tlength, r, r_range, offset, length); if (r->byterange > 1) { - char *ct = r->content_type ? r->content_type : default_type(r); + char *ct = r->content_type ? r->content_type : ap_default_type(r); char ts[MAX_STRING_LEN]; ap_snprintf(ts, sizeof(ts), "%ld-%ld/%ld", range_start, range_end, r->clength); if (realreq) - rvputs(r, "\015\012--", r->boundary, "\015\012Content-type: ", + ap_rvputs(r, "\015\012--", r->boundary, "\015\012Content-type: ", ct, "\015\012Content-range: bytes ", ts, "\015\012\015\012", NULL); else @@ -253,19 +253,19 @@ return 1; } -API_EXPORT(int) set_content_length(request_rec *r, long clength) +API_EXPORT(int) ap_set_content_length(request_rec *r, long clength) { r->clength = clength; - table_setn(r->headers_out, "Content-Length", psprintf(r->pool, "%ld", clength)); + ap_table_setn(r->headers_out, "Content-Length", ap_psprintf(r->pool, "%ld", clength)); return 0; } -API_EXPORT(int) set_keepalive(request_rec *r) +API_EXPORT(int) ap_set_keepalive(request_rec *r) { int ka_sent = 0; - int wimpy = find_token(r->pool, - table_get(r->headers_out, "Connection"), "close"); - char *conn = table_get(r->headers_in, "Connection"); + int wimpy = ap_find_token(r->pool, + ap_table_get(r->headers_out, "Connection"), "close"); + char *conn = ap_table_get(r->headers_in, "Connection"); /* The following convoluted conditional determines whether or not * the current connection should remain persistent after this response @@ -296,9 +296,9 @@ ((r->status == HTTP_NOT_MODIFIED) || (r->status == HTTP_NO_CONTENT) || r->header_only || - table_get(r->headers_out, "Content-Length") || - find_last_token(r->pool, - table_get(r->headers_out, "Transfer-Encoding"), + ap_table_get(r->headers_out, "Content-Length") || + ap_find_last_token(r->pool, + ap_table_get(r->headers_out, "Transfer-Encoding"), "chunked") || ((r->proto_num >= HTTP_VERSION(1,1)) && (r->chunked = 1))) && r->server->keep_alive && @@ -307,10 +307,10 @@ (r->server->keep_alive_max > r->connection->keepalives)) && !status_drops_connection(r->status) && !wimpy && - !find_token(r->pool, conn, "close") && - (!table_get(r->subprocess_env, "nokeepalive") || - table_get(r->headers_in, "Via")) && - ((ka_sent = find_token(r->pool, conn, "keep-alive")) || + !ap_find_token(r->pool, conn, "close") && + (!ap_table_get(r->subprocess_env, "nokeepalive") || + ap_table_get(r->headers_in, "Via")) && + ((ka_sent = ap_find_token(r->pool, conn, "keep-alive")) || (r->proto_num >= HTTP_VERSION(1,1))) ) { int left = r->server->keep_alive_max - r->connection->keepalives; @@ -321,14 +321,14 @@ /* If they sent a Keep-Alive token, send one back */ if (ka_sent) { if (r->server->keep_alive_max) - table_setn(r->headers_out, "Keep-Alive", - psprintf(r->pool, "timeout=%d, max=%d", + ap_table_setn(r->headers_out, "Keep-Alive", + ap_psprintf(r->pool, "timeout=%d, max=%d", r->server->keep_alive_timeout, left)); else - table_setn(r->headers_out, "Keep-Alive", - psprintf(r->pool, "timeout=%d", + ap_table_setn(r->headers_out, "Keep-Alive", + ap_psprintf(r->pool, "timeout=%d", r->server->keep_alive_timeout)); - table_mergen(r->headers_out, "Connection", "Keep-Alive"); + ap_table_mergen(r->headers_out, "Connection", "Keep-Alive"); } return 1; @@ -343,7 +343,7 @@ * to a HTTP/1.1 client. Better safe than sorry. */ if (!wimpy) - table_mergen(r->headers_out, "Connection", "close"); + ap_table_mergen(r->headers_out, "Connection", "close"); r->connection->keepalive = 0; @@ -357,7 +357,7 @@ * to limit the number of calls to time(). We don't check for futurosity * unless the mtime is at least as new as the reference. */ -API_EXPORT(time_t) rationalize_mtime(request_rec *r, time_t mtime) +API_EXPORT(time_t) ap_rationalize_mtime(request_rec *r, time_t mtime) { time_t now; @@ -374,9 +374,9 @@ return (mtime > now) ? now : mtime; } -API_EXPORT(int) meets_conditions(request_rec *r) +API_EXPORT(int) ap_meets_conditions(request_rec *r) { - char *etag = table_get(r->headers_out, "ETag"); + char *etag = ap_table_get(r->headers_out, "ETag"); char *if_match, *if_modified_since, *if_unmodified, *if_nonematch; time_t mtime; @@ -402,9 +402,9 @@ * AND the field value is not "*" (meaning match anything), then * respond with a status of 412 (Precondition Failed). */ - if ((if_match = table_get(r->headers_in, "If-Match")) != NULL) { + if ((if_match = ap_table_get(r->headers_in, "If-Match")) != NULL) { if ((etag == NULL) || - ((if_match[0] != '*') && !find_token(r->pool, if_match, etag))) { + ((if_match[0] != '*') && !ap_find_token(r->pool, if_match, etag))) { return HTTP_PRECONDITION_FAILED; } } @@ -414,9 +414,9 @@ * specified in this field, then the server MUST * respond with a status of 412 (Precondition Failed). */ - if_unmodified = table_get(r->headers_in, "If-Unmodified-Since"); + if_unmodified = ap_table_get(r->headers_in, "If-Unmodified-Since"); if (if_unmodified != NULL) { - time_t ius = parseHTTPdate(if_unmodified); + time_t ius = ap_parseHTTPdate(if_unmodified); if ((ius != BAD_DATE) && (mtime > ius)) { return HTTP_PRECONDITION_FAILED; @@ -432,12 +432,12 @@ * For all other request methods, the server MUST * respond with a status of 412 (Precondition Failed). */ - if_nonematch = table_get(r->headers_in, "If-None-Match"); + if_nonematch = ap_table_get(r->headers_in, "If-None-Match"); if (if_nonematch != NULL) { int rstatus; if ((if_nonematch[0] == '*') - || ((etag != NULL) && find_token(r->pool, if_nonematch, etag))) { + || ((etag != NULL) && ap_find_token(r->pool, if_nonematch, etag))) { rstatus = (r->method_number == M_GET) ? HTTP_NOT_MODIFIED : HTTP_PRECONDITION_FAILED; return rstatus; @@ -452,8 +452,8 @@ */ else if ((r->method_number == M_GET) && ((if_modified_since = - table_get(r->headers_in, "If-Modified-Since")) != NULL)) { - time_t ims = parseHTTPdate(if_modified_since); + ap_table_get(r->headers_in, "If-Modified-Since")) != NULL)) { + time_t ims = ap_parseHTTPdate(if_modified_since); if ((ims >= mtime) && (ims <= r->request_time)) { return HTTP_NOT_MODIFIED; @@ -469,7 +469,7 @@ * could be modified again in as short an interval. We rationalize the * modification time we're given to keep it from being in the future. */ -API_EXPORT(void) set_etag(request_rec *r) +API_EXPORT(void) ap_set_etag(request_rec *r) { char *etag; char *weak; @@ -490,18 +490,18 @@ weak = (r->request_time - r->mtime > 1) ? "" : "W/"; if (r->finfo.st_mode != 0) { - etag = psprintf(r->pool, + etag = ap_psprintf(r->pool, "%s\"%lx-%lx-%lx\"", weak, (unsigned long) r->finfo.st_ino, (unsigned long) r->finfo.st_size, (unsigned long) r->mtime); } else { - etag = psprintf(r->pool, "%s\"%lx\"", weak, + etag = ap_psprintf(r->pool, "%s\"%lx\"", weak, (unsigned long) r->mtime); } - table_setn(r->headers_out, "ETag", etag); + ap_table_setn(r->headers_out, "ETag", etag); } /* @@ -509,12 +509,12 @@ * of the mtime field in the request structure - rationalized to keep it from * being in the future. */ -API_EXPORT(void) set_last_modified(request_rec *r) +API_EXPORT(void) ap_set_last_modified(request_rec *r) { - time_t mod_time = rationalize_mtime(r, r->mtime); + time_t mod_time = ap_rationalize_mtime(r, r->mtime); - table_setn(r->headers_out, "Last-Modified", - gm_timestr_822(r->pool, mod_time)); + ap_table_setn(r->headers_out, "Last-Modified", + ap_gm_timestr_822(r->pool, mod_time)); } /* Get a line of protocol input, including any continuation lines @@ -539,7 +539,7 @@ pos = s; do { - retval = bgets(pos, n, in); /* retval == -1 if error, 0 if EOF */ + retval = ap_bgets(pos, n, in); /* retval == -1 if error, 0 if EOF */ if (retval <= 0) return ((retval < 0) && (total == 0)) ? -1 : total; @@ -563,7 +563,7 @@ * the next line begins with a continuation character. */ } while (fold && (retval != 1) && (n > 1) - && (blookc(&next, in) == 1) + && (ap_blookc(&next, in) == 1) && ((next == ' ') || (next == '\t'))); return total; @@ -575,17 +575,17 @@ * - sets r->uri to request uri (without r->args part) * - sets r->hostname (if not set already) from request (scheme://host:port) */ -CORE_EXPORT(void) parse_uri(request_rec *r, const char *uri) +CORE_EXPORT(void) ap_parse_uri(request_rec *r, const char *uri) { int status = HTTP_OK; - r->unparsed_uri = pstrdup(r->pool, uri); + r->unparsed_uri = ap_pstrdup(r->pool, uri); if (r->method_number == M_CONNECT) { - status = parse_hostinfo_components(r->pool, uri, &r->parsed_uri); + status = ap_parse_hostinfo_components(r->pool, uri, &r->parsed_uri); } else { /* Simple syntax Errors in URLs are trapped by parse_uri_components(). */ - status = parse_uri_components(r->pool, uri, &r->parsed_uri); + status = ap_parse_uri_components(r->pool, uri, &r->parsed_uri); } if (is_HTTP_SUCCESS(status)) { @@ -598,7 +598,7 @@ } r->args = r->parsed_uri.query; r->uri = r->parsed_uri.path ? r->parsed_uri.path - : pstrdup(r->pool, "/"); + : ap_pstrdup(r->pool, "/"); #if defined(__EMX__) || defined(WIN32) /* Handle path translations for OS/2 and plug security hole. * This will prevent "http://www.wherever.com/..\..\/" from @@ -611,7 +611,7 @@ *x = '/'; #ifndef WIN32 /* for OS/2 only: */ /* Fix OS/2 HPFS filename case problem. */ - str_tolower(r->uri); + ap_str_tolower(r->uri); #endif } #endif /* __EMX__ || WIN32 */ @@ -620,7 +620,7 @@ r->args = NULL; r->hostname = NULL; r->status = status; /* set error status */ - r->uri = pstrdup(r->pool, uri); + r->uri = ap_pstrdup(r->pool, uri); } } @@ -646,10 +646,10 @@ * read(). B_SAFEREAD ensures that the BUFF layer flushes if it will * have to block during a read. */ - bsetflag(conn->client, B_SAFEREAD, 1); + ap_bsetflag(conn->client, B_SAFEREAD, 1); while ((len = getline(l, HUGE_STRING_LEN, conn->client, 0)) <= 0) { if ((len < 0) || bgetflag(conn->client, B_EOF)) { - bsetflag(conn->client, B_SAFEREAD, 0); + ap_bsetflag(conn->client, B_SAFEREAD, 0); return 0; } } @@ -657,19 +657,19 @@ #ifdef SIGUSR1 signal(SIGUSR1, SIG_IGN); #endif /* SIGUSR1 */ - bsetflag(conn->client, B_SAFEREAD, 0); + ap_bsetflag(conn->client, B_SAFEREAD, 0); if (len == (HUGE_STRING_LEN - 1)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "request failed for %s, reason: URI too long", - get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); r->status = HTTP_REQUEST_URI_TOO_LARGE; return 0; } r->request_time = time(NULL); - r->the_request = pstrdup(r->pool, l); - r->method = getword_white(r->pool, &ll); - uri = getword_white(r->pool, &ll); + r->the_request = ap_pstrdup(r->pool, l); + r->method = ap_getword_white(r->pool, &ll); + uri = ap_getword_white(r->pool, &ll); /* Provide quick information about the request method as soon as known */ if (!strcmp(r->method, "HEAD")) { @@ -693,10 +693,10 @@ else r->method_number = M_INVALID; /* Will eventually croak. */ - parse_uri(r, uri); + ap_parse_uri(r, uri); r->assbackwards = (ll[0] == '\0'); - r->protocol = pstrdup(r->pool, ll[0] ? ll : "HTTP/0.9"); + r->protocol = ap_pstrdup(r->pool, ll[0] ? ll : "HTTP/0.9"); if (2 == sscanf(r->protocol, "HTTP/%u.%u", &major, &minor) && minor < HTTP_VERSION(1,0)) /* don't allow HTTP/0.1000 */ r->proto_num = HTTP_VERSION(major, minor); @@ -719,7 +719,7 @@ * overflow (len == MAX_STRING_LEN-1)? */ while ((len = getline(field, MAX_STRING_LEN, c->client, 1)) > 0) { - char *copy = palloc(r->pool, len + 1); + char *copy = ap_palloc(r->pool, len + 1); memcpy(copy, field, len + 1); if (!(value = strchr(copy, ':'))) /* Find the colon separator */ @@ -730,18 +730,18 @@ while (isspace(*value)) ++value; /* Skip to start of value */ - table_mergen(r->headers_in, copy, value); + ap_table_mergen(r->headers_in, copy, value); } } -request_rec *read_request(conn_rec *conn) +request_rec *ap_read_request(conn_rec *conn) { request_rec *r; int access_status; pool *p; - p = make_sub_pool(conn->pool); - r = pcalloc(p, sizeof(request_rec)); + p = ap_make_sub_pool(conn->pool); + r = ap_pcalloc(p, sizeof(request_rec)); r->pool = p; r->connection = conn; conn->server = conn->base_server; @@ -751,15 +751,15 @@ conn->keepalive = 0; conn->user = NULL; - conn->auth_type = NULL; + conn->ap_auth_type = NULL; - r->headers_in = make_table(r->pool, 50); - r->subprocess_env = make_table(r->pool, 50); - r->headers_out = make_table(r->pool, 12); - r->err_headers_out = make_table(r->pool, 5); - r->notes = make_table(r->pool, 5); + r->headers_in = ap_make_table(r->pool, 50); + r->subprocess_env = ap_make_table(r->pool, 50); + r->headers_out = ap_make_table(r->pool, 12); + r->err_headers_out = ap_make_table(r->pool, 5); + r->notes = ap_make_table(r->pool, 5); - r->request_config = create_request_config(r->pool); + r->request_config = ap_create_request_config(r->pool); r->per_dir_config = r->server->lookup_defaults; r->sent_bodyct = 0; /* bytect isn't for body */ @@ -772,33 +772,33 @@ /* Get the request... */ #ifdef CHARSET_EBCDIC - bsetflag(r->connection->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1); + ap_bsetflag(r->connection->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1); #endif /* CHARSET_EBCDIC */ - keepalive_timeout("read request line", r); + ap_keepalive_timeout("read request line", r); if (!read_request_line(r)) { - kill_timeout(r); + ap_kill_timeout(r); return NULL; } if (!r->assbackwards) { - hard_timeout("read request headers", r); + ap_hard_timeout("read request headers", r); get_mime_headers(r); } - kill_timeout(r); + ap_kill_timeout(r); r->status = HTTP_OK; /* Until further notice. */ /* update what we think the virtual host is based on the headers we've * now read */ - update_vhost_from_headers(r); + ap_update_vhost_from_headers(r); /* we may have switched to another server */ r->per_dir_config = r->server->lookup_defaults; conn->keptalive = 0; /* We now have a request to play with */ - if ((access_status = run_post_read_request(r))) { - die(access_status, r); + if ((access_status = ap_run_post_read_request(r))) { + ap_die(access_status, r); return NULL; } @@ -812,7 +812,7 @@ * *someone* has to set the protocol-specific fields... */ -void set_sub_req_protocol(request_rec *rnew, const request_rec *r) +void ap_set_sub_req_protocol(request_rec *rnew, const request_rec *r) { rnew->the_request = r->the_request; /* Keep original request-line */ @@ -826,10 +826,10 @@ rnew->status = HTTP_OK; rnew->headers_in = r->headers_in; - rnew->subprocess_env = copy_table(rnew->pool, r->subprocess_env); - rnew->headers_out = make_table(rnew->pool, 5); - rnew->err_headers_out = make_table(rnew->pool, 5); - rnew->notes = make_table(rnew->pool, 5); + rnew->subprocess_env = ap_copy_table(rnew->pool, r->subprocess_env); + rnew->headers_out = ap_make_table(rnew->pool, 5); + rnew->err_headers_out = ap_make_table(rnew->pool, 5); + rnew->notes = ap_make_table(rnew->pool, 5); rnew->read_length = r->read_length; rnew->read_body = REQUEST_NO_BODY; @@ -837,7 +837,7 @@ rnew->main = (request_rec *) r; } -void finalize_sub_req_protocol(request_rec *sub) +void ap_finalize_sub_req_protocol(request_rec *sub) { SET_BYTES_SENT(sub->main); } @@ -846,69 +846,69 @@ * Support for the Basic authentication protocol, and a bit for Digest. */ -API_EXPORT(void) note_auth_failure(request_rec *r) +API_EXPORT(void) ap_note_auth_failure(request_rec *r) { - if (!strcasecmp(auth_type(r), "Basic")) - note_basic_auth_failure(r); - else if (!strcasecmp(auth_type(r), "Digest")) - note_digest_auth_failure(r); + if (!strcasecmp(ap_auth_type(r), "Basic")) + ap_note_basic_auth_failure(r); + else if (!strcasecmp(ap_auth_type(r), "Digest")) + ap_note_digest_auth_failure(r); } -API_EXPORT(void) note_basic_auth_failure(request_rec *r) +API_EXPORT(void) ap_note_basic_auth_failure(request_rec *r) { - if (strcasecmp(auth_type(r), "Basic")) - note_auth_failure(r); + if (strcasecmp(ap_auth_type(r), "Basic")) + ap_note_auth_failure(r); else - table_setn(r->err_headers_out, + ap_table_setn(r->err_headers_out, r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", - pstrcat(r->pool, "Basic realm=\"", auth_name(r), "\"", + ap_pstrcat(r->pool, "Basic realm=\"", ap_auth_name(r), "\"", NULL)); } -API_EXPORT(void) note_digest_auth_failure(request_rec *r) +API_EXPORT(void) ap_note_digest_auth_failure(request_rec *r) { - table_setn(r->err_headers_out, + ap_table_setn(r->err_headers_out, r->proxyreq ? "Proxy-Authenticate" : "WWW-Authenticate", - psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%lu\"", - auth_name(r), r->request_time)); + ap_psprintf(r->pool, "Digest realm=\"%s\", nonce=\"%lu\"", + ap_auth_name(r), r->request_time)); } -API_EXPORT(int) get_basic_auth_pw(request_rec *r, char **pw) +API_EXPORT(int) ap_get_basic_auth_pw(request_rec *r, char **pw) { - const char *auth_line = table_get(r->headers_in, + const char *auth_line = ap_table_get(r->headers_in, r->proxyreq ? "Proxy-Authorization" : "Authorization"); char *t; - if (!(t = auth_type(r)) || strcasecmp(t, "Basic")) + if (!(t = ap_auth_type(r)) || strcasecmp(t, "Basic")) return DECLINED; - if (!auth_name(r)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, + if (!ap_auth_name(r)) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "need AuthName: %s", r->uri); return SERVER_ERROR; } if (!auth_line) { - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } - if (strcasecmp(getword(r->pool, &auth_line, ' '), "Basic")) { + if (strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Basic")) { /* Client tried to authenticate using wrong auth scheme */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "client used wrong authentication scheme: %s", r->uri); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } - t = uudecode(r->pool, auth_line); + t = ap_uudecode(r->pool, auth_line); /* Note that this allocation has to be made from r->connection->pool * because it has the lifetime of the connection. The other allocations * are temporary and can be tossed away any time. */ - r->connection->user = getword_nulls_nc (r->connection->pool, &t, ':'); - r->connection->auth_type = "Basic"; + r->connection->user = ap_getword_nulls_nc (r->connection->pool, &t, ':'); + r->connection->ap_auth_type = "Basic"; *pw = t; @@ -972,7 +972,7 @@ * If that sad event occurs, replace the code below with a linear search * from status_lines[shortcut[i]] to status_lines[shortcut[i+1]-1]; */ -API_EXPORT(int) index_of_response(int status) +API_EXPORT(int) ap_index_of_response(int status) { static int shortcut[6] = {0, LEVEL_200, LEVEL_300, LEVEL_400, LEVEL_500, RESPONSE_CODES}; @@ -999,14 +999,14 @@ * In other words, don't change this one without checking table_do in alloc.c. * It returns true unless there was a write error of some kind. */ -API_EXPORT_NONSTD(int) send_header_field(request_rec *r, +API_EXPORT_NONSTD(int) ap_send_header_field(request_rec *r, const char *fieldname, const char *fieldval) { - return (0 < bvputs(r->connection->client, + return (0 < ap_bvputs(r->connection->client, fieldname, ": ", fieldval, "\015\012", NULL)); } -API_EXPORT(void) basic_http_header(request_rec *r) +API_EXPORT(void) ap_basic_http_header(request_rec *r) { char *protocol; #ifdef CHARSET_EBCDIC @@ -1017,14 +1017,14 @@ return; if (!r->status_line) - r->status_line = status_lines[index_of_response(r->status)]; + r->status_line = status_lines[ap_index_of_response(r->status)]; /* mod_proxy is only HTTP/1.0, so avoid sending HTTP/1.1 error response; * kluge around broken browsers when indicated by force-response-1.0 */ if (r->proxyreq || (r->proto_num == HTTP_VERSION(1,0) - && table_get(r->subprocess_env, "force-response-1.0"))) { + && ap_table_get(r->subprocess_env, "force-response-1.0"))) { protocol = "HTTP/1.0"; r->connection->keepalive = -1; @@ -1033,22 +1033,22 @@ protocol = SERVER_PROTOCOL; #ifdef CHARSET_EBCDIC - bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); #endif /*CHARSET_EBCDIC*/ /* Output the HTTP/1.x Status-Line and the Date and Server fields */ - bvputs(r->connection->client, + ap_bvputs(r->connection->client, protocol, " ", r->status_line, "\015\012", NULL); - send_header_field(r, "Date", gm_timestr_822(r->pool, r->request_time)); - send_header_field(r, "Server", apapi_get_server_version()); + ap_send_header_field(r, "Date", ap_gm_timestr_822(r->pool, r->request_time)); + ap_send_header_field(r, "Server", ap_get_server_version()); - table_unset(r->headers_out, "Date"); /* Avoid bogosity */ - table_unset(r->headers_out, "Server"); + ap_table_unset(r->headers_out, "Date"); /* Avoid bogosity */ + ap_table_unset(r->headers_out, "Server"); #ifdef CHARSET_EBCDIC if (!convert) - bsetflag(r->connection->client, B_EBCDIC2ASCII, convert); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert); #endif /*CHARSET_EBCDIC*/ } @@ -1073,11 +1073,11 @@ { long int bs; - bgetopt(client, BO_BYTECT, &bs); + ap_bgetopt(client, BO_BYTECT, &bs); if (bs >= 255 && bs <= 257) - bputs("X-Pad: avoid browser bug\015\012", client); + ap_bputs("X-Pad: avoid browser bug\015\012", client); - bputs("\015\012", client); /* Send the terminating empty line */ + ap_bputs("\015\012", client); /* Send the terminating empty line */ } /* Build the Allow field-value from the request handler method mask. @@ -1085,7 +1085,7 @@ */ static char *make_allow(request_rec *r) { - return 2 + pstrcat(r->pool, + return 2 + ap_pstrcat(r->pool, (r->allowed & (1 << M_GET)) ? ", GET, HEAD" : "", (r->allowed & (1 << M_POST)) ? ", POST" : "", (r->allowed & (1 << M_PUT)) ? ", PUT" : "", @@ -1095,7 +1095,7 @@ NULL); } -int send_http_trace(request_rec *r) +int ap_send_http_trace(request_rec *r) { int rv; @@ -1103,48 +1103,48 @@ while (r->prev) r = r->prev; - if ((rv = setup_client_block(r, REQUEST_NO_BODY))) + if ((rv = ap_setup_client_block(r, REQUEST_NO_BODY))) return rv; - hard_timeout("send TRACE", r); + ap_hard_timeout("send TRACE", r); r->content_type = "message/http"; - send_http_header(r); + ap_send_http_header(r); /* Now we recreate the request, and echo it back */ - rvputs(r, r->the_request, "\015\012", NULL); + ap_rvputs(r, r->the_request, "\015\012", NULL); - table_do((int (*) (void *, const char *, const char *)) send_header_field, + ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, (void *) r, r->headers_in, NULL); - bputs("\015\012", r->connection->client); + ap_bputs("\015\012", r->connection->client); - kill_timeout(r); + ap_kill_timeout(r); return OK; } -int send_http_options(request_rec *r) +int ap_send_http_options(request_rec *r) { const long int zero = 0L; if (r->assbackwards) return DECLINED; - hard_timeout("send OPTIONS", r); + ap_hard_timeout("send OPTIONS", r); - basic_http_header(r); + ap_basic_http_header(r); - table_setn(r->headers_out, "Content-Length", "0"); - table_setn(r->headers_out, "Allow", make_allow(r)); - set_keepalive(r); + ap_table_setn(r->headers_out, "Content-Length", "0"); + ap_table_setn(r->headers_out, "Allow", make_allow(r)); + ap_set_keepalive(r); - table_do((int (*) (void *, const char *, const char *)) send_header_field, + ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, (void *) r, r->headers_out, NULL); terminate_header(r->connection->client); - kill_timeout(r); - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_kill_timeout(r); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); return OK; } @@ -1159,12 +1159,12 @@ static int use_range_x(request_rec *r) { char *ua; - return (table_get(r->headers_in, "Request-Range") || - ((ua = table_get(r->headers_in, "User-Agent")) + return (ap_table_get(r->headers_in, "Request-Range") || + ((ua = ap_table_get(r->headers_in, "User-Agent")) && strstr(ua, "MSIE 3"))); } -API_EXPORT(void) send_http_header(request_rec *r) +API_EXPORT(void) ap_send_http_header(request_rec *r) { int i; const long int zero = 0L; @@ -1174,7 +1174,7 @@ if (r->assbackwards) { if (!r->main) - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; return; } @@ -1185,71 +1185,71 @@ * later attempts to set or unset a given fieldname might be bypassed. */ if (!is_empty_table(r->err_headers_out)) - r->headers_out = overlay_tables(r->pool, r->err_headers_out, + r->headers_out = ap_overlay_tables(r->pool, r->err_headers_out, r->headers_out); - hard_timeout("send headers", r); + ap_hard_timeout("send headers", r); - basic_http_header(r); + ap_basic_http_header(r); #ifdef CHARSET_EBCDIC - bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); #endif /*CHARSET_EBCDIC*/ - set_keepalive(r); + ap_set_keepalive(r); if (r->chunked) { - table_mergen(r->headers_out, "Transfer-Encoding", "chunked"); - table_unset(r->headers_out, "Content-Length"); + ap_table_mergen(r->headers_out, "Transfer-Encoding", "chunked"); + ap_table_unset(r->headers_out, "Content-Length"); } if (r->byterange > 1) - table_setn(r->headers_out, "Content-Type", - pstrcat(r->pool, "multipart", use_range_x(r) ? "/x-" : "/", + ap_table_setn(r->headers_out, "Content-Type", + ap_pstrcat(r->pool, "multipart", use_range_x(r) ? "/x-" : "/", "byteranges; boundary=", r->boundary, NULL)); else if (r->content_type) - table_setn(r->headers_out, "Content-Type", r->content_type); + ap_table_setn(r->headers_out, "Content-Type", r->content_type); else - table_setn(r->headers_out, "Content-Type", default_type(r)); + ap_table_setn(r->headers_out, "Content-Type", ap_default_type(r)); if (r->content_encoding) - table_setn(r->headers_out, "Content-Encoding", r->content_encoding); + ap_table_setn(r->headers_out, "Content-Encoding", r->content_encoding); if (r->content_languages && r->content_languages->nelts) { for (i = 0; i < r->content_languages->nelts; ++i) { - table_mergen(r->headers_out, "Content-Language", + ap_table_mergen(r->headers_out, "Content-Language", ((char **) (r->content_languages->elts))[i]); } } else if (r->content_language) - table_setn(r->headers_out, "Content-Language", r->content_language); + ap_table_setn(r->headers_out, "Content-Language", r->content_language); /* * Control cachability for non-cachable responses if not already set by * some other part of the server configuration. */ - if (r->no_cache && !table_get(r->headers_out, "Expires")) - table_addn(r->headers_out, "Expires", - gm_timestr_822(r->pool, r->request_time)); + if (r->no_cache && !ap_table_get(r->headers_out, "Expires")) + ap_table_addn(r->headers_out, "Expires", + ap_gm_timestr_822(r->pool, r->request_time)); /* Send the entire table of header fields, terminated by an empty line. */ - table_do((int (*) (void *, const char *, const char *)) send_header_field, + ap_table_do((int (*) (void *, const char *, const char *)) ap_send_header_field, (void *) r, r->headers_out, NULL); terminate_header(r->connection->client); - kill_timeout(r); + ap_kill_timeout(r); - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; /* Whatever follows is real body stuff... */ /* Set buffer flags for the body */ if (r->chunked) - bsetflag(r->connection->client, B_CHUNK, 1); + ap_bsetflag(r->connection->client, B_CHUNK, 1); #ifdef CHARSET_EBCDIC if (!convert) - bsetflag(r->connection->client, B_EBCDIC2ASCII, convert); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert); #endif /*CHARSET_EBCDIC*/ } @@ -1258,20 +1258,20 @@ * information for any wrappers around the response message body * (i.e., transfer encodings). It should have been named finalize_response. */ -void finalize_request_protocol(request_rec *r) +void ap_finalize_request_protocol(request_rec *r) { if (r->chunked && !r->connection->aborted) { /* * Turn off chunked encoding --- we can only do this once. */ r->chunked = 0; - bsetflag(r->connection->client, B_CHUNK, 0); + ap_bsetflag(r->connection->client, B_CHUNK, 0); - soft_timeout("send ending chunk", r); - bputs("0\015\012", r->connection->client); + ap_soft_timeout("send ending chunk", r); + ap_bputs("0\015\012", r->connection->client); /* If we had footer "headers", we'd send them now */ - bputs("\015\012", r->connection->client); - kill_timeout(r); + ap_bputs("\015\012", r->connection->client); + ap_kill_timeout(r); } } @@ -1314,10 +1314,10 @@ * If an error occurs on input, we force an end to keepalive. */ -API_EXPORT(int) setup_client_block(request_rec *r, int read_policy) +API_EXPORT(int) ap_setup_client_block(request_rec *r, int read_policy) { - char *tenc = table_get(r->headers_in, "Transfer-Encoding"); - char *lenp = table_get(r->headers_in, "Content-Length"); + char *tenc = ap_table_get(r->headers_in, "Transfer-Encoding"); + char *lenp = ap_table_get(r->headers_in, "Content-Length"); r->read_body = read_policy; r->read_chunked = 0; @@ -1325,12 +1325,12 @@ if (tenc) { if (strcasecmp(tenc, "chunked")) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Unknown Transfer-Encoding %s", tenc); return HTTP_NOT_IMPLEMENTED; } if (r->read_body == REQUEST_CHUNKED_ERROR) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "chunked Transfer-Encoding forbidden: %s", r->uri); return (lenp) ? HTTP_BAD_REQUEST : HTTP_LENGTH_REQUIRED; } @@ -1343,7 +1343,7 @@ while (isdigit(*pos) || isspace(*pos)) ++pos; if (*pos != '\0') { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid Content-Length %s", lenp); return HTTP_BAD_REQUEST; } @@ -1353,7 +1353,7 @@ if ((r->read_body == REQUEST_NO_BODY) && (r->read_chunked || (r->remaining > 0))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "%s with body is not allowed for %s", r->method, r->uri); return HTTP_REQUEST_ENTITY_TOO_LARGE; } @@ -1361,7 +1361,7 @@ return OK; } -API_EXPORT(int) should_client_block(request_rec *r) +API_EXPORT(int) ap_should_client_block(request_rec *r) { /* First check if we have already read the request body */ @@ -1370,10 +1370,10 @@ if (r->proto_num >= HTTP_VERSION(1,1)) { /* sending 100 Continue interim response */ - bvputs(r->connection->client, + ap_bvputs(r->connection->client, SERVER_PROTOCOL, " ", status_lines[0], "\015\012\015\012", NULL); - bflush(r->connection->client); + ap_bflush(r->connection->client); } return 1; @@ -1413,7 +1413,7 @@ * hold a chunk-size line, including any extensions. For now, we'll leave * that to the caller, at least until we can come up with a better solution. */ -API_EXPORT(long) get_client_block(request_rec *r, char *buffer, int bufsiz) +API_EXPORT(long) ap_get_client_block(request_rec *r, char *buffer, int bufsiz) { int c; long len_read, len_to_read; @@ -1421,7 +1421,7 @@ if (!r->read_chunked) { /* Content-length read */ len_to_read = (r->remaining > bufsiz) ? bufsiz : r->remaining; - len_read = bread(r->connection->client, buffer, len_to_read); + len_read = ap_bread(r->connection->client, buffer, len_to_read); if (len_read <= 0) { if (len_read < 0) r->connection->keepalive = -1; @@ -1457,9 +1457,9 @@ if (r->read_body == REQUEST_CHUNKED_DECHUNK) { get_mime_headers(r); ap_snprintf(buffer, bufsiz, "%ld", r->read_length); - table_unset(r->headers_in, "Transfer-Encoding"); - table_setn(r->headers_in, "Content-Length", - pstrdup(r->pool, buffer)); + ap_table_unset(r->headers_in, "Transfer-Encoding"); + ap_table_setn(r->headers_in, "Content-Length", + ap_pstrdup(r->pool, buffer)); return 0; } r->remaining = -1; /* Indicate footers in-progress */ @@ -1519,7 +1519,7 @@ len_to_read = (r->remaining > bufsiz) ? bufsiz : r->remaining; - len_read = bread(r->connection->client, buffer, len_to_read); + len_read = ap_bread(r->connection->client, buffer, len_to_read); if (len_read <= 0) { r->connection->keepalive = -1; return -1; @@ -1558,20 +1558,20 @@ * if ((retval = discard_request_body(r)) != OK) * return retval; */ -API_EXPORT(int) discard_request_body(request_rec *r) +API_EXPORT(int) ap_discard_request_body(request_rec *r) { int rv; - if ((rv = setup_client_block(r, REQUEST_CHUNKED_PASS))) + if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_PASS))) return rv; - if (should_client_block(r)) { + if (ap_should_client_block(r)) { char dumpbuf[HUGE_STRING_LEN]; - hard_timeout("reading request body", r); - while ((rv = get_client_block(r, dumpbuf, HUGE_STRING_LEN)) > 0) + ap_hard_timeout("reading request body", r); + while ((rv = ap_get_client_block(r, dumpbuf, HUGE_STRING_LEN)) > 0) continue; - kill_timeout(r); + ap_kill_timeout(r); if (rv < 0) return HTTP_BAD_REQUEST; @@ -1582,12 +1582,12 @@ /* * Send the body of a response to the client. */ -API_EXPORT(long) send_fd(FILE *f, request_rec *r) +API_EXPORT(long) ap_send_fd(FILE *f, request_rec *r) { - return send_fd_length(f, r, -1); + return ap_send_fd_length(f, r, -1); } -API_EXPORT(long) send_fd_length(FILE *f, request_rec *r, long length) +API_EXPORT(long) ap_send_fd_length(FILE *f, request_rec *r, long length) { char buf[IOBUFSIZE]; long total_bytes_sent = 0; @@ -1596,7 +1596,7 @@ if (length == 0) return 0; - soft_timeout("send body", r); + ap_soft_timeout("send body", r); while (!r->connection->aborted) { if ((length > 0) && (total_bytes_sent + IOBUFSIZE) > length) @@ -1614,9 +1614,9 @@ o = 0; while (n && !r->connection->aborted) { - w = bwrite(r->connection->client, &buf[o], n); + w = ap_bwrite(r->connection->client, &buf[o], n); if (w > 0) { - reset_timeout(r); /* reset timeout after successful write */ + ap_reset_timeout(r); /* reset timeout after successful write */ total_bytes_sent += w; n -= w; o += w; @@ -1627,12 +1627,12 @@ else if (errno == EAGAIN) continue; else { - aplog_error(APLOG_MARK, APLOG_INFO, r->server, + ap_log_error(APLOG_MARK, APLOG_INFO, r->server, "%s client stopped connection before send body completed", - get_remote_host(r->connection, + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); - bsetflag(r->connection->client, B_EOUT, 1); + ap_bsetflag(r->connection->client, B_EOUT, 1); r->connection->aborted = 1; break; } @@ -1640,7 +1640,7 @@ } } - kill_timeout(r); + ap_kill_timeout(r); SET_BYTES_SENT(r); return total_bytes_sent; } @@ -1648,12 +1648,12 @@ /* * Send the body of a response to the client. */ -API_EXPORT(long) send_fb(BUFF *fb, request_rec *r) +API_EXPORT(long) ap_send_fb(BUFF *fb, request_rec *r) { - return send_fb_length(fb, r, -1); + return ap_send_fb_length(fb, r, -1); } -API_EXPORT(long) send_fb_length(BUFF *fb, request_rec *r, long length) +API_EXPORT(long) ap_send_fb_length(BUFF *fb, request_rec *r, long length) { char buf[IOBUFSIZE]; long total_bytes_sent = 0; @@ -1664,12 +1664,12 @@ return 0; /* Make fb unbuffered and non-blocking */ - bsetflag(fb, B_RD, 0); - bnonblock(fb, B_RD); - fd = bfileno(fb, B_RD); + ap_bsetflag(fb, B_RD, 0); + ap_bnonblock(fb, B_RD); + fd = ap_bfileno(fb, B_RD); #ifndef WIN32 if (fd >= FD_SETSIZE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, "send body: filedescriptor (%u) larger than FD_SETSIZE (%u) " "found, you probably need to rebuild Apache with a " "larger FD_SETSIZE", fd, FD_SETSIZE); @@ -1677,7 +1677,7 @@ } #endif - soft_timeout("send body", r); + ap_soft_timeout("send body", r); FD_ZERO(&fds); while (!r->connection->aborted) { @@ -1687,13 +1687,13 @@ len = IOBUFSIZE; do { - n = bread(fb, buf, len); + n = ap_bread(fb, buf, len); if (n >= 0 || r->connection->aborted) break; if (n < 0 && errno != EAGAIN) break; /* we need to block, so flush the output first */ - bflush(r->connection->client); + ap_bflush(r->connection->client); if (r->connection->aborted) break; FD_SET(fd, &fds); @@ -1712,9 +1712,9 @@ total_bytes_sent += n; while (n && !r->connection->aborted) { - w = bwrite(r->connection->client, &buf[o], n); + w = ap_bwrite(r->connection->client, &buf[o], n); if (w > 0) { - reset_timeout(r); /* reset timeout after successful + ap_reset_timeout(r); /* reset timeout after successful * write */ n -= w; o += w; @@ -1725,12 +1725,12 @@ else if (errno == EAGAIN) continue; else { - aplog_error(APLOG_MARK, APLOG_INFO, r->server, + ap_log_error(APLOG_MARK, APLOG_INFO, r->server, "%s client stopped connection before send body completed", - get_remote_host(r->connection, + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); - bsetflag(r->connection->client, B_EOUT, 1); + ap_bsetflag(r->connection->client, B_EOUT, 1); r->connection->aborted = 1; break; } @@ -1738,7 +1738,7 @@ } } - kill_timeout(r); + ap_kill_timeout(r); SET_BYTES_SENT(r); return total_bytes_sent; } @@ -1759,7 +1759,7 @@ #endif /* send data from an in-memory buffer */ -API_EXPORT(size_t) send_mmap(void *mm, request_rec *r, size_t offset, +API_EXPORT(size_t) ap_send_mmap(void *mm, request_rec *r, size_t offset, size_t length) { size_t total_bytes_sent = 0; @@ -1768,7 +1768,7 @@ if (length == 0) return 0; - soft_timeout("send mmap", r); + ap_soft_timeout("send mmap", r); length += offset; while (!r->connection->aborted && offset < length) { @@ -1780,9 +1780,9 @@ } while (n && !r->connection->aborted) { - w = bwrite(r->connection->client, (char *) mm + offset, n); + w = ap_bwrite(r->connection->client, (char *) mm + offset, n); if (w > 0) { - reset_timeout(r); /* reset timeout after successful write */ + ap_reset_timeout(r); /* reset timeout after successful write */ total_bytes_sent += w; n -= w; offset += w; @@ -1793,12 +1793,12 @@ else if (errno == EAGAIN) continue; else { - aplog_error(APLOG_MARK, APLOG_INFO, r->server, + ap_log_error(APLOG_MARK, APLOG_INFO, r->server, "%s client stopped connection before send mmap completed", - get_remote_host(r->connection, + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME)); - bsetflag(r->connection->client, B_EOUT, 1); + ap_bsetflag(r->connection->client, B_EOUT, 1); r->connection->aborted = 1; break; } @@ -1806,12 +1806,12 @@ } } - kill_timeout(r); + ap_kill_timeout(r); SET_BYTES_SENT(r); return total_bytes_sent; } -API_EXPORT(int) rputc(int c, request_rec *r) +API_EXPORT(int) ap_rputc(int c, request_rec *r) { if (r->connection->aborted) return EOF; @@ -1820,28 +1820,28 @@ return c; } -API_EXPORT(int) rputs(const char *str, request_rec *r) +API_EXPORT(int) ap_rputs(const char *str, request_rec *r) { int rcode; if (r->connection->aborted) return EOF; - rcode = bputs(str, r->connection->client); + rcode = ap_bputs(str, r->connection->client); SET_BYTES_SENT(r); return rcode; } -API_EXPORT(int) rwrite(const void *buf, int nbyte, request_rec *r) +API_EXPORT(int) ap_rwrite(const void *buf, int nbyte, request_rec *r) { int n; if (r->connection->aborted) return EOF; - n = bwrite(r->connection->client, buf, nbyte); + n = ap_bwrite(r->connection->client, buf, nbyte); SET_BYTES_SENT(r); return n; } -API_EXPORT(int) rprintf(request_rec *r, const char *fmt,...) +API_EXPORT(int) ap_rprintf(request_rec *r, const char *fmt,...) { va_list vlist; int n; @@ -1849,13 +1849,13 @@ if (r->connection->aborted) return EOF; va_start(vlist, fmt); - n = vbprintf(r->connection->client, fmt, vlist); + n = ap_vbprintf(r->connection->client, fmt, vlist); va_end(vlist); SET_BYTES_SENT(r); return n; } -API_EXPORT_NONSTD(int) rvputs(request_rec *r,...) +API_EXPORT_NONSTD(int) ap_rvputs(request_rec *r,...) { va_list args; int i, j, k; @@ -1871,7 +1871,7 @@ if (x == NULL) break; j = strlen(x); - i = bwrite(fb, x, j); + i = ap_bwrite(fb, x, j); if (i != j) { va_end(args); return -1; @@ -1884,9 +1884,9 @@ return k; } -API_EXPORT(int) rflush(request_rec *r) +API_EXPORT(int) ap_rflush(request_rec *r) { - return bflush(r->connection->client); + return ap_bflush(r->connection->client); } /* We should have named this send_canned_response, since it is used for any @@ -1895,13 +1895,13 @@ * and 5xx (server error) messages that have not been redirected to another * handler via the ErrorDocument feature. */ -void send_error_response(request_rec *r, int recursive_error) +void ap_send_error_response(request_rec *r, int recursive_error) { BUFF *fd = r->connection->client; int status = r->status; - int idx = index_of_response(status); + int idx = ap_index_of_response(status); char *custom_response; - char *location = table_get(r->headers_out, "Location"); + char *location = ap_table_get(r->headers_out, "Location"); /* We need to special-case the handling of 204 and 304 responses, * since they have specific HTTP requirements and do not include a @@ -1909,14 +1909,14 @@ */ if (status == HTTP_NOT_MODIFIED) { if (!is_empty_table(r->err_headers_out)) - r->headers_out = overlay_tables(r->pool, r->err_headers_out, + r->headers_out = ap_overlay_tables(r->pool, r->err_headers_out, r->headers_out); - hard_timeout("send 304", r); + ap_hard_timeout("send 304", r); - basic_http_header(r); - set_keepalive(r); + ap_basic_http_header(r); + ap_set_keepalive(r); - table_do((int (*)(void *, const char *, const char *))send_header_field, + ap_table_do((int (*)(void *, const char *, const char *))ap_send_header_field, (void *) r, r->headers_out, "Connection", "Keep-Alive", @@ -1932,13 +1932,13 @@ terminate_header(r->connection->client); - kill_timeout(r); + ap_kill_timeout(r); return; } if (status == HTTP_NO_CONTENT) { - send_http_header(r); - finalize_request_protocol(r); + ap_send_http_header(r); + ap_finalize_request_protocol(r); return; } @@ -1952,11 +1952,11 @@ */ r->headers_out = r->err_headers_out; r->err_headers_out = tmp; - clear_table(r->err_headers_out); + ap_clear_table(r->err_headers_out); if (location && *location && (is_HTTP_REDIRECT(status) || status == HTTP_CREATED)) - table_setn(r->headers_out, "Location", location); + ap_table_setn(r->headers_out, "Location", location); r->content_language = NULL; r->content_languages = NULL; @@ -1965,19 +1965,19 @@ r->content_type = "text/html"; if ((status == METHOD_NOT_ALLOWED) || (status == NOT_IMPLEMENTED)) - table_setn(r->headers_out, "Allow", make_allow(r)); + ap_table_setn(r->headers_out, "Allow", make_allow(r)); - send_http_header(r); + ap_send_http_header(r); if (r->header_only) { - finalize_request_protocol(r); + ap_finalize_request_protocol(r); return; } } - hard_timeout("send error body", r); + ap_hard_timeout("send error body", r); - if ((custom_response = response_code_string(r, idx))) { + if ((custom_response = ap_response_code_string(r, idx))) { /* * We have a custom response output. This should only be * a text-string to write back. But if the ErrorDocument @@ -1991,9 +1991,9 @@ * the original error and output that as well. */ if (custom_response[0] == '\"') { - bputs(custom_response + 1, fd); - kill_timeout(r); - finalize_request_protocol(r); + ap_bputs(custom_response + 1, fd); + ap_kill_timeout(r); + ap_finalize_request_protocol(r); return; } /* @@ -2008,142 +2008,142 @@ char *h1 = 4 + status_lines[idx]; - bvputs(fd, "<HTML><HEAD>\n<TITLE>", title, + ap_bvputs(fd, "<HTML><HEAD>\n<TITLE>", title, "</TITLE>\n</HEAD><BODY>\n<H1>", h1, "</H1>\n", NULL); switch (status) { case REDIRECT: case MOVED: - bvputs(fd, "The document has moved <A HREF=\"", - escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); + ap_bvputs(fd, "The document has moved <A HREF=\"", + ap_escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); break; case HTTP_SEE_OTHER: - bvputs(fd, "The answer to your request is located <A HREF=\"", - escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); + ap_bvputs(fd, "The answer to your request is located <A HREF=\"", + ap_escape_html(r->pool, location), "\">here</A>.<P>\n", NULL); break; case HTTP_USE_PROXY: - bvputs(fd, "This resource is only accessible through the proxy\n", - escape_html(r->pool, location), "<BR>\nYou will need to ", + ap_bvputs(fd, "This resource is only accessible through the proxy\n", + ap_escape_html(r->pool, location), "<BR>\nYou will need to ", "configure your client to use that proxy.<P>\n", NULL); break; case HTTP_PROXY_AUTHENTICATION_REQUIRED: case AUTH_REQUIRED: - bputs("This server could not verify that you\n", fd); - bputs("are authorized to access the document you\n", fd); - bputs("requested. Either you supplied the wrong\n", fd); - bputs("credentials (e.g., bad password), or your\n", fd); - bputs("browser doesn't understand how to supply\n", fd); - bputs("the credentials required.<P>\n", fd); + ap_bputs("This server could not verify that you\n", fd); + ap_bputs("are authorized to access the document you\n", fd); + ap_bputs("requested. Either you supplied the wrong\n", fd); + ap_bputs("credentials (e.g., bad password), or your\n", fd); + ap_bputs("browser doesn't understand how to supply\n", fd); + ap_bputs("the credentials required.<P>\n", fd); break; case BAD_REQUEST: - bputs("Your browser sent a request that\n", fd); - bputs("this server could not understand.<P>\n", fd); + ap_bputs("Your browser sent a request that\n", fd); + ap_bputs("this server could not understand.<P>\n", fd); break; case HTTP_FORBIDDEN: - bvputs(fd, "You don't have permission to access ", - escape_html(r->pool, r->uri), "\non this server.<P>\n", + ap_bvputs(fd, "You don't have permission to access ", + ap_escape_html(r->pool, r->uri), "\non this server.<P>\n", NULL); break; case NOT_FOUND: - bvputs(fd, "The requested URL ", escape_html(r->pool, r->uri), + ap_bvputs(fd, "The requested URL ", ap_escape_html(r->pool, r->uri), " was not found on this server.<P>\n", NULL); break; case METHOD_NOT_ALLOWED: - bvputs(fd, "The requested method ", r->method, " is not allowed " - "for the URL ", escape_html(r->pool, r->uri), + ap_bvputs(fd, "The requested method ", r->method, " is not allowed " + "for the URL ", ap_escape_html(r->pool, r->uri), ".<P>\n", NULL); break; case NOT_ACCEPTABLE: - bvputs(fd, + ap_bvputs(fd, "An appropriate representation of the requested resource ", - escape_html(r->pool, r->uri), + ap_escape_html(r->pool, r->uri), " could not be found on this server.<P>\n", NULL); /* fall through */ case MULTIPLE_CHOICES: { char *list; - if ((list = table_get(r->notes, "variant-list"))) - bputs(list, fd); + if ((list = ap_table_get(r->notes, "variant-list"))) + ap_bputs(list, fd); } break; case LENGTH_REQUIRED: - bvputs(fd, "A request of the requested method ", r->method, + ap_bvputs(fd, "A request of the requested method ", r->method, " requires a valid Content-length.<P>\n", NULL); break; case PRECONDITION_FAILED: - bvputs(fd, "The precondition on the request for the URL ", - escape_html(r->pool, r->uri), " evaluated to false.<P>\n", + ap_bvputs(fd, "The precondition on the request for the URL ", + ap_escape_html(r->pool, r->uri), " evaluated to false.<P>\n", NULL); break; case NOT_IMPLEMENTED: - bvputs(fd, escape_html(r->pool, r->method), " to ", - escape_html(r->pool, r->uri), " not supported.<P>\n", NULL); + ap_bvputs(fd, ap_escape_html(r->pool, r->method), " to ", + ap_escape_html(r->pool, r->uri), " not supported.<P>\n", NULL); break; case BAD_GATEWAY: - bputs("The proxy server received an invalid\015\012", fd); - bputs("response from an upstream server.<P>\015\012", fd); + ap_bputs("The proxy server received an invalid\015\012", fd); + ap_bputs("response from an upstream server.<P>\015\012", fd); break; case VARIANT_ALSO_VARIES: - bvputs(fd, "A variant for the requested entity ", - escape_html(r->pool, r->uri), " is itself a ", + ap_bvputs(fd, "A variant for the requested entity ", + ap_escape_html(r->pool, r->uri), " is itself a ", "transparently negotiable resource.<P>\n", NULL); break; case HTTP_REQUEST_TIME_OUT: - bputs("I'm tired of waiting for your request.\n", fd); + ap_bputs("I'm tired of waiting for your request.\n", fd); break; case HTTP_GONE: - bvputs(fd, "The requested resource<BR>", - escape_html(r->pool, r->uri), + ap_bvputs(fd, "The requested resource<BR>", + ap_escape_html(r->pool, r->uri), "<BR>\nis no longer available on this server ", "and there is no forwarding address.\n", "Please remove all references to this resource.\n", NULL); break; case HTTP_REQUEST_ENTITY_TOO_LARGE: - bvputs(fd, "The requested resource<BR>", - escape_html(r->pool, r->uri), "<BR>\n", + ap_bvputs(fd, "The requested resource<BR>", + ap_escape_html(r->pool, r->uri), "<BR>\n", "does not allow request data with ", r->method, " requests, or the amount of data provided in\n", "the request exceeds the capacity limit.\n", NULL); break; case HTTP_REQUEST_URI_TOO_LARGE: - bputs("The requested URL's length exceeds the capacity\n", fd); - bputs("limit for this server.\n", fd); + ap_bputs("The requested URL's length exceeds the capacity\n", fd); + ap_bputs("limit for this server.\n", fd); break; case HTTP_UNSUPPORTED_MEDIA_TYPE: - bputs("The supplied request data is not in a format\n", fd); - bputs("acceptable for processing by this resource.\n", fd); + ap_bputs("The supplied request data is not in a format\n", fd); + ap_bputs("acceptable for processing by this resource.\n", fd); break; case HTTP_SERVICE_UNAVAILABLE: - bputs("The server is temporarily unable to service your\n", fd); - bputs("request due to maintenance downtime or capacity\n", fd); - bputs("problems. Please try again later.\n", fd); + ap_bputs("The server is temporarily unable to service your\n", fd); + ap_bputs("request due to maintenance downtime or capacity\n", fd); + ap_bputs("problems. Please try again later.\n", fd); break; case HTTP_GATEWAY_TIME_OUT: - bputs("The proxy server did not receive a timely response\n", fd); - bputs("from the upstream server.<P>\n", fd); + ap_bputs("The proxy server did not receive a timely response\n", fd); + ap_bputs("from the upstream server.<P>\n", fd); break; default: /* HTTP_INTERNAL_SERVER_ERROR */ - bputs("The server encountered an internal error or\n", fd); - bputs("misconfiguration and was unable to complete\n", fd); - bputs("your request.<P>\n", fd); - bputs("Please contact the server administrator,\n ", fd); - bputs(escape_html(r->pool, r->server->server_admin), fd); - bputs(" and inform them of the time the error occurred,\n", fd); - bputs("and anything you might have done that may have\n", fd); - bputs("caused the error.<P>\n", fd); + ap_bputs("The server encountered an internal error or\n", fd); + ap_bputs("misconfiguration and was unable to complete\n", fd); + ap_bputs("your request.<P>\n", fd); + ap_bputs("Please contact the server administrator,\n ", fd); + ap_bputs(ap_escape_html(r->pool, r->server->server_admin), fd); + ap_bputs(" and inform them of the time the error occurred,\n", fd); + ap_bputs("and anything you might have done that may have\n", fd); + ap_bputs("caused the error.<P>\n", fd); break; } if (recursive_error) { - bvputs(fd, "<P>Additionally, a ", - status_lines[index_of_response(recursive_error)], + ap_bvputs(fd, "<P>Additionally, a ", + status_lines[ap_index_of_response(recursive_error)], "\nerror was encountered while trying to use an " "ErrorDocument to handle the request.\n", NULL); } - bputs(psignature("<HR>\n", r), fd); - bputs("</BODY></HTML>\n", fd); + ap_bputs(ap_psignature("<HR>\n", r), fd); + ap_bputs("</BODY></HTML>\n", fd); } - kill_timeout(r); - finalize_request_protocol(r); + ap_kill_timeout(r); + ap_finalize_request_protocol(r); } 1.118 +172 -172 apache-1.3/src/main/http_request.c Index: http_request.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_request.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -r1.117 -r1.118 --- http_request.c 1998/04/01 14:24:31 1.117 +++ http_request.c 1998/04/11 12:00:30 1.118 @@ -103,7 +103,7 @@ || S_ISLNK(r->finfo.st_mode)) { return OK; } - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "object is not a file, directory or symlink: %s", r->filename); return HTTP_FORBIDDEN; @@ -213,7 +213,7 @@ cp = last_cp; } - r->path_info = pstrdup(r->pool, cp); + r->path_info = ap_pstrdup(r->pool, cp); *cp = '\0'; return OK; } @@ -231,9 +231,9 @@ #if defined(EACCES) if (errno != EACCES) #endif - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "access to %s failed for %s", r->uri, - get_remote_host(r->connection, r->per_dir_config, + ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NOLOOKUP)); return HTTP_FORBIDDEN; } @@ -269,7 +269,7 @@ static int directory_walk(request_rec *r) { - core_server_config *sconf = get_module_config(r->server->module_config, + core_server_config *sconf = ap_get_module_config(r->server->module_config, &core_module); void *per_dir_defaults = r->server->lookup_defaults; void **sec = (void **) sconf->sec->elts; @@ -288,7 +288,7 @@ */ if (r->filename == NULL) { - r->filename = pstrdup(r->pool, r->uri); + r->filename = ap_pstrdup(r->pool, r->uri); r->finfo.st_mode = 0; /* Not really a file... */ r->per_dir_config = per_dir_defaults; @@ -306,7 +306,7 @@ * Fake filenames (i.e. proxy:) only match Directory sections. */ - if (!os_is_path_absolute(r->filename)) + if (!ap_is_path_absolute(r->filename)) { void *this_conf, *entry_config; core_dir_config *entry_core; @@ -317,7 +317,7 @@ entry_config = sec[j]; entry_core = (core_dir_config *) - get_module_config(entry_config, &core_module); + ap_get_module_config(entry_config, &core_module); entry_dir = entry_core->d; this_conf = NULL; @@ -326,14 +326,14 @@ this_conf = entry_config; } else if (entry_core->d_is_fnmatch) { - if (!fnmatch(entry_dir, r->filename, 0)) + if (!ap_fnmatch(entry_dir, r->filename, 0)) this_conf = entry_config; } else if (!strncmp(r->filename, entry_dir, strlen(entry_dir))) this_conf = entry_config; if (this_conf) - per_dir_defaults = merge_per_dir_configs(r->pool, + per_dir_defaults = ap_merge_per_dir_configs(r->pool, per_dir_defaults, this_conf); } @@ -343,11 +343,11 @@ return OK; } - r->filename = os_canonical_filename(r->pool, r->filename); - test_filename = pstrdup(r->pool, r->filename); + r->filename = ap_canonical_filename(r->pool, r->filename); + test_filename = ap_pstrdup(r->pool, r->filename); - no2slash(test_filename); - num_dirs = count_dirs(test_filename); + ap_no2slash(test_filename); + num_dirs = ap_count_dirs(test_filename); res = get_path_info(r); if (res != OK) { @@ -372,20 +372,20 @@ * We need 2 extra bytes, one for trailing \0 and one because * make_dirstr_prefix will add potentially one extra /. */ - test_dirname = palloc(r->pool, test_filename_len + 2); + test_dirname = ap_palloc(r->pool, test_filename_len + 2); /* j keeps track of which section we're on, see core_reorder_directories */ j = 0; for (i = 1; i <= num_dirs; ++i) { int overrides_here; core_dir_config *core_dir = (core_dir_config *) - get_module_config(per_dir_defaults, &core_module); + ap_get_module_config(per_dir_defaults, &core_module); /* * XXX: this could be made faster by only copying the next component * rather than copying the entire thing all over. */ - make_dirstr_prefix(test_dirname, test_filename, i); + ap_make_dirstr_prefix(test_dirname, test_filename, i); /* * Do symlink checks first, because they are done with the @@ -393,7 +393,7 @@ */ if ((res = check_symlinks(test_dirname, core_dir->opts))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Symbolic link not allowed: %s", test_dirname); return res; } @@ -410,17 +410,17 @@ void *this_conf; entry_core = (core_dir_config *) - get_module_config(entry_config, &core_module); + ap_get_module_config(entry_config, &core_module); entry_dir = entry_core->d; if (entry_core->r - || !os_is_path_absolute(entry_dir) + || !ap_is_path_absolute(entry_dir) || entry_core->d_components > i) break; this_conf = NULL; if (entry_core->d_is_fnmatch) { - if (!fnmatch(entry_dir, test_dirname, FNM_PATHNAME)) { + if (!ap_fnmatch(entry_dir, test_dirname, FNM_PATHNAME)) { this_conf = entry_config; } } @@ -428,11 +428,11 @@ this_conf = entry_config; if (this_conf) { - per_dir_defaults = merge_per_dir_configs(r->pool, + per_dir_defaults = ap_merge_per_dir_configs(r->pool, per_dir_defaults, this_conf); core_dir = (core_dir_config *) - get_module_config(per_dir_defaults, &core_module); + ap_get_module_config(per_dir_defaults, &core_module); } } overrides_here = core_dir->override; @@ -442,15 +442,15 @@ if (overrides_here) { void *htaccess_conf = NULL; - res = parse_htaccess(&htaccess_conf, r, overrides_here, - pstrdup(r->pool, test_dirname), + res = ap_parse_htaccess(&htaccess_conf, r, overrides_here, + ap_pstrdup(r->pool, test_dirname), sconf->access_name); if (res) return res; if (htaccess_conf) per_dir_defaults = - merge_per_dir_configs(r->pool, per_dir_defaults, + ap_merge_per_dir_configs(r->pool, per_dir_defaults, htaccess_conf); } } @@ -465,12 +465,12 @@ core_dir_config *entry_core; entry_core = (core_dir_config *) - get_module_config(entry_config, &core_module); + ap_get_module_config(entry_config, &core_module); if (entry_core->r) { if (!regexec(entry_core->r, test_dirname, 0, NULL, REG_NOTEOL)) { per_dir_defaults = - merge_per_dir_configs(r->pool, per_dir_defaults, + ap_merge_per_dir_configs(r->pool, per_dir_defaults, entry_config); } } @@ -487,8 +487,8 @@ * you would *not* get the 403. */ if (!S_ISDIR(r->finfo.st_mode) - && (res = check_symlinks(r->filename, allow_options(r)))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + && (res = check_symlinks(r->filename, ap_allow_options(r)))) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Symbolic link not allowed: %s", r->filename); return res; } @@ -498,7 +498,7 @@ static int location_walk(request_rec *r) { - core_server_config *sconf = get_module_config(r->server->module_config, + core_server_config *sconf = ap_get_module_config(r->server->module_config, &core_module); void *per_dir_defaults = r->per_dir_config; void **url = (void **) sconf->sec_url->elts; @@ -522,8 +522,8 @@ test_location = r->uri; } else { - test_location = pstrdup(r->pool, r->uri); - no2slash(test_location); + test_location = ap_pstrdup(r->pool, r->uri); + ap_no2slash(test_location); } /* Go through the location entries, and check for matches. */ @@ -536,7 +536,7 @@ entry_config = url[j]; entry_core = (core_dir_config *) - get_module_config(entry_config, &core_module); + ap_get_module_config(entry_config, &core_module); entry_url = entry_core->d; len = strlen(entry_url); @@ -548,7 +548,7 @@ this_conf = entry_config; } else if (entry_core->d_is_fnmatch) { - if (!fnmatch(entry_url, test_location, FNM_PATHNAME)) { + if (!ap_fnmatch(entry_url, test_location, FNM_PATHNAME)) { this_conf = entry_config; } } @@ -558,7 +558,7 @@ this_conf = entry_config; if (this_conf) - per_dir_defaults = merge_per_dir_configs(r->pool, + per_dir_defaults = ap_merge_per_dir_configs(r->pool, per_dir_defaults, this_conf); } r->per_dir_config = per_dir_defaults; @@ -568,7 +568,7 @@ static int file_walk(request_rec *r) { - core_dir_config *conf = get_module_config(r->per_dir_config, &core_module); + core_dir_config *conf = ap_get_module_config(r->per_dir_config, &core_module); void *per_dir_defaults = r->per_dir_config; void **file = (void **) conf->sec->elts; int num_files = conf->sec->nelts; @@ -599,7 +599,7 @@ entry_config = file[j]; entry_core = (core_dir_config *) - get_module_config(entry_config, &core_module); + ap_get_module_config(entry_config, &core_module); entry_file = entry_core->d; this_conf = NULL; @@ -609,7 +609,7 @@ this_conf = entry_config; } else if (entry_core->d_is_fnmatch) { - if (!fnmatch(entry_file, test_file, FNM_PATHNAME)) { + if (!ap_fnmatch(entry_file, test_file, FNM_PATHNAME)) { this_conf = entry_config; } } @@ -618,7 +618,7 @@ } if (this_conf) - per_dir_defaults = merge_per_dir_configs(r->pool, + per_dir_defaults = ap_merge_per_dir_configs(r->pool, per_dir_defaults, this_conf); } @@ -645,14 +645,14 @@ static request_rec *make_sub_request(const request_rec *r) { - pool *rrp = make_sub_pool(r->pool); - request_rec *rr = pcalloc(rrp, sizeof(request_rec)); + pool *rrp = ap_make_sub_pool(r->pool); + request_rec *rr = ap_pcalloc(rrp, sizeof(request_rec)); rr->pool = rrp; return rr; } -API_EXPORT(request_rec *) sub_req_lookup_uri(const char *new_file, +API_EXPORT(request_rec *) ap_sub_req_lookup_uri(const char *new_file, const request_rec *r) { request_rec *rnew; @@ -663,34 +663,34 @@ rnew->request_time = r->request_time; rnew->connection = r->connection; rnew->server = r->server; - rnew->request_config = create_request_config(rnew->pool); + rnew->request_config = ap_create_request_config(rnew->pool); rnew->htaccess = r->htaccess; rnew->per_dir_config = r->server->lookup_defaults; - set_sub_req_protocol(rnew, r); + ap_set_sub_req_protocol(rnew, r); if (new_file[0] == '/') - parse_uri(rnew, new_file); + ap_parse_uri(rnew, new_file); else { - udir = make_dirstr_parent(rnew->pool, r->uri); + udir = ap_make_dirstr_parent(rnew->pool, r->uri); udir = escape_uri(rnew->pool, udir); /* re-escape it */ - parse_uri(rnew, make_full_path(rnew->pool, udir, new_file)); + ap_parse_uri(rnew, ap_make_full_path(rnew->pool, udir, new_file)); } - res = unescape_url(rnew->uri); + res = ap_unescape_url(rnew->uri); if (res) { rnew->status = res; return rnew; } - getparents(rnew->uri); + ap_getparents(rnew->uri); if ((res = location_walk(rnew))) { rnew->status = res; return rnew; } - res = translate_name(rnew); + res = ap_translate_name(rnew); if (res) { rnew->status = res; return rnew; @@ -710,26 +710,26 @@ if ((res = directory_walk(rnew)) || (res = file_walk(rnew)) || (res = location_walk(rnew)) - || ((satisfies(rnew) == SATISFY_ALL - || satisfies(rnew) == SATISFY_NOSPEC) - ? ((res = check_access(rnew)) - || (some_auth_required(rnew) - && ((res = check_user_id(rnew)) - || (res = check_auth(rnew))))) - : ((res = check_access(rnew)) - && (!some_auth_required(rnew) - || ((res = check_user_id(rnew)) - || (res = check_auth(rnew))))) + || ((ap_satisfies(rnew) == SATISFY_ALL + || ap_satisfies(rnew) == SATISFY_NOSPEC) + ? ((res = ap_check_access(rnew)) + || (ap_some_auth_required(rnew) + && ((res = ap_check_user_id(rnew)) + || (res = ap_check_auth(rnew))))) + : ((res = ap_check_access(rnew)) + && (!ap_some_auth_required(rnew) + || ((res = ap_check_user_id(rnew)) + || (res = ap_check_auth(rnew))))) ) - || (res = find_types(rnew)) - || (res = run_fixups(rnew)) + || (res = ap_find_types(rnew)) + || (res = ap_run_fixups(rnew)) ) { rnew->status = res; } return rnew; } -API_EXPORT(request_rec *) sub_req_lookup_file(const char *new_file, +API_EXPORT(request_rec *) ap_sub_req_lookup_file(const char *new_file, const request_rec *r) { request_rec *rnew; @@ -740,11 +740,11 @@ rnew->request_time = r->request_time; rnew->connection = r->connection; rnew->server = r->server; - rnew->request_config = create_request_config(rnew->pool); + rnew->request_config = ap_create_request_config(rnew->pool); rnew->htaccess = r->htaccess; - set_sub_req_protocol(rnew, r); - fdir = make_dirstr_parent(rnew->pool, r->filename); + ap_set_sub_req_protocol(rnew, r); + fdir = ap_make_dirstr_parent(rnew->pool, r->filename); /* * Check for a special case... if there are no '/' characters in new_file @@ -754,11 +754,11 @@ */ if (strchr(new_file, '/') == NULL) { - char *udir = make_dirstr_parent(rnew->pool, r->uri); + char *udir = ap_make_dirstr_parent(rnew->pool, r->uri); - rnew->uri = make_full_path(rnew->pool, udir, new_file); - rnew->filename = make_full_path(rnew->pool, fdir, new_file); - parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */ + rnew->uri = ap_make_full_path(rnew->pool, udir, new_file); + rnew->filename = ap_make_full_path(rnew->pool, fdir, new_file); + ap_parse_uri(rnew, rnew->uri); /* fill in parsed_uri values */ if (stat(rnew->filename, &rnew->finfo) < 0) { rnew->finfo.st_mode = 0; } @@ -781,8 +781,8 @@ } } else { - if ((res = check_symlinks(rnew->filename, allow_options(rnew)))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, rnew->server, + if ((res = check_symlinks(rnew->filename, ap_allow_options(rnew)))) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, rnew->server, "Symbolic link not allowed: %s", rnew->filename); rnew->status = res; return rnew; @@ -796,7 +796,7 @@ return rnew; } if (rnew->per_dir_config == r->per_dir_config) { - if ((res = find_types(rnew)) || (res = run_fixups(rnew))) { + if ((res = ap_find_types(rnew)) || (res = ap_run_fixups(rnew))) { rnew->status = res; } return rnew; @@ -805,7 +805,7 @@ } else { /* XXX: @@@: What should be done with the parsed_uri values? */ - parse_uri(rnew, new_file); /* fill in parsed_uri values */ + ap_parse_uri(rnew, new_file); /* fill in parsed_uri values */ /* * XXX: this should be set properly like it is in the same-dir case * but it's actually sometimes to impossible to do it... because the @@ -813,8 +813,8 @@ */ rnew->uri = "INTERNALLY GENERATED file-relative req"; rnew->filename = ((new_file[0] == '/') ? - pstrdup(rnew->pool, new_file) : - make_full_path(rnew->pool, fdir, new_file)); + ap_pstrdup(rnew->pool, new_file) : + ap_make_full_path(rnew->pool, fdir, new_file)); rnew->per_dir_config = r->server->lookup_defaults; res = directory_walk(rnew); if (!res) { @@ -823,36 +823,36 @@ } if (res - || ((satisfies(rnew) == SATISFY_ALL - || satisfies(rnew) == SATISFY_NOSPEC) - ? ((res = check_access(rnew)) - || (some_auth_required(rnew) - && ((res = check_user_id(rnew)) - || (res = check_auth(rnew))))) - : ((res = check_access(rnew)) - && (!some_auth_required(rnew) - || ((res = check_user_id(rnew)) - || (res = check_auth(rnew))))) + || ((ap_satisfies(rnew) == SATISFY_ALL + || ap_satisfies(rnew) == SATISFY_NOSPEC) + ? ((res = ap_check_access(rnew)) + || (ap_some_auth_required(rnew) + && ((res = ap_check_user_id(rnew)) + || (res = ap_check_auth(rnew))))) + : ((res = ap_check_access(rnew)) + && (!ap_some_auth_required(rnew) + || ((res = ap_check_user_id(rnew)) + || (res = ap_check_auth(rnew))))) ) - || (res = find_types(rnew)) - || (res = run_fixups(rnew)) + || (res = ap_find_types(rnew)) + || (res = ap_run_fixups(rnew)) ) { rnew->status = res; } return rnew; } -API_EXPORT(int) run_sub_req(request_rec *r) +API_EXPORT(int) ap_run_sub_req(request_rec *r) { - int retval = invoke_handler(r); - finalize_sub_req_protocol(r); + int retval = ap_invoke_handler(r); + ap_finalize_sub_req_protocol(r); return retval; } -API_EXPORT(void) destroy_sub_req(request_rec *r) +API_EXPORT(void) ap_destroy_sub_req(request_rec *r) { /* Reclaim the space */ - destroy_pool(r->pool); + ap_destroy_pool(r->pool); } /***************************************************************** @@ -860,14 +860,14 @@ * Mainline request processing... */ -void die(int type, request_rec *r) +void ap_die(int type, request_rec *r) { - int error_index = index_of_response(type); - char *custom_response = response_code_string(r, error_index); + int error_index = ap_index_of_response(type); + char *custom_response = ap_response_code_string(r, error_index); int recursive_error = 0; if (type == DONE) { - finalize_request_protocol(r); + ap_finalize_request_protocol(r); return; } @@ -907,7 +907,7 @@ && !status_drops_connection(r->status) && r->connection && (r->connection->keepalive != -1)) { - (void) discard_request_body(r); + (void) ap_discard_request_body(r); } /* @@ -917,7 +917,7 @@ if (custom_response && custom_response[0] != '"') { - if (is_url(custom_response)) { + if (ap_is_url(custom_response)) { /* * The URL isn't local, so lets drop through the rest of this * apache code, and continue with the usual REDIRECT handler. @@ -925,7 +925,7 @@ * status... */ r->status = REDIRECT; - table_setn(r->headers_out, "Location", custom_response); + ap_table_setn(r->headers_out, "Location", custom_response); } else if (custom_response[0] == '/') { r->no_local_copy = 1; /* Do NOT send USE_LOCAL_COPY for @@ -934,10 +934,10 @@ * This redirect needs to be a GET no matter what the original * method was. */ - table_setn(r->subprocess_env, "REQUEST_METHOD", r->method); - r->method = pstrdup(r->pool, "GET"); + ap_table_setn(r->subprocess_env, "REQUEST_METHOD", r->method); + r->method = ap_pstrdup(r->pool, "GET"); r->method_number = M_GET; - internal_redirect(custom_response, r); + ap_internal_redirect(custom_response, r); return; } else { @@ -946,30 +946,30 @@ * dying with a recursive server error... */ recursive_error = SERVER_ERROR; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid error redirection directive: %s", custom_response); } } - send_error_response(r, recursive_error); + ap_send_error_response(r, recursive_error); } static void decl_die(int status, char *phase, request_rec *r) { if (status == DECLINED) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, r->server, "configuration error: couldn't %s: %s", phase, r->uri); - die(SERVER_ERROR, r); + ap_die(SERVER_ERROR, r); } else - die(status, r); + ap_die(status, r); } -API_EXPORT(int) some_auth_required(request_rec *r) +API_EXPORT(int) ap_some_auth_required(request_rec *r) { /* Is there a require line configured for the type of *this* req? */ - array_header *reqs_arr = requires(r); + array_header *reqs_arr = ap_requires(r); require_line *reqs; int i; @@ -1000,15 +1000,15 @@ * headers! Have to dink things even to make sure the error message * comes through... */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "client sent illegal HTTP/0.9 request: %s", r->uri); r->header_only = 0; - die(BAD_REQUEST, r); + ap_die(BAD_REQUEST, r); return; } if ((!r->hostname && (r->proto_num >= HTTP_VERSION(1,1))) || - ((r->proto_num == HTTP_VERSION(1,1)) && !table_get(r->headers_in, "Host"))) { + ((r->proto_num == HTTP_VERSION(1,1)) && !ap_table_get(r->headers_in, "Host"))) { /* * Client sent us a HTTP/1.1 or later request without telling us the * hostname, either with a full URL or a Host: header. We therefore @@ -1016,29 +1016,29 @@ * HTTP/1.1 mentions twice (S9, S14.23) that a request MUST contain * a Host: header, and the server MUST respond with 400 if it doesn't. */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "client sent HTTP/1.1 request without hostname (see RFC2068 section 9, and 14.23): %s", r->uri); - die(BAD_REQUEST, r); + ap_die(BAD_REQUEST, r); return; } /* Ignore embedded %2F's in path for proxy requests */ if (!r->proxyreq && r->parsed_uri.path) { - access_status = unescape_url(r->parsed_uri.path); + access_status = ap_unescape_url(r->parsed_uri.path); if (access_status) { - die(access_status, r); + ap_die(access_status, r); return; } } - getparents(r->uri); /* OK --- shrinking transformations... */ + ap_getparents(r->uri); /* OK --- shrinking transformations... */ if ((access_status = location_walk(r))) { - die(access_status, r); + ap_die(access_status, r); return; } - if ((access_status = translate_name(r))) { + if ((access_status = ap_translate_name(r))) { decl_die(access_status, "translate", r); return; } @@ -1049,15 +1049,15 @@ * handle it specially. */ if (r->method_number == M_TRACE) { - if ((access_status = send_http_trace(r))) - die(access_status, r); + if ((access_status = ap_send_http_trace(r))) + ap_die(access_status, r); else - finalize_request_protocol(r); + ap_finalize_request_protocol(r); return; } } - if (r->proto_num > HTTP_VERSION(1,0) && table_get(r->subprocess_env, "downgrade-1.0")) { + if (r->proto_num > HTTP_VERSION(1,0) && ap_table_get(r->subprocess_env, "downgrade-1.0")) { r->proto_num = HTTP_VERSION(1,0); } @@ -1067,41 +1067,41 @@ */ if ((access_status = directory_walk(r))) { - die(access_status, r); + ap_die(access_status, r); return; } if ((access_status = file_walk(r))) { - die(access_status, r); + ap_die(access_status, r); return; } if ((access_status = location_walk(r))) { - die(access_status, r); + ap_die(access_status, r); return; } - if ((access_status = header_parse(r))) { - die(access_status, r); + if ((access_status = ap_header_parse(r))) { + ap_die(access_status, r); return; } - switch (satisfies(r)) { + switch (ap_satisfies(r)) { case SATISFY_ALL: case SATISFY_NOSPEC: - if ((access_status = check_access(r)) != 0) { + if ((access_status = ap_check_access(r)) != 0) { decl_die(access_status, "check access", r); return; } - if (some_auth_required(r)) { - if (((access_status = check_user_id(r)) != 0) || !auth_type(r)) { - decl_die(access_status, auth_type(r) + if (ap_some_auth_required(r)) { + if (((access_status = ap_check_user_id(r)) != 0) || !ap_auth_type(r)) { + decl_die(access_status, ap_auth_type(r) ? "check user. No user file?" : "perform authentication. AuthType not set!", r); return; } - if (((access_status = check_auth(r)) != 0) || !auth_type(r)) { - decl_die(access_status, auth_type(r) + if (((access_status = ap_check_auth(r)) != 0) || !ap_auth_type(r)) { + decl_die(access_status, ap_auth_type(r) ? "check access. No groups file?" : "perform authentication. AuthType not set!", r); return; @@ -1109,21 +1109,21 @@ } break; case SATISFY_ANY: - if (((access_status = check_access(r)) != 0) || !auth_type(r)) { - if (!some_auth_required(r)) { - decl_die(access_status, auth_type(r) + if (((access_status = ap_check_access(r)) != 0) || !ap_auth_type(r)) { + if (!ap_some_auth_required(r)) { + decl_die(access_status, ap_auth_type(r) ? "check access" : "perform authentication. AuthType not set!", r); return; } - if (((access_status = check_user_id(r)) != 0) || !auth_type(r)) { - decl_die(access_status, auth_type(r) + if (((access_status = ap_check_user_id(r)) != 0) || !ap_auth_type(r)) { + decl_die(access_status, ap_auth_type(r) ? "check user. No user file?" : "perform authentication. AuthType not set!", r); return; } - if (((access_status = check_auth(r)) != 0) || !auth_type(r)) { - decl_die(access_status, auth_type(r) + if (((access_status = ap_check_auth(r)) != 0) || !ap_auth_type(r)) { + decl_die(access_status, ap_auth_type(r) ? "check access. No groups file?" : "perform authentication. AuthType not set!", r); return; @@ -1135,38 +1135,38 @@ if (! (r->proxyreq && r->parsed_uri.scheme != NULL && strcmp(r->parsed_uri.scheme, "http") == 0) ) { - if ((access_status = find_types(r)) != 0) { + if ((access_status = ap_find_types(r)) != 0) { decl_die(access_status, "find types", r); return; } } - if ((access_status = run_fixups(r)) != 0) { - die(access_status, r); + if ((access_status = ap_run_fixups(r)) != 0) { + ap_die(access_status, r); return; } - if ((access_status = invoke_handler(r)) != 0) { - die(access_status, r); + if ((access_status = ap_invoke_handler(r)) != 0) { + ap_die(access_status, r); return; } /* Take care of little things that need to happen when we're done */ - finalize_request_protocol(r); + ap_finalize_request_protocol(r); } -void process_request(request_rec *r) +void ap_process_request(request_rec *r) { #ifdef STATUS int old_stat; - time_process_request(r->connection->child_num, START_PREQUEST); + ap_time_process_request(r->connection->child_num, START_PREQUEST); #endif process_request_internal(r); #ifdef STATUS - old_stat = update_child_status(r->connection->child_num, + old_stat = ap_update_child_status(r->connection->child_num, SERVER_BUSY_LOG, r); #endif @@ -1177,12 +1177,12 @@ * this packet, then it'll appear like the link is stalled when really * it's the application that's stalled. */ - bhalfduplex(r->connection->client); - log_transaction(r); + ap_bhalfduplex(r->connection->client); + ap_log_transaction(r); #ifdef STATUS - (void) update_child_status(r->connection->child_num, old_stat, r); - time_process_request(r->connection->child_num, STOP_PREQUEST); + (void) ap_update_child_status(r->connection->child_num, old_stat, r); + ap_time_process_request(r->connection->child_num, STOP_PREQUEST); #endif } @@ -1190,13 +1190,13 @@ { array_header *env_arr = table_elts(t); table_entry *elts = (table_entry *) env_arr->elts; - table *new = make_table(p, env_arr->nalloc); + table *new = ap_make_table(p, env_arr->nalloc); int i; for (i = 0; i < env_arr->nelts; ++i) { if (!elts[i].key) continue; - table_setn(new, pstrcat(p, "REDIRECT_", elts[i].key, NULL), + ap_table_setn(new, ap_pstrcat(p, "REDIRECT_", elts[i].key, NULL), elts[i].val); } @@ -1206,7 +1206,7 @@ static request_rec *internal_internal_redirect(const char *new_uri, request_rec *r) { int access_status; - request_rec *new = (request_rec *) pcalloc(r->pool, sizeof(request_rec)); + request_rec *new = (request_rec *) ap_pcalloc(r->pool, sizeof(request_rec)); new->connection = r->connection; new->server = r->server; @@ -1220,8 +1220,8 @@ new->method = r->method; new->method_number = r->method_number; - parse_uri(new, new_uri); - new->request_config = create_request_config(r->pool); + ap_parse_uri(new, new_uri); + new->request_config = ap_create_request_config(r->pool); new->per_dir_config = r->server->lookup_defaults; new->prev = r; @@ -1243,33 +1243,33 @@ new->main = r->main; new->headers_in = r->headers_in; - new->headers_out = make_table(r->pool, 12); + new->headers_out = ap_make_table(r->pool, 12); new->err_headers_out = r->err_headers_out; new->subprocess_env = rename_original_env(r->pool, r->subprocess_env); - new->notes = make_table(r->pool, 5); + new->notes = ap_make_table(r->pool, 5); new->htaccess = r->htaccess; new->no_cache = r->no_cache; new->no_local_copy = r->no_local_copy; new->read_length = r->read_length; /* We can only read it once */ - table_setn(new->subprocess_env, "REDIRECT_STATUS", - psprintf(r->pool, "%d", r->status)); + ap_table_setn(new->subprocess_env, "REDIRECT_STATUS", + ap_psprintf(r->pool, "%d", r->status)); /* * XXX: hmm. This is because mod_setenvif and mod_unique_id really need * to do their thing on internal redirects as well. Perhaps this is a * misnamed function. */ - if ((access_status = run_post_read_request(new))) { - die(access_status, new); + if ((access_status = ap_run_post_read_request(new))) { + ap_die(access_status, new); return NULL; } return new; } -API_EXPORT(void) internal_redirect(const char *new_uri, request_rec *r) +API_EXPORT(void) ap_internal_redirect(const char *new_uri, request_rec *r) { request_rec *new = internal_internal_redirect(new_uri, r); process_request_internal(new); @@ -1279,7 +1279,7 @@ * using AddHandler, and you want to preserve the content type across * an internal redirect. */ -API_EXPORT(void) internal_redirect_handler(const char *new_uri, request_rec *r) +API_EXPORT(void) ap_internal_redirect_handler(const char *new_uri, request_rec *r) { request_rec *new = internal_internal_redirect(new_uri, r); if (r->handler) @@ -1290,7 +1290,7 @@ /* * Is it the initial main request, which we only get *once* per HTTP request? */ -API_EXPORT(int) is_initial_req(request_rec *r) +API_EXPORT(int) ap_is_initial_req(request_rec *r) { return (r->main == NULL) /* otherwise, this is a sub-request */ @@ -1302,7 +1302,7 @@ * Function to set the r->mtime field to the specified value if it's later * than what's already there. */ -API_EXPORT(time_t) update_mtime(request_rec *r, time_t dependency_mtime) +API_EXPORT(time_t) ap_update_mtime(request_rec *r, time_t dependency_mtime) { if (r->mtime < dependency_mtime) { r->mtime = dependency_mtime; 1.13 +28 -28 apache-1.3/src/main/http_vhost.c Index: http_vhost.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_vhost.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- http_vhost.c 1998/03/31 12:52:47 1.12 +++ http_vhost.c 1998/04/11 12:00:31 1.13 @@ -148,7 +148,7 @@ /* called at the beginning of the config */ -void init_vhost_config(pool *p) +void ap_init_vhost_config(pool *p) { memset(iphash_table, 0, sizeof(iphash_table)); default_list = NULL; @@ -204,12 +204,12 @@ is_an_ip_addr = 1; } if (is_an_ip_addr) { - sar = pcalloc(p, sizeof(server_addr_rec)); + sar = ap_pcalloc(p, sizeof(server_addr_rec)); **paddr = sar; *paddr = &sar->next; sar->host_addr.s_addr = my_addr; sar->host_port = port; - sar->virthost = pstrdup(p, w); + sar->virthost = ap_pstrdup(p, w); if (t != NULL) *t = ':'; return NULL; @@ -218,7 +218,7 @@ hep = gethostbyname(w); if ((!hep) || (hep->h_addrtype != AF_INET || !hep->h_addr_list[0])) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, "Cannot resolve host name %s --- ignoring!", w); if (t != NULL) *t = ':'; @@ -226,12 +226,12 @@ } for (i = 0; hep->h_addr_list[i]; ++i) { - sar = pcalloc(p, sizeof(server_addr_rec)); + sar = ap_pcalloc(p, sizeof(server_addr_rec)); **paddr = sar; *paddr = &sar->next; sar->host_addr = *(struct in_addr *) hep->h_addr_list[i]; sar->host_port = port; - sar->virthost = pstrdup(p, w); + sar->virthost = ap_pstrdup(p, w); } if (t != NULL) @@ -241,7 +241,7 @@ /* parse the <VirtualHost> addresses */ -const char *parse_vhost_addrs(pool *p, const char *hostname, server_rec *s) +const char *ap_parse_vhost_addrs(pool *p, const char *hostname, server_rec *s) { server_addr_rec **addrs; const char *err; @@ -249,7 +249,7 @@ /* start the list of addreses */ addrs = &s->addrs; while (hostname[0]) { - err = get_addresses(p, getword_conf(p, &hostname), &addrs, s->port); + err = get_addresses(p, ap_getword_conf(p, &hostname), &addrs, s->port); if (err) { *addrs = NULL; return err; @@ -267,7 +267,7 @@ } -const char *set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg) +const char *ap_set_name_virtual_host (cmd_parms *cmd, void *dummy, char *arg) { /* use whatever port the main server has at this point */ return get_addresses(cmd->pool, arg, &name_vhost_list_tail, @@ -323,7 +323,7 @@ } p += ap_snprintf(p, sizeof(buf) - (p - buf), " %ux%u", total, count[IPHASH_TABLE_SIZE - 1]); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, main_s, buf); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, main_s, buf); } #endif @@ -351,7 +351,7 @@ { ipaddr_chain *new; - new = palloc(p, sizeof(*new)); + new = ap_palloc(p, sizeof(*new)); new->names = NULL; new->server = s; new->sar = sar; @@ -364,7 +364,7 @@ { name_chain *new; - new = palloc(p, sizeof(*new)); + new = ap_palloc(p, sizeof(*new)); new->server = s; new->sar = sar; new->next = NULL; @@ -411,7 +411,7 @@ /* compile the tables and such we need to do the run-time vhost lookups */ -void fini_vhost_config(pool *p, server_rec *main_s) +void ap_fini_vhost_config(pool *p, server_rec *main_s) { server_addr_rec *sar; int has_default_vhost_addr; @@ -426,7 +426,7 @@ s = main_s; if (!s->server_hostname) { - s->server_hostname = get_local_host(p); + s->server_hostname = ap_get_local_host(p); } /* initialize the tails */ @@ -470,7 +470,7 @@ other = find_default_server(sar->host_port); if (other && other->sar->host_port != 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, "_default_ VirtualHost overlap on port %u," " the first has precedence", sar->host_port); } @@ -494,7 +494,7 @@ ic->server = s; if (sar->host_port != ic->sar->host_port) { /* one of the two is a * port, the other isn't */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, main_s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, main_s, "VirtualHost %s:%u -- mixing * " "ports and non-* ports with " "a NameVirtualHost address is not supported," @@ -503,7 +503,7 @@ } } else if (ic) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, "VirtualHost %s:%u overlaps with " "VirtualHost %s:%u, the first has precedence, " "perhaps you need a NameVirtualHost directive", @@ -536,25 +536,25 @@ DNS in the VirtualHost statement. It's disabled anyhow by the host matching code. -djg */ s->server_hostname = - pstrdup(p, "bogus_host_without_forward_dns"); + ap_pstrdup(p, "bogus_host_without_forward_dns"); } else { struct hostent *h; if ((h = gethostbyaddr((char *) &(s->addrs->host_addr), sizeof(struct in_addr), AF_INET))) { - s->server_hostname = pstrdup(p, (char *) h->h_name); + s->server_hostname = ap_pstrdup(p, (char *) h->h_name); } else { /* again, what can we do? They didn't specify a ServerName, and their DNS isn't working. -djg */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, main_s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, main_s, "Failed to resolve server name " "for %s (check DNS) -- or specify an explicit " "ServerName", inet_ntoa(s->addrs->host_addr)); s->server_hostname = - pstrdup(p, "bogus_host_without_reverse_dns"); + ap_pstrdup(p, "bogus_host_without_reverse_dns"); } } } @@ -570,7 +570,7 @@ ipaddr_chain *ic = *pic; if (ic->server == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, main_s, "NameVirtualHost %s:%u has no VirtualHosts", ic->sar->virthost, ic->sar->host_port); *pic = ic->next; @@ -603,7 +603,7 @@ static void fix_hostname(request_rec *r) { const char *hostname = r->hostname; - char *host = getword(r->pool, &hostname, ':'); /* get rid of port */ + char *host = ap_getword(r->pool, &hostname, ':'); /* get rid of port */ size_t l; /* trim a trailing . */ @@ -642,7 +642,7 @@ char **name = (char **) names->elts; for (i = 0; i < names->nelts; ++i) { if(!name[i]) continue; - if (!strcasecmp_match(host, name[i])) + if (!ap_strcasecmp_match(host, name[i])) return 1; } } @@ -657,7 +657,7 @@ * we just call it a match. But here we require the host:port to match * the ServerName and/or ServerAliases. */ -API_EXPORT(int) matches_request_vhost(request_rec *r, const char *host, +API_EXPORT(int) ap_matches_request_vhost(request_rec *r, const char *host, unsigned port) { server_rec *s; @@ -809,10 +809,10 @@ } -void update_vhost_from_headers(request_rec *r) +void ap_update_vhost_from_headers(request_rec *r) { /* must set this for HTTP/1.1 support */ - if (r->hostname || (r->hostname = table_get(r->headers_in, "Host"))) { + if (r->hostname || (r->hostname = ap_table_get(r->headers_in, "Host"))) { fix_hostname(r); } /* check if we tucked away a name_chain */ @@ -828,7 +828,7 @@ /* Called for a new connection which has a known local_addr. Note that the * new connection is assumed to have conn->server == main server. */ -void update_vhost_given_ip(conn_rec *conn) +void ap_update_vhost_given_ip(conn_rec *conn) { ipaddr_chain *trav; unsigned port = ntohs(conn->local_addr.sin_port); 1.12 +5 -5 apache-1.3/src/main/md5c.c Index: md5c.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/md5c.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- md5c.c 1998/03/31 12:52:47 1.11 +++ md5c.c 1998/04/11 12:00:31 1.12 @@ -163,7 +163,7 @@ /* MD5 initialization. Begins an MD5 operation, writing a new context. */ -API_EXPORT(void) MD5Init(AP_MD5_CTX * context) +API_EXPORT(void) ap_MD5Init(AP_MD5_CTX * context) { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ @@ -177,7 +177,7 @@ operation, processing another message block, and updating the context. */ -API_EXPORT(void) MD5Update(AP_MD5_CTX * context, const unsigned char *input, +API_EXPORT(void) ap_MD5Update(AP_MD5_CTX * context, const unsigned char *input, unsigned int inputLen) { unsigned int i, idx, partLen; @@ -212,7 +212,7 @@ /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ -API_EXPORT(void) MD5Final(unsigned char digest[16], AP_MD5_CTX * context) +API_EXPORT(void) ap_MD5Final(unsigned char digest[16], AP_MD5_CTX * context) { unsigned char bits[8]; unsigned int idx, padLen; @@ -223,10 +223,10 @@ /* Pad out to 56 mod 64. */ idx = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (idx < 56) ? (56 - idx) : (120 - idx); - MD5Update(context, PADDING, padLen); + ap_MD5Update(context, PADDING, padLen); /* Append length (before padding) */ - MD5Update(context, bits, 8); + ap_MD5Update(context, bits, 8); /* Store state in digest */ Encode(digest, context->state, 16); 1.23 +10 -10 apache-1.3/src/main/rfc1413.c Index: rfc1413.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/rfc1413.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- rfc1413.c 1998/03/31 12:52:48 1.22 +++ rfc1413.c 1998/04/11 12:00:31 1.23 @@ -96,7 +96,7 @@ #define ANY_PORT 0 /* Any old port will do */ #define FROM_UNKNOWN "unknown" -int rfc1413_timeout = RFC1413_TIMEOUT; /* Global so it can be changed */ +int ap_rfc1413_timeout = RFC1413_TIMEOUT; /* Global so it can be changed */ static JMP_BUF timebuf; @@ -128,7 +128,7 @@ if (bind(sock, (struct sockaddr *) &our_query_sin, sizeof(struct sockaddr_in)) < 0) { - aplog_error(APLOG_MARK, APLOG_CRIT, srv, + ap_log_error(APLOG_MARK, APLOG_CRIT, srv, "bind: rfc1413: Error binding to local port"); return -1; } @@ -148,7 +148,7 @@ i = write(sock, buffer, buflen); while (i == -1 && errno == EINTR); if (i == -1) { - aplog_error(APLOG_MARK, APLOG_CRIT, srv, + ap_log_error(APLOG_MARK, APLOG_CRIT, srv, "write: rfc1413: error sending request"); return -1; } @@ -162,7 +162,7 @@ i = read(sock, buffer, RFC1413_MAXDATA); while (i == -1 && errno == EINTR); if (i == -1) { - aplog_error(APLOG_MARK, APLOG_CRIT, srv, + ap_log_error(APLOG_MARK, APLOG_CRIT, srv, "read: rfc1413: error reading response"); return -1; } @@ -192,7 +192,7 @@ } /* rfc1413 - return remote user name, given socket structures */ -char *rfc1413(conn_rec *conn, server_rec *srv) +char *ap_rfc1413(conn_rec *conn, server_rec *srv) { static char user[RFC1413_USERLEN + 1]; /* XXX */ static char *result; @@ -200,9 +200,9 @@ result = FROM_UNKNOWN; - sock = psocket(conn->pool, AF_INET, SOCK_STREAM, IPPROTO_TCP); + sock = ap_psocket(conn->pool, AF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock < 0) { - aplog_error(APLOG_MARK, APLOG_CRIT, srv, + ap_log_error(APLOG_MARK, APLOG_CRIT, srv, "socket: rfc1413: error creating socket"); conn->remote_logname = result; } @@ -211,14 +211,14 @@ * Set up a timer so we won't get stuck while waiting for the server. */ if (ap_setjmp(timebuf) == 0) { - set_callback_and_alarm(ident_timeout, rfc1413_timeout); + ap_set_callback_and_alarm(ident_timeout, ap_rfc1413_timeout); if (get_rfc1413(sock, &conn->local_addr, &conn->remote_addr, user, srv) >= 0) result = user; - set_callback_and_alarm(NULL, 0); + ap_set_callback_and_alarm(NULL, 0); } - pclosesocket(conn->pool, sock); + ap_pclosesocket(conn->pool, sock); conn->remote_logname = result; return conn->remote_logname; 1.111 +104 -104 apache-1.3/src/main/util.c Index: util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.110 retrieving revision 1.111 diff -u -r1.110 -r1.111 --- util.c 1998/03/31 12:52:48 1.110 +++ util.c 1998/04/11 12:00:31 1.111 @@ -91,7 +91,7 @@ */ #define TEST_CHAR(c, f) (test_char_table[(unsigned)(c)] & (f)) -void util_init(void) +void ap_util_init(void) { /* nothing to do... previously there was run-time initialization of * test_char_table here @@ -99,16 +99,16 @@ } -API_VAR_EXPORT const char month_snames[12][4] = +API_VAR_EXPORT const char ap_month_snames[12][4] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; -API_VAR_EXPORT const char day_snames[7][4] = +API_VAR_EXPORT const char ap_day_snames[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; -API_EXPORT(char *) get_time() +API_EXPORT(char *) ap_get_time() { time_t t; char *time_string; @@ -119,7 +119,7 @@ return (time_string); } -API_EXPORT(char *) ht_time(pool *p, time_t t, const char *fmt, int gmt) +API_EXPORT(char *) ap_ht_time(pool *p, time_t t, const char *fmt, int gmt) { char ts[MAX_STRING_LEN]; struct tm *tms; @@ -129,25 +129,25 @@ /* check return code? */ strftime(ts, MAX_STRING_LEN, fmt, tms); ts[MAX_STRING_LEN - 1] = '\0'; - return pstrdup(p, ts); + return ap_pstrdup(p, ts); } -API_EXPORT(char *) gm_timestr_822(pool *p, time_t sec) +API_EXPORT(char *) ap_gm_timestr_822(pool *p, time_t sec) { struct tm *tms; tms = gmtime(&sec); /* RFC date format; as strftime '%a, %d %b %Y %T GMT' */ - return psprintf(p, - "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", day_snames[tms->tm_wday], - tms->tm_mday, month_snames[tms->tm_mon], tms->tm_year + 1900, + return ap_psprintf(p, + "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", ap_day_snames[tms->tm_wday], + tms->tm_mday, ap_month_snames[tms->tm_mon], tms->tm_year + 1900, tms->tm_hour, tms->tm_min, tms->tm_sec); } /* What a pain in the ass. */ #if defined(HAVE_GMTOFF) -API_EXPORT(struct tm *) get_gmtoff(int *tz) +API_EXPORT(struct tm *) ap_get_gmtoff(int *tz) { time_t tt = time(NULL); struct tm *t; @@ -157,7 +157,7 @@ return t; } #else -API_EXPORT(struct tm *) get_gmtoff(int *tz) +API_EXPORT(struct tm *) ap_get_gmtoff(int *tz) { time_t tt = time(NULL); struct tm gmt; @@ -181,7 +181,7 @@ * Based loosely on sections of wildmat.c by Rich Salz * Hmmm... shouldn't this really go component by component? */ -API_EXPORT(int) strcmp_match(const char *str, const char *exp) +API_EXPORT(int) ap_strcmp_match(const char *str, const char *exp) { int x, y; @@ -194,7 +194,7 @@ return 0; while (str[x]) { int ret; - if ((ret = strcmp_match(&str[x++], &exp[y])) != 1) + if ((ret = ap_strcmp_match(&str[x++], &exp[y])) != 1) return ret; } return -1; @@ -205,7 +205,7 @@ return (str[x] != '\0'); } -API_EXPORT(int) strcasecmp_match(const char *str, const char *exp) +API_EXPORT(int) ap_strcasecmp_match(const char *str, const char *exp) { int x, y; @@ -218,7 +218,7 @@ return 0; while (str[x]) { int ret; - if ((ret = strcasecmp_match(&str[x++], &exp[y])) != 1) + if ((ret = ap_strcasecmp_match(&str[x++], &exp[y])) != 1) return ret; } return -1; @@ -229,7 +229,7 @@ return (str[x] != '\0'); } -API_EXPORT(int) is_matchexp(const char *str) +API_EXPORT(int) ap_is_matchexp(const char *str) { register int x; @@ -253,7 +253,7 @@ * AT&T V8 regexp package. */ -API_EXPORT(char *) pregsub(pool *p, const char *input, const char *source, +API_EXPORT(char *) ap_pregsub(pool *p, const char *input, const char *source, size_t nmatch, regmatch_t pmatch[]) { const char *src = input; @@ -265,7 +265,7 @@ if (!source) return NULL; if (!nmatch) - return pstrdup(p, src); + return ap_pstrdup(p, src); /* First pass, find the size */ @@ -290,7 +290,7 @@ } - dest = dst = pcalloc(p, len + 1); + dest = dst = ap_pcalloc(p, len + 1); /* Now actually fill in the string */ @@ -324,7 +324,7 @@ /* * Parse .. so we don't compromise security */ -API_EXPORT(void) getparents(char *name) +API_EXPORT(void) ap_getparents(char *name) { int l, w; @@ -385,7 +385,7 @@ } } -API_EXPORT(void) no2slash(char *name) +API_EXPORT(void) ap_no2slash(char *name) { char *d, *s; @@ -416,7 +416,7 @@ * /a/b, 3 ==> /a/b/ * /a/b, 4 ==> /a/b/ */ -API_EXPORT(char *) make_dirstr_prefix(char *d, const char *s, int n) +API_EXPORT(char *) ap_make_dirstr_prefix(char *d, const char *s, int n) { for (;;) { *d = *s; @@ -437,7 +437,7 @@ /* * return the parent directory name including trailing / of the file s */ -API_EXPORT(char *) make_dirstr_parent(pool *p, const char *s) +API_EXPORT(char *) ap_make_dirstr_parent(pool *p, const char *s) { char *last_slash = strrchr(s, '/'); char *d; @@ -445,10 +445,10 @@ if (last_slash == NULL) { /* XXX: well this is really broken if this happens */ - return (pstrdup(p, "/")); + return (ap_pstrdup(p, "/")); } l = (last_slash - s) + 1; - d = palloc(p, l + 1); + d = ap_palloc(p, l + 1); memcpy(d, s, l); d[l] = 0; return (d); @@ -459,7 +459,7 @@ * This function is deprecated. Use one of the preceeding two functions * which are faster. */ -API_EXPORT(char *) make_dirstr(pool *p, const char *s, int n) +API_EXPORT(char *) ap_make_dirstr(pool *p, const char *s, int n) { register int x, f; char *res; @@ -467,7 +467,7 @@ for (x = 0, f = 0; s[x]; x++) { if (s[x] == '/') if ((++f) == n) { - res = palloc(p, x + 2); + res = ap_palloc(p, x + 2); memcpy(res, s, x); res[x] = '/'; res[x + 1] = '\0'; @@ -476,12 +476,12 @@ } if (s[strlen(s) - 1] == '/') - return pstrdup(p, s); + return ap_pstrdup(p, s); else - return pstrcat(p, s, "/", NULL); + return ap_pstrcat(p, s, "/", NULL); } -API_EXPORT(int) count_dirs(const char *path) +API_EXPORT(int) ap_count_dirs(const char *path) { register int x, n; @@ -492,7 +492,7 @@ } -API_EXPORT(void) chdir_file(const char *file) +API_EXPORT(void) ap_chdir_file(const char *file) { const char *x; char buf[HUGE_STRING_LEN]; @@ -510,23 +510,23 @@ * error... ah well. */ } -API_EXPORT(char *) getword_nc(pool *atrans, char **line, char stop) +API_EXPORT(char *) ap_getword_nc(pool *atrans, char **line, char stop) { - return getword(atrans, (const char **) line, stop); + return ap_getword(atrans, (const char **) line, stop); } -API_EXPORT(char *) getword(pool *atrans, const char **line, char stop) +API_EXPORT(char *) ap_getword(pool *atrans, const char **line, char stop) { char *pos = strchr(*line, stop); char *res; if (!pos) { - res = pstrdup(atrans, *line); + res = ap_pstrdup(atrans, *line); *line += strlen(*line); return res; } - res = pstrndup(atrans, *line, pos - *line); + res = ap_pstrndup(atrans, *line, pos - *line); while (*pos == stop) { ++pos; @@ -537,12 +537,12 @@ return res; } -API_EXPORT(char *) getword_white_nc(pool *atrans, char **line) +API_EXPORT(char *) ap_getword_white_nc(pool *atrans, char **line) { - return getword_white(atrans, (const char **) line); + return ap_getword_white(atrans, (const char **) line); } -API_EXPORT(char *) getword_white(pool *atrans, const char **line) +API_EXPORT(char *) ap_getword_white(pool *atrans, const char **line) { int pos = -1, x; char *res; @@ -555,12 +555,12 @@ } if (pos == -1) { - res = pstrdup(atrans, *line); + res = ap_pstrdup(atrans, *line); *line += strlen(*line); return res; } - res = palloc(atrans, pos + 1); + res = ap_palloc(atrans, pos + 1); ap_cpystrn(res, *line, pos + 1); while (isspace((*line)[pos])) @@ -571,23 +571,23 @@ return res; } -API_EXPORT(char *) getword_nulls_nc(pool *atrans, char **line, char stop) +API_EXPORT(char *) ap_getword_nulls_nc(pool *atrans, char **line, char stop) { - return getword_nulls(atrans, (const char **) line, stop); + return ap_getword_nulls(atrans, (const char **) line, stop); } -API_EXPORT(char *) getword_nulls(pool *atrans, const char **line, char stop) +API_EXPORT(char *) ap_getword_nulls(pool *atrans, const char **line, char stop) { char *pos = strchr(*line, stop); char *res; if (!pos) { - res = pstrdup(atrans, *line); + res = ap_pstrdup(atrans, *line); *line += strlen(*line); return res; } - res = pstrndup(atrans, *line, pos - *line); + res = ap_pstrndup(atrans, *line, pos - *line); ++pos; @@ -602,7 +602,7 @@ static char *substring_conf(pool *p, const char *start, int len, char quote) { - char *result = palloc(p, len + 2); + char *result = ap_palloc(p, len + 2); char *resp = result; int i; @@ -618,12 +618,12 @@ return result; } -API_EXPORT(char *) getword_conf_nc(pool *p, char **line) +API_EXPORT(char *) ap_getword_conf_nc(pool *p, char **line) { - return getword_conf(p, (const char **) line); + return ap_getword_conf(p, (const char **) line); } -API_EXPORT(char *) getword_conf(pool *p, const char **line) +API_EXPORT(char *) ap_getword_conf(pool *p, const char **line) { const char *str = *line, *strend; char *res; @@ -666,7 +666,7 @@ /* Open a configfile_t as FILE, return open configfile_t struct pointer */ -API_EXPORT(configfile_t *) pcfg_openfile(pool *p, const char *name) +API_EXPORT(configfile_t *) ap_pcfg_openfile(pool *p, const char *name) { configfile_t *new_cfg; FILE *file; @@ -675,14 +675,14 @@ #endif if (name == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL, "Internal error: pcfg_openfile() called with NULL filename"); return NULL; } file = fopen(name, "r"); #ifdef DEBUG - aplog_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, "Opening config file %s (%s)", name, (file == NULL) ? strerror(errno) : "successful"); #endif @@ -693,7 +693,7 @@ if (strcmp(name, "/dev/null") != 0 && fstat(fileno(file), &stbuf) == 0 && !S_ISREG(stbuf.st_mode)) { - aplog_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, NULL, "Access to file %s denied by server: not a regular file", name); fclose(file); @@ -701,9 +701,9 @@ } #endif - new_cfg = palloc(p, sizeof(*new_cfg)); + new_cfg = ap_palloc(p, sizeof(*new_cfg)); new_cfg->param = file; - new_cfg->name = pstrdup(p, name); + new_cfg->name = ap_pstrdup(p, name); new_cfg->getch = (int (*)(void *)) fgetc; new_cfg->getstr = (void *(*)(void *, size_t, void *)) fgets; new_cfg->close = (int (*)(void *)) fclose; @@ -713,15 +713,15 @@ /* Allocate a configfile_t handle with user defined functions and params */ -API_EXPORT(configfile_t *) pcfg_open_custom(pool *p, const char *descr, +API_EXPORT(configfile_t *) ap_pcfg_open_custom(pool *p, const char *descr, void *param, int(*getch)(void *), void *(*getstr) (void *buf, size_t bufsiz, void *param), int(*close_func)(void *)) { - configfile_t *new_cfg = palloc(p, sizeof(*new_cfg)); + configfile_t *new_cfg = ap_palloc(p, sizeof(*new_cfg)); #ifdef DEBUG - aplog_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, "Opening config handler %s", descr); + ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, NULL, "Opening config handler %s", descr); #endif new_cfg->param = param; new_cfg->name = descr; @@ -734,7 +734,7 @@ /* Read one character from a configfile_t */ -API_EXPORT(int) cfg_getc(configfile_t *cfp) +API_EXPORT(int) ap_cfg_getc(configfile_t *cfp) { register int ch = cfp->getch(cfp->param); if (ch == LF) @@ -745,7 +745,7 @@ /* Read one line from open configfile_t, strip LF, increase line number */ /* If custom handler does not define a getstr() function, read char by char */ -API_EXPORT(int) cfg_getline(char *buf, size_t bufsize, configfile_t *cfp) +API_EXPORT(int) ap_cfg_getline(char *buf, size_t bufsize, configfile_t *cfp) { /* If a "get string" function is defined, use it */ if (cfp->getstr != NULL) { @@ -818,7 +818,7 @@ *dst = '\0'; #ifdef DEBUG_CFG_LINES - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf); + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf); #endif return 0; } else { @@ -875,7 +875,7 @@ --i; buf[i] = '\0'; #ifdef DEBUG_CFG_LINES - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf); + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Read config: %s", buf); #endif return 0; } @@ -886,10 +886,10 @@ } } -API_EXPORT(int) cfg_closefile(configfile_t *fp) +API_EXPORT(int) ap_cfg_closefile(configfile_t *fp) { #ifdef DEBUG - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Done with config file %s", fp->name); + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "Done with config file %s", fp->name); #endif return (fp->close == NULL) ? 0 : fp->close(fp->param); } @@ -901,7 +901,7 @@ * by whitespace at the caller's option. */ -API_EXPORT(char *) get_token(pool *p, char **accept_line, int accept_white) +API_EXPORT(char *) ap_get_token(pool *p, char **accept_line, int accept_white) { char *ptr = *accept_line; char *tok_start; @@ -928,7 +928,7 @@ } tok_len = ptr - tok_start; - token = pstrndup(p, tok_start, tok_len); + token = ap_pstrndup(p, tok_start, tok_len); /* Advance accept_line pointer to the next non-white byte */ @@ -941,7 +941,7 @@ /* find http tokens, see the definition of token from RFC2068 */ -API_EXPORT(int) find_token(pool *p, const char *line, const char *tok) +API_EXPORT(int) ap_find_token(pool *p, const char *line, const char *tok) { const unsigned char *start_token; const unsigned char *s; @@ -975,7 +975,7 @@ } -API_EXPORT(int) find_last_token(pool *p, const char *line, const char *tok) +API_EXPORT(int) ap_find_last_token(pool *p, const char *line, const char *tok) { int llen, tlen, lidx; @@ -993,13 +993,13 @@ return (strncasecmp(&line[lidx], tok, tlen) == 0); } -API_EXPORT(char *) escape_shell_cmd(pool *p, const char *str) +API_EXPORT(char *) ap_escape_shell_cmd(pool *p, const char *str) { char *cmd; unsigned char *d; const unsigned char *s; - cmd = palloc(p, 2 * strlen(str) + 1); /* Be safe */ + cmd = ap_palloc(p, 2 * strlen(str) + 1); /* Be safe */ d = (unsigned char *)cmd; s = (const unsigned char *)str; for (; *s; ++s) { @@ -1053,7 +1053,7 @@ * decoding %2f -> / (a special character) * returns NOT_FOUND */ -API_EXPORT(int) unescape_url(char *url) +API_EXPORT(int) ap_unescape_url(char *url) { register int x, y, badesc, badpath; @@ -1084,13 +1084,13 @@ return OK; } -API_EXPORT(char *) construct_server(pool *p, const char *hostname, +API_EXPORT(char *) ap_construct_server(pool *p, const char *hostname, unsigned port, const request_rec *r) { if (is_default_port(port, r)) - return pstrdup(p, hostname); + return ap_pstrdup(p, hostname); else { - return psprintf(p, "%s:%u", hostname, port); + return ap_psprintf(p, "%s:%u", hostname, port); } } @@ -1129,9 +1129,9 @@ * something with a '/' in it (and thus does not prefix "./"). */ -API_EXPORT(char *) escape_path_segment(pool *p, const char *segment) +API_EXPORT(char *) ap_escape_path_segment(pool *p, const char *segment) { - char *copy = palloc(p, 3 * strlen(segment) + 1); + char *copy = ap_palloc(p, 3 * strlen(segment) + 1); const unsigned char *s = (const unsigned char *)segment; unsigned char *d = (unsigned char *)copy; unsigned c; @@ -1149,9 +1149,9 @@ return copy; } -API_EXPORT(char *) os_escape_path(pool *p, const char *path, int partial) +API_EXPORT(char *) ap_escape_path(pool *p, const char *path, int partial) { - char *copy = palloc(p, 3 * strlen(path) + 3); + char *copy = ap_palloc(p, 3 * strlen(path) + 3); const unsigned char *s = (const unsigned char *)path; unsigned char *d = (unsigned char *)copy; unsigned c; @@ -1180,7 +1180,7 @@ /* escape_uri is now a macro for os_escape_path */ -API_EXPORT(char *) escape_html(pool *p, const char *s) +API_EXPORT(char *) ap_escape_html(pool *p, const char *s) { int i, j; char *x; @@ -1193,8 +1193,8 @@ j += 4; if (j == 0) - return pstrdup(p, s); - x = palloc(p, i + j + 1); + return ap_pstrdup(p, s); + x = ap_palloc(p, i + j + 1); for (i = 0, j = 0; s[i] != '\0'; i++, j++) if (s[i] == '<') { memcpy(&x[j], "<", 4); @@ -1215,7 +1215,7 @@ return x; } -API_EXPORT(int) is_directory(const char *path) +API_EXPORT(int) ap_is_directory(const char *path) { struct stat finfo; @@ -1225,25 +1225,25 @@ return (S_ISDIR(finfo.st_mode)); } -API_EXPORT(char *) make_full_path(pool *a, const char *src1, +API_EXPORT(char *) ap_make_full_path(pool *a, const char *src1, const char *src2) { register int x; x = strlen(src1); if (x == 0) - return pstrcat(a, "/", src2, NULL); + return ap_pstrcat(a, "/", src2, NULL); if (src1[x - 1] != '/') - return pstrcat(a, src1, "/", src2, NULL); + return ap_pstrcat(a, src1, "/", src2, NULL); else - return pstrcat(a, src1, src2, NULL); + return ap_pstrcat(a, src1, src2, NULL); } /* * Check for an absoluteURI syntax (see section 3.2 in RFC2068). */ -API_EXPORT(int) is_url(const char *u) +API_EXPORT(int) ap_is_url(const char *u) { register int x; @@ -1258,7 +1258,7 @@ return (x ? 1 : 0); /* If the first character is ':', it's broken, too */ } -API_EXPORT(int) can_exec(const struct stat *finfo) +API_EXPORT(int) ap_can_exec(const struct stat *finfo) { #ifdef MULTIPLE_GROUPS int cnt; @@ -1267,10 +1267,10 @@ /* OS/2 dosen't have Users and Groups */ return 1; #else - if (user_id == finfo->st_uid) + if (ap_user_id == finfo->st_uid) if (finfo->st_mode & S_IXUSR) return 1; - if (group_id == finfo->st_gid) + if (ap_group_id == finfo->st_gid) if (finfo->st_mode & S_IXGRP) return 1; #ifdef MULTIPLE_GROUPS @@ -1387,7 +1387,7 @@ } #endif -API_EXPORT(int) ind(const char *s, char c) +API_EXPORT(int) ap_ind(const char *s, char c) { register int x; @@ -1398,7 +1398,7 @@ return -1; } -API_EXPORT(int) rind(const char *s, char c) +API_EXPORT(int) ap_rind(const char *s, char c) { register int x; @@ -1409,7 +1409,7 @@ return -1; } -API_EXPORT(void) str_tolower(char *str) +API_EXPORT(void) ap_str_tolower(char *str) { while (*str) { *str = tolower(*str); @@ -1417,7 +1417,7 @@ } } -API_EXPORT(uid_t) uname2id(const char *name) +API_EXPORT(uid_t) ap_uname2id(const char *name) { #ifdef WIN32 return (1); @@ -1435,7 +1435,7 @@ #endif } -API_EXPORT(gid_t) gname2id(const char *name) +API_EXPORT(gid_t) ap_gname2id(const char *name) { #ifdef WIN32 return (1); @@ -1458,7 +1458,7 @@ * Parses a host of the form <address>[:port] * :port is permitted if 'port' is not NULL */ -unsigned long get_virthost_addr(const char *w, unsigned short *ports) +unsigned long ap_get_virthost_addr(const char *w, unsigned short *ports) { struct hostent *hep; unsigned long my_addr; @@ -1515,14 +1515,14 @@ for (x = 0; p->h_aliases[x]; ++x) { if (strchr(p->h_aliases[x], '.') && (!strncasecmp(p->h_aliases[x], p->h_name, strlen(p->h_name)))) - return pstrdup(a, p->h_aliases[x]); + return ap_pstrdup(a, p->h_aliases[x]); } return NULL; } - return pstrdup(a, (void *) p->h_name); + return ap_pstrdup(a, (void *) p->h_name); } -char *get_local_host(pool *a) +char *ap_get_local_host(pool *a) { #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 @@ -1565,7 +1565,7 @@ 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64 }; -API_EXPORT(char *) uudecode(pool *p, const char *bufcoded) +API_EXPORT(char *) ap_uudecode(pool *p, const char *bufcoded) { int nbytesdecoded; register const unsigned char *bufin; @@ -1587,7 +1587,7 @@ nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; nbytesdecoded = ((nprbytes + 3) / 4) * 3; - bufplain = palloc(p, nbytesdecoded + 1); + bufplain = ap_palloc(p, nbytesdecoded + 1); bufout = (unsigned char *) bufplain; bufin = (const unsigned char *) bufcoded; @@ -1616,7 +1616,7 @@ nprbytes = (bufin - (const unsigned char *) bufcoded) - 1; nbytesdecoded = ((nprbytes + 3) / 4) * 3; - bufplain = palloc(p, nbytesdecoded + 1); + bufplain = ap_palloc(p, nbytesdecoded + 1); bufout = (unsigned char *) bufplain; bufin = (const unsigned char *) bufcoded; 1.11 +7 -7 apache-1.3/src/main/util_date.c Index: util_date.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_date.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- util_date.c 1998/03/31 12:52:49 1.10 +++ util_date.c 1998/04/11 12:00:32 1.11 @@ -82,7 +82,7 @@ * * - swallow remaining characters * <x> - exact match for any other character */ -API_EXPORT(int) checkmask(const char *data, const char *mask) +API_EXPORT(int) ap_checkmask(const char *data, const char *mask) { int i; char d; @@ -136,7 +136,7 @@ * * This routine is intended to be very fast, much faster than mktime(). */ -API_EXPORT(time_t) tm2sec(const struct tm * t) +API_EXPORT(time_t) ap_tm2sec(const struct tm * t) { int year; time_t days; @@ -214,7 +214,7 @@ * but many changes since then. * */ -API_EXPORT(time_t) parseHTTPdate(const char *date) +API_EXPORT(time_t) ap_parseHTTPdate(const char *date) { struct tm ds; int mint, mon; @@ -243,7 +243,7 @@ ++date; /* Now pointing to first char after space, which should be */ /* start of the actual date information for all 3 formats. */ - if (checkmask(date, "## @$$ #### ##:##:## *")) { /* RFC 1123 format */ + if (ap_checkmask(date, "## @$$ #### ##:##:## *")) { /* RFC 1123 format */ ds.tm_year = ((date[7] - '0') * 10 + (date[8] - '0') - 19) * 100; if (ds.tm_year < 0) return BAD_DATE; @@ -255,7 +255,7 @@ monstr = date + 3; timstr = date + 12; } - else if (checkmask(date, "[EMAIL PROTECTED] ##:##:## *")) { /* RFC 850 format */ + else if (ap_checkmask(date, "[EMAIL PROTECTED] ##:##:## *")) { /* RFC 850 format */ ds.tm_year = ((date[7] - '0') * 10) + (date[8] - '0'); if (ds.tm_year < 70) ds.tm_year += 100; @@ -265,7 +265,7 @@ monstr = date + 3; timstr = date + 10; } - else if (checkmask(date, "@$$ ~# ##:##:## ####*")) { /* asctime format */ + else if (ap_checkmask(date, "@$$ ~# ##:##:## ####*")) { /* asctime format */ ds.tm_year = ((date[16] - '0') * 10 + (date[17] - '0') - 19) * 100; if (ds.tm_year < 0) return BAD_DATE; @@ -317,5 +317,5 @@ ds.tm_mon = mon; - return tm2sec(&ds); + return ap_tm2sec(&ds); } 1.14 +8 -8 apache-1.3/src/main/util_md5.c Index: util_md5.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_md5.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- util_md5.c 1998/03/31 12:52:50 1.13 +++ util_md5.c 1998/04/11 12:00:32 1.14 @@ -98,15 +98,15 @@ * Take the MD5 hash of the string argument. */ - MD5Init(&my_md5); - MD5Update(&my_md5, string, strlen((const char *) string)); - MD5Final(hash, &my_md5); + ap_MD5Init(&my_md5); + ap_MD5Update(&my_md5, string, strlen((const char *) string)); + ap_MD5Final(hash, &my_md5); for (i = 0, r = result; i < 16; i++, r += 2) sprintf(r, "%02x", hash[i]); *r = '\0'; - return pstrdup(p, result); + return ap_pstrdup(p, result); } /* these portions extracted from mpack, John G. Myers - [EMAIL PROTECTED] */ @@ -161,9 +161,9 @@ int i; char *p; - encodedDigest = (char *) pcalloc(a, 25 * sizeof(char)); + encodedDigest = (char *) ap_pcalloc(a, 25 * sizeof(char)); - MD5Final(digest, context); + ap_MD5Final(digest, context); digest[sizeof(digest) - 1] = digest[sizeof(digest) - 2] = 0; p = encodedDigest; @@ -186,10 +186,10 @@ long length = 0; int nbytes; - MD5Init(&context); + ap_MD5Init(&context); while ((nbytes = fread(buf, 1, sizeof(buf), infile))) { length += nbytes; - MD5Update(&context, buf, nbytes); + ap_MD5Update(&context, buf, nbytes); } rewind(infile); return ap_md5contextTo64(p, &context); 1.106 +107 -107 apache-1.3/src/main/util_script.c Index: util_script.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_script.c,v retrieving revision 1.105 retrieving revision 1.106 diff -u -r1.105 -r1.106 --- util_script.c 1998/03/31 12:52:50 1.105 +++ util_script.c 1998/04/11 12:00:32 1.106 @@ -107,7 +107,7 @@ if (numwords > APACHE_ARG_MAX - 5) { numwords = APACHE_ARG_MAX - 5; /* Truncate args to prevent overrun */ } - av = (char **) palloc(p, (numwords + 5) * sizeof(char *)); + av = (char **) ap_palloc(p, (numwords + 5) * sizeof(char *)); if (path) av[idx++] = path; @@ -119,9 +119,9 @@ av[idx++] = av0; for (x = 1; x <= numwords; x++) { - w = getword_nulls(p, &args, '+'); - unescape_url(w); - av[idx++] = escape_shell_cmd(p, w); + w = ap_getword_nulls(p, &args, '+'); + ap_unescape_url(w); + av[idx++] = ap_escape_shell_cmd(p, w); } av[idx] = NULL; return av; @@ -130,7 +130,7 @@ static char *http2env(pool *a, char *w) { - char *res = pstrcat(a, "HTTP_", w, NULL); + char *res = ap_pstrcat(a, "HTTP_", w, NULL); char *cp = res; while (*++cp) { @@ -145,25 +145,25 @@ return res; } -API_EXPORT(char **) create_environment(pool *p, table *t) +API_EXPORT(char **) ap_create_environment(pool *p, table *t) { array_header *env_arr = table_elts(t); table_entry *elts = (table_entry *) env_arr->elts; - char **env = (char **) palloc(p, (env_arr->nelts + 2) * sizeof(char *)); + char **env = (char **) ap_palloc(p, (env_arr->nelts + 2) * sizeof(char *)); int i, j; char *tz; char *whack; j = 0; - if (!table_get(t, "TZ")) { + if (!ap_table_get(t, "TZ")) { tz = getenv("TZ"); if (tz != NULL) - env[j++] = pstrcat(p, "TZ=", tz, NULL); + env[j++] = ap_pstrcat(p, "TZ=", tz, NULL); } for (i = 0; i < env_arr->nelts; ++i) { if (!elts[i].key) continue; - env[j] = pstrcat(p, elts[i].key, "=", elts[i].val, NULL); + env[j] = ap_pstrcat(p, elts[i].key, "=", elts[i].val, NULL); whack = env[j]; if (isdigit(*whack)) { *whack++ = '_'; @@ -181,7 +181,7 @@ return env; } -API_EXPORT(void) add_common_vars(request_rec *r) +API_EXPORT(void) ap_add_common_vars(request_rec *r) { table *e = r->subprocess_env; server_rec *s = r->server; @@ -212,9 +212,9 @@ */ if (!strcasecmp(hdrs[i].key, "Content-type")) - table_setn(e, "CONTENT_TYPE", hdrs[i].val); + ap_table_setn(e, "CONTENT_TYPE", hdrs[i].val); else if (!strcasecmp(hdrs[i].key, "Content-length")) - table_setn(e, "CONTENT_LENGTH", hdrs[i].val); + ap_table_setn(e, "CONTENT_LENGTH", hdrs[i].val); /* * You really don't want to disable this check, since it leaves you * wide open to CGIs stealing passwords and people viewing them @@ -226,7 +226,7 @@ continue; #endif else - table_setn(e, http2env(r->pool, hdrs[i].key), hdrs[i].val); + ap_table_setn(e, http2env(r->pool, hdrs[i].key), hdrs[i].val); } if (!(env_path = getenv("PATH"))) @@ -234,43 +234,43 @@ #ifdef WIN32 if (env_temp = getenv("SystemRoot")) - table_setn(e, "SystemRoot", env_temp); + ap_table_setn(e, "SystemRoot", env_temp); if (env_temp = getenv("COMSPEC")) - table_setn(e, "COMSPEC", env_temp); + ap_table_setn(e, "COMSPEC", env_temp); if (env_temp = getenv("WINDIR")) - table_setn(e, "WINDIR", env_temp); + ap_table_setn(e, "WINDIR", env_temp); #endif - table_setn(e, "PATH", env_path); - table_setn(e, "SERVER_SOFTWARE", apapi_get_server_version()); - table_setn(e, "SERVER_NAME", get_server_name(r)); - table_setn(e, "SERVER_PORT", psprintf(r->pool, "%u", get_server_port(r))); - host = get_remote_host(c, r->per_dir_config, REMOTE_HOST); + ap_table_setn(e, "PATH", env_path); + ap_table_setn(e, "SERVER_SOFTWARE", ap_get_server_version()); + ap_table_setn(e, "SERVER_NAME", ap_get_server_name(r)); + ap_table_setn(e, "SERVER_PORT", ap_psprintf(r->pool, "%u", ap_get_server_port(r))); + host = ap_get_remote_host(c, r->per_dir_config, REMOTE_HOST); if (host) { - table_setn(e, "REMOTE_HOST", host); + ap_table_setn(e, "REMOTE_HOST", host); } - table_setn(e, "REMOTE_ADDR", c->remote_ip); - table_setn(e, "DOCUMENT_ROOT", document_root(r)); /* Apache */ - table_setn(e, "SERVER_ADMIN", s->server_admin); /* Apache */ - table_setn(e, "SCRIPT_FILENAME", r->filename); /* Apache */ + ap_table_setn(e, "REMOTE_ADDR", c->remote_ip); + ap_table_setn(e, "DOCUMENT_ROOT", ap_document_root(r)); /* Apache */ + ap_table_setn(e, "SERVER_ADMIN", s->server_admin); /* Apache */ + ap_table_setn(e, "SCRIPT_FILENAME", r->filename); /* Apache */ - table_setn(e, "REMOTE_PORT", psprintf(r->pool, "%d", ntohs(c->remote_addr.sin_port))); + ap_table_setn(e, "REMOTE_PORT", ap_psprintf(r->pool, "%d", ntohs(c->remote_addr.sin_port))); if (c->user) - table_setn(e, "REMOTE_USER", c->user); - if (c->auth_type) - table_setn(e, "AUTH_TYPE", c->auth_type); - rem_logname = get_remote_logname(r); + ap_table_setn(e, "REMOTE_USER", c->user); + if (c->ap_auth_type) + ap_table_setn(e, "AUTH_TYPE", c->ap_auth_type); + rem_logname = ap_get_remote_logname(r); if (rem_logname) - table_setn(e, "REMOTE_IDENT", pstrdup(r->pool, rem_logname)); + ap_table_setn(e, "REMOTE_IDENT", ap_pstrdup(r->pool, rem_logname)); /* Apache custom error responses. If we have redirected set two new vars */ if (r->prev) { if (r->prev->args) - table_setn(e, "REDIRECT_QUERY_STRING", r->prev->args); + ap_table_setn(e, "REDIRECT_QUERY_STRING", r->prev->args); if (r->prev->uri) - table_setn(e, "REDIRECT_URL", r->prev->uri); + ap_table_setn(e, "REDIRECT_URL", r->prev->uri); } } @@ -279,7 +279,7 @@ * and find as much of the two that match as possible. */ -API_EXPORT(int) find_path_info(const char *uri, const char *path_info) +API_EXPORT(int) ap_find_path_info(const char *uri, const char *path_info) { int lu = strlen(uri); int lp = strlen(path_info); @@ -303,7 +303,7 @@ char *first, *last; if (r->the_request == NULL) - return (char *) pcalloc(r->pool, 1); + return (char *) ap_pcalloc(r->pool, 1); first = r->the_request; /* use the request-line */ @@ -316,18 +316,18 @@ while (*last && !isspace(*last)) ++last; /* end at next whitespace */ - return pstrndup(r->pool, first, last - first); + return ap_pstrndup(r->pool, first, last - first); } -API_EXPORT(void) add_cgi_vars(request_rec *r) +API_EXPORT(void) ap_add_cgi_vars(request_rec *r) { table *e = r->subprocess_env; - table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1"); - table_setn(e, "SERVER_PROTOCOL", r->protocol); - table_setn(e, "REQUEST_METHOD", r->method); - table_setn(e, "QUERY_STRING", r->args ? r->args : ""); - table_setn(e, "REQUEST_URI", original_uri(r)); + ap_table_setn(e, "GATEWAY_INTERFACE", "CGI/1.1"); + ap_table_setn(e, "SERVER_PROTOCOL", r->protocol); + ap_table_setn(e, "REQUEST_METHOD", r->method); + ap_table_setn(e, "QUERY_STRING", r->args ? r->args : ""); + ap_table_setn(e, "REQUEST_URI", original_uri(r)); /* Note that the code below special-cases scripts run from includes, * because it "knows" that the sub_request has been hacked to have the @@ -336,20 +336,20 @@ */ if (!strcmp(r->protocol, "INCLUDED")) { - table_setn(e, "SCRIPT_NAME", r->uri); + ap_table_setn(e, "SCRIPT_NAME", r->uri); if (r->path_info && *r->path_info) - table_setn(e, "PATH_INFO", r->path_info); + ap_table_setn(e, "PATH_INFO", r->path_info); } else if (!r->path_info || !*r->path_info) { - table_setn(e, "SCRIPT_NAME", r->uri); + ap_table_setn(e, "SCRIPT_NAME", r->uri); } else { - int path_info_start = find_path_info(r->uri, r->path_info); + int path_info_start = ap_find_path_info(r->uri, r->path_info); - table_setn(e, "SCRIPT_NAME", pstrndup(r->pool, r->uri, + ap_table_setn(e, "SCRIPT_NAME", ap_pstrndup(r->pool, r->uri, path_info_start)); - table_setn(e, "PATH_INFO", r->path_info); + ap_table_setn(e, "PATH_INFO", r->path_info); } if (r->path_info && r->path_info[0]) { @@ -358,7 +358,7 @@ * Need to re-escape it for this, since the entire URI was * un-escaped before we determined where the PATH_INFO began. */ - request_rec *pa_req = sub_req_lookup_uri(escape_uri(r->pool, r->path_info), + request_rec *pa_req = ap_sub_req_lookup_uri(escape_uri(r->pool, r->path_info), r); /* Don't bother destroying pa_req --- it's only created in @@ -372,14 +372,14 @@ #ifdef WIN32 char buffer[HUGE_STRING_LEN]; #endif - char *pt = pstrcat(r->pool, pa_req->filename, pa_req->path_info, + char *pt = ap_pstrcat(r->pool, pa_req->filename, pa_req->path_info, NULL); #ifdef WIN32 /* We need to make this a real Windows path name */ GetFullPathName(pt, HUGE_STRING_LEN, buffer, NULL); - table_setn(e, "PATH_TRANSLATED", pstrdup(r->pool, buffer)); + ap_table_setn(e, "PATH_TRANSLATED", ap_pstrdup(r->pool, buffer)); #else - table_setn(e, "PATH_TRANSLATED", pt); + ap_table_setn(e, "PATH_TRANSLATED", pt); #endif } } @@ -398,13 +398,13 @@ *buffer = '\0'; w = buffer ? buffer : x; - hard_timeout("read script header", r); + ap_hard_timeout("read script header", r); while (1) { if ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data) == 0) { - kill_timeout(r); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_kill_timeout(r); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Premature end of script headers: %s", r->filename); return SERVER_ERROR; } @@ -434,9 +434,9 @@ if (w[0] == '\0') { int cond_status = OK; - kill_timeout(r); + ap_kill_timeout(r); if ((cgi_status == HTTP_OK) && (r->method_number == M_GET)) { - cond_status = meets_conditions(r); + cond_status = ap_meets_conditions(r); } return cond_status; } @@ -453,8 +453,8 @@ while ((*getsfunc) (w, MAX_STRING_LEN - 1, getsfunc_data)) continue; - kill_timeout(r); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_kill_timeout(r); + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "%s: %s", malformed, r->filename); return SERVER_ERROR; } @@ -471,38 +471,38 @@ while (endp > l && isspace(*endp)) *endp-- = '\0'; - r->content_type = pstrdup(r->pool, l); - str_tolower(r->content_type); + r->content_type = ap_pstrdup(r->pool, l); + ap_str_tolower(r->content_type); } else if (!strcasecmp(w, "Status")) { sscanf(l, "%d", &r->status); - r->status_line = pstrdup(r->pool, l); + r->status_line = ap_pstrdup(r->pool, l); } else if (!strcasecmp(w, "Location")) { - table_set(r->headers_out, w, l); + ap_table_set(r->headers_out, w, l); } else if (!strcasecmp(w, "Content-Length")) { - table_set(r->headers_out, w, l); + ap_table_set(r->headers_out, w, l); } else if (!strcasecmp(w, "Transfer-Encoding")) { - table_set(r->headers_out, w, l); + ap_table_set(r->headers_out, w, l); } /* * If the script gave us a Last-Modified header, we can't just * pass it on blindly because of restrictions on future values. */ else if (!strcasecmp(w, "Last-Modified")) { - time_t mtime = parseHTTPdate(l); + time_t mtime = ap_parseHTTPdate(l); - update_mtime(r, mtime); - set_last_modified(r); + ap_update_mtime(r, mtime); + ap_set_last_modified(r); } /* * If the script returned a specific status, that's what * we'll use - otherwise we assume 200 OK. */ else if (!strcasecmp(w, "Status")) { - table_set(r->headers_out, w, l); + ap_table_set(r->headers_out, w, l); cgi_status = atoi(l); } @@ -512,10 +512,10 @@ * separately. Lets humour those browsers. */ else if (!strcasecmp(w, "Set-Cookie")) { - table_add(r->err_headers_out, w, l); + ap_table_add(r->err_headers_out, w, l); } else { - table_merge(r->err_headers_out, w, l); + ap_table_merge(r->err_headers_out, w, l); } } } @@ -525,38 +525,38 @@ return fgets(buf, len, (FILE *) f) != NULL; } -API_EXPORT(int) scan_script_header_err(request_rec *r, FILE *f, char *buffer) +API_EXPORT(int) ap_scan_script_header_err(request_rec *r, FILE *f, char *buffer) { return scan_script_header_err_core(r, buffer, getsfunc_FILE, f); } static int getsfunc_BUFF(char *w, int len, void *fb) { - return bgets(w, len, (BUFF *) fb) > 0; + return ap_bgets(w, len, (BUFF *) fb) > 0; } -API_EXPORT(int) scan_script_header_err_buff(request_rec *r, BUFF *fb, +API_EXPORT(int) ap_scan_script_header_err_buff(request_rec *r, BUFF *fb, char *buffer) { return scan_script_header_err_core(r, buffer, getsfunc_BUFF, fb); } -API_EXPORT(void) send_size(size_t size, request_rec *r) +API_EXPORT(void) ap_send_size(size_t size, request_rec *r) { /* XXX: this -1 thing is a gross hack */ if (size == (size_t)-1) - rputs(" -", r); + ap_rputs(" -", r); else if (!size) - rputs(" 0k", r); + ap_rputs(" 0k", r); else if (size < 1024) - rputs(" 1k", r); + ap_rputs(" 1k", r); else if (size < 1048576) - rprintf(r, "%4dk", (size + 512) / 1024); + ap_rprintf(r, "%4dk", (size + 512) / 1024); else if (size < 103809024) - rprintf(r, "%4.1fM", size / 1048576.0); + ap_rprintf(r, "%4.1fM", size / 1048576.0); else - rprintf(r, "%4dM", (size + 524288) / 1048576); + ap_rprintf(r, "%4dM", (size + 524288) / 1048576); } #if defined(__EMX__) || defined(WIN32) @@ -573,7 +573,7 @@ /* Add extra strings to array. */ n = n + 2; - av = (char **) palloc(p, (n + 1) * sizeof(char *)); + av = (char **) ap_palloc(p, (n + 1) * sizeof(char *)); av[0] = av0; /* Now insert the extra strings we made room for above. */ @@ -581,9 +581,9 @@ av[2] = strdup(path); for (x = (1 + 2); x < n; x++) { - w = getword(p, &args, '+'); - unescape_url(w); - av[x] = escape_shell_cmd(p, w); + w = ap_getword(p, &args, '+'); + ap_unescape_url(w); + av[x] = ap_escape_shell_cmd(p, w); } av[n] = NULL; return av; @@ -591,14 +591,14 @@ #endif -API_EXPORT(int) call_exec(request_rec *r, char *argv0, char **env, int shellcmd) +API_EXPORT(int) ap_call_exec(request_rec *r, char *argv0, char **env, int shellcmd) { int pid = 0; #if defined(RLIMIT_CPU) || defined(RLIMIT_NPROC) || \ defined(RLIMIT_DATA) || defined(RLIMIT_VMEM) || defined (RLIMIT_AS) core_dir_config *conf = - (core_dir_config *) get_module_config(r->per_dir_config, &core_module); + (core_dir_config *) ap_get_module_config(r->per_dir_config, &core_module); #endif @@ -611,29 +611,29 @@ #ifdef RLIMIT_CPU if (conf->limit_cpu != NULL) if ((setrlimit(RLIMIT_CPU, conf->limit_cpu)) != 0) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "setrlimit: failed to set CPU usage limit"); #endif #ifdef RLIMIT_NPROC if (conf->limit_nproc != NULL) if ((setrlimit(RLIMIT_NPROC, conf->limit_nproc)) != 0) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "setrlimit: failed to set process limit"); #endif #if defined(RLIMIT_AS) if (conf->limit_mem != NULL) if ((setrlimit(RLIMIT_AS, conf->limit_mem)) != 0) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "setrlimit(RLIMIT_AS): failed to set memory usage limit"); #elif defined(RLIMIT_DATA) if (conf->limit_mem != NULL) if ((setrlimit(RLIMIT_DATA, conf->limit_mem)) != 0) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "setrlimit(RLIMIT_DATA): failed to set memory usage limit"); #elif defined(RLIMIT_VMEM) if (conf->limit_mem != NULL) if ((setrlimit(RLIMIT_VMEM, conf->limit_mem)) != 0) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "setrlimit(RLIMIT_VMEM): failed to set memory usage limit"); #endif @@ -645,7 +645,7 @@ FILE *program; program = fopen(r->filename, "r"); if (!program) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, "fopen(%s) failed", + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "fopen(%s) failed", r->filename); return (pid); } @@ -738,13 +738,13 @@ if (!is_exe) { program = fopen(r->filename, "rb"); if (!program) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "fopen(%s) failed", r->filename); return (pid); } sz = fread(interpreter, 1, sizeof(interpreter) - 1, program); if (sz < 0) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "fread of %s failed", r->filename); fclose(program); return (pid); @@ -804,9 +804,9 @@ return (pid); } #else - if (suexec_enabled && - ((r->server->server_uid != user_id) || - (r->server->server_gid != group_id) || + if (ap_suexec_enabled && + ((r->server->server_uid != ap_user_id) || + (r->server->server_gid != ap_group_id) || (!strncmp("/~", r->uri, 2)))) { char *execuser, *grpname; @@ -815,22 +815,22 @@ if (!strncmp("/~", r->uri, 2)) { gid_t user_gid; - char *username = pstrdup(r->pool, r->uri + 2); + char *username = ap_pstrdup(r->pool, r->uri + 2); char *pos = strchr(username, '/'); if (pos) *pos = '\0'; if ((pw = getpwnam(username)) == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "getpwnam: invalid username %s", username); return (pid); } - execuser = pstrcat(r->pool, "~", pw->pw_name, NULL); + execuser = ap_pstrcat(r->pool, "~", pw->pw_name, NULL); user_gid = pw->pw_gid; if ((gr = getgrgid(user_gid)) == NULL) { - if ((grpname = palloc(r->pool, 16)) == NULL) + if ((grpname = ap_palloc(r->pool, 16)) == NULL) return (pid); else ap_snprintf(grpname, 16, "%ld", (long) user_gid); @@ -840,15 +840,15 @@ } else { if ((pw = getpwuid(r->server->server_uid)) == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "getpwuid: invalid userid %ld", (long) r->server->server_uid); return (pid); } - execuser = pstrdup(r->pool, pw->pw_name); + execuser = ap_pstrdup(r->pool, pw->pw_name); if ((gr = getgrgid(r->server->server_gid)) == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "getgrgid: invalid groupid %ld", (long) r->server->server_gid); return (pid); 1.19 +52 -52 apache-1.3/src/main/util_uri.c Index: util_uri.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_uri.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- util_uri.c 1998/04/01 14:41:36 1.18 +++ util_uri.c 1998/04/11 12:00:32 1.19 @@ -80,7 +80,7 @@ }; -API_EXPORT(unsigned short) default_port_for_scheme(const char *scheme_str) +API_EXPORT(unsigned short) ap_default_port_for_scheme(const char *scheme_str) { schemes_t *scheme; @@ -91,10 +91,10 @@ return 0; } -API_EXPORT(unsigned short) default_port_for_request(const request_rec *r) +API_EXPORT(unsigned short) ap_default_port_for_request(const request_rec *r) { return (r->parsed_uri.scheme) - ? default_port_for_scheme(r->parsed_uri.scheme) + ? ap_default_port_for_scheme(r->parsed_uri.scheme) : 0; } @@ -102,7 +102,7 @@ * from a call to gethostbyname() and lives in static storage. * By creating a copy we can tuck it away for later use. */ -API_EXPORT(struct hostent *) pduphostent(pool *p, struct hostent *hp) +API_EXPORT(struct hostent *) ap_pduphostent(pool *p, struct hostent *hp) { struct hostent *newent; char **ptrs; @@ -124,19 +124,19 @@ continue; /* Allocate hostent structure, alias ptrs, addr ptrs, addrs */ - newent = (struct hostent *) palloc(p, sizeof(*hp)); - aliases = (char **) palloc(p, (j+1) * sizeof(char*)); - ptrs = (char **) palloc(p, (i+1) * sizeof(char*)); - addrs = (struct in_addr *) palloc(p, (i+1) * sizeof(struct in_addr)); + newent = (struct hostent *) ap_palloc(p, sizeof(*hp)); + aliases = (char **) ap_palloc(p, (j+1) * sizeof(char*)); + ptrs = (char **) ap_palloc(p, (i+1) * sizeof(char*)); + addrs = (struct in_addr *) ap_palloc(p, (i+1) * sizeof(struct in_addr)); *newent = *hp; - newent->h_name = pstrdup(p, hp->h_name); + newent->h_name = ap_pstrdup(p, hp->h_name); newent->h_aliases = aliases; newent->h_addr_list = (char**) ptrs; /* Copy Alias Names: */ for (j = 0; hp->h_aliases[j] != NULL; ++j) { - aliases[j] = pstrdup(p, hp->h_aliases[j]); + aliases[j] = ap_pstrdup(p, hp->h_aliases[j]); } aliases[j] = NULL; @@ -155,23 +155,23 @@ * COPY OF the hostent structure, intended to be stored and used later. * (gethostbyname() uses static storage that would be overwritten on each call) */ -API_EXPORT(struct hostent *) pgethostbyname(pool *p, const char *hostname) +API_EXPORT(struct hostent *) ap_pgethostbyname(pool *p, const char *hostname) { struct hostent *hp = gethostbyname(hostname); - return (hp == NULL) ? NULL : pduphostent(p, hp); + return (hp == NULL) ? NULL : ap_pduphostent(p, hp); } /* Unparse a uri_components structure to an URI string. * Optionally suppress the password for security reasons. */ -API_EXPORT(char *) unparse_uri_components(pool *p, const uri_components *uptr, unsigned flags) +API_EXPORT(char *) ap_unparse_uri_components(pool *p, const uri_components *uptr, unsigned flags) { char *ret = ""; /* Construct a "user:password@" string, honoring the passed UNP_ flags: */ if (uptr->user||uptr->password) - ret = pstrcat (p, + ret = ap_pstrcat (p, (uptr->user && !(flags & UNP_OMITUSER)) ? uptr->user : "", (uptr->password && !(flags & UNP_OMITPASSWORD)) ? ":" : "", (uptr->password && !(flags & UNP_OMITPASSWORD)) @@ -181,7 +181,7 @@ /* Construct scheme://site string */ if (uptr->hostname && !(flags & UNP_OMITSITEPART)) { - ret = pstrcat (p, + ret = ap_pstrcat (p, uptr->scheme, "://", ret, uptr->hostname ? uptr->hostname : "", uptr->port_str ? ":" : "", @@ -190,7 +190,7 @@ } /* Append path, query and fragment strings: */ - ret = pstrcat (p, + ret = ap_pstrcat (p, ret, uptr->path, uptr->query ? "?" : "", @@ -214,7 +214,7 @@ static regex_t re_uri; static regex_t re_hostpart; -void util_uri_init(void) +void ap_util_uri_init(void) { int ret; const char *re_str; @@ -245,7 +245,7 @@ /* Make a readable error message */ ret = regerror(ret, &re_uri, line, sizeof line); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, "Internal error: regcomp(\"%s\") returned non-zero (%s) - " "possibly due to broken regex lib! " "Did you define WANTHSREGEX=yes?", @@ -264,7 +264,7 @@ /* Make a readable error message */ ret = regerror(ret, &re_hostpart, line, sizeof line); - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, "Internal error: regcomp(\"%s\") returned non-zero (%s) - " "possibly due to broken regex lib! " "Did you define WANTHSREGEX=yes?", @@ -283,7 +283,7 @@ * - fills in fields of uri_components *uptr * - none on any of the r->* fields */ -API_EXPORT(int) parse_uri_components(pool *p, const char *uri, uri_components *uptr) +API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr) { int ret; regmatch_t match[10]; /* This must have at least as much elements @@ -300,7 +300,7 @@ ret = regexec(&re_uri, uri, re_uri.re_nsub + 1, match, 0); if (ret != 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, "regexec() could not parse uri (\"%s\")", uri); @@ -308,28 +308,28 @@ } if (match[2].rm_so != match[2].rm_eo) - uptr->scheme = pstrndup (p, uri+match[2].rm_so, match[2].rm_eo - match[2].rm_so); + uptr->scheme = ap_pstrndup (p, uri+match[2].rm_so, match[2].rm_eo - match[2].rm_so); /* empty hostinfo is valid, that's why we test $1 but use $3 */ if (match[1].rm_so != match[1].rm_eo) - uptr->hostinfo = pstrndup (p, uri+match[3].rm_so, match[3].rm_eo - match[3].rm_so); + uptr->hostinfo = ap_pstrndup (p, uri+match[3].rm_so, match[3].rm_eo - match[3].rm_so); if (match[4].rm_so != match[4].rm_eo) - uptr->path = pstrndup (p, uri+match[4].rm_so, match[4].rm_eo - match[4].rm_so); + uptr->path = ap_pstrndup (p, uri+match[4].rm_so, match[4].rm_eo - match[4].rm_so); /* empty query string is valid, that's why we test $5 but use $6 */ if (match[5].rm_so != match[5].rm_eo) - uptr->query = pstrndup (p, uri+match[6].rm_so, match[6].rm_eo - match[6].rm_so); + uptr->query = ap_pstrndup (p, uri+match[6].rm_so, match[6].rm_eo - match[6].rm_so); /* empty fragment is valid, test $7 use $8 */ if (match[7].rm_so != match[7].rm_eo) - uptr->fragment = pstrndup (p, uri+match[8].rm_so, match[8].rm_eo - match[8].rm_so); + uptr->fragment = ap_pstrndup (p, uri+match[8].rm_so, match[8].rm_eo - match[8].rm_so); if (uptr->hostinfo) { /* Parse the hostinfo part to extract user, password, host, and port */ ret = regexec(&re_hostpart, uptr->hostinfo, re_hostpart.re_nsub + 1, match, 0); if (ret != 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, NULL, "regexec() could not parse (\"%s\") as host part", uptr->hostinfo); @@ -342,20 +342,20 @@ /* empty user is valid, that's why we test $1 but use $2 */ if (match[1].rm_so != match[1].rm_eo) - uptr->user = pstrndup (p, uptr->hostinfo+match[2].rm_so, match[2].rm_eo - match[2].rm_so); + uptr->user = ap_pstrndup (p, uptr->hostinfo+match[2].rm_so, match[2].rm_eo - match[2].rm_so); /* empty password is valid, test $3 but use $4 */ if (match[3].rm_so != match[3].rm_eo) - uptr->password = pstrndup (p, uptr->hostinfo+match[4].rm_so, match[4].rm_eo - match[4].rm_so); + uptr->password = ap_pstrndup (p, uptr->hostinfo+match[4].rm_so, match[4].rm_eo - match[4].rm_so); /* empty hostname is valid, and implied by the existence of hostinfo */ - uptr->hostname = pstrndup (p, uptr->hostinfo+match[5].rm_so, match[5].rm_eo - match[5].rm_so); + uptr->hostname = ap_pstrndup (p, uptr->hostinfo+match[5].rm_so, match[5].rm_eo - match[5].rm_so); if (match[6].rm_so != match[6].rm_eo) { /* Note that the port string can be empty. * If it is, we use the default port associated with the scheme */ - uptr->port_str = pstrndup (p, uptr->hostinfo+match[7].rm_so, match[7].rm_eo - match[7].rm_so); + uptr->port_str = ap_pstrndup (p, uptr->hostinfo+match[7].rm_so, match[7].rm_eo - match[7].rm_so); if (uptr->port_str[0] != '\0') { char *endstr; int port; @@ -368,7 +368,7 @@ } } else { - uptr->port = uptr->scheme ? default_port_for_scheme(uptr->scheme) : DEFAULT_HTTP_PORT; + uptr->port = uptr->scheme ? ap_default_port_for_scheme(uptr->scheme) : DEFAULT_HTTP_PORT; } } } @@ -412,7 +412,7 @@ #define NOTEND_HOSTINFO (T_SLASH | T_QUESTION | T_HASH | T_NUL) #define NOTEND_PATH (T_QUESTION | T_HASH | T_NUL) -void util_uri_init(void) +void ap_util_uri_init(void) { /* nothing to do */ } @@ -425,7 +425,7 @@ * - fills in fields of uri_components *uptr * - none on any of the r->* fields */ -API_EXPORT(int) parse_uri_components(pool *p, const char *uri, uri_components *uptr) +API_EXPORT(int) ap_parse_uri_components(pool *p, const char *uri, uri_components *uptr) { const char *s; const char *s1; @@ -453,7 +453,7 @@ ++s; } if (s != uri) { - uptr->path = pstrndup(p, uri, s - uri); + uptr->path = ap_pstrndup(p, uri, s - uri); } if (*s == 0) { return HTTP_OK; @@ -462,16 +462,16 @@ ++s; s1 = strchr(s, '#'); if (s1) { - uptr->fragment = pstrdup(p, s1 + 1); - uptr->query = pstrndup(p, s, s1 - s); + uptr->fragment = ap_pstrdup(p, s1 + 1); + uptr->query = ap_pstrndup(p, s, s1 - s); } else { - uptr->query = pstrdup(p, s); + uptr->query = ap_pstrdup(p, s); } return HTTP_OK; } /* otherwise it's a fragment */ - uptr->fragment = pstrdup(p, s + 1); + uptr->fragment = ap_pstrdup(p, s + 1); return HTTP_OK; } @@ -485,14 +485,14 @@ goto deal_with_path; /* backwards predicted taken! */ } - uptr->scheme = pstrndup(p, uri, s - uri); + uptr->scheme = ap_pstrndup(p, uri, s - uri); s += 3; hostinfo = s; while ((uri_delims[*(unsigned char *)s] & NOTEND_HOSTINFO) == 0) { ++s; } uri = s; /* whatever follows hostinfo is start of uri */ - uptr->hostinfo = pstrndup(p, hostinfo, uri - hostinfo); + uptr->hostinfo = ap_pstrndup(p, hostinfo, uri - hostinfo); /* If there's a username:[EMAIL PROTECTED]:port, the @ we want is the last @... * too bad there's no memrchr()... For the C purists, note that hostinfo @@ -511,12 +511,12 @@ s = memchr(hostinfo, ':', uri - hostinfo); if (s == NULL) { /* we expect the common case to have no port */ - uptr->hostname = pstrndup(p, hostinfo, uri - hostinfo); + uptr->hostname = ap_pstrndup(p, hostinfo, uri - hostinfo); goto deal_with_path; } - uptr->hostname = pstrndup(p, hostinfo, s - hostinfo); + uptr->hostname = ap_pstrndup(p, hostinfo, s - hostinfo); ++s; - uptr->port_str = pstrndup(p, s, uri - s); + uptr->port_str = ap_pstrndup(p, s, uri - s); if (uri != s) { port = strtol(uptr->port_str, &endstr, 10); uptr->port = port; @@ -526,19 +526,19 @@ /* Invalid characters after ':' found */ return HTTP_BAD_REQUEST; } - uptr->port = default_port_for_scheme(uptr->scheme); + uptr->port = ap_default_port_for_scheme(uptr->scheme); goto deal_with_path; } /* first colon delimits username:password */ s1 = memchr(hostinfo, ':', s - hostinfo); if (s1) { - uptr->user = pstrndup(p, hostinfo, s1 - hostinfo); + uptr->user = ap_pstrndup(p, hostinfo, s1 - hostinfo); ++s1; - uptr->password = pstrndup(p, s1, s - s1); + uptr->password = ap_pstrndup(p, s1, s - s1); } else { - uptr->user = pstrndup(p, hostinfo, s - hostinfo); + uptr->user = ap_pstrndup(p, hostinfo, s - hostinfo); } hostinfo = s + 1; goto deal_with_host; @@ -549,7 +549,7 @@ * currently at http://www.mcom.com/newsref/std/tunneling_ssl.html * for the format of the "CONNECT host:port HTTP/1.0" request */ -API_EXPORT(int) parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr) +API_EXPORT(int) ap_parse_hostinfo_components(pool *p, const char *hostinfo, uri_components *uptr) { const char *s; char *endstr; @@ -559,7 +559,7 @@ */ memset (uptr, '\0', sizeof(*uptr)); uptr->is_initialized = 1; - uptr->hostinfo = pstrdup(p, hostinfo); + uptr->hostinfo = ap_pstrdup(p, hostinfo); /* We expect hostinfo to point to the first character of * the hostname. There must be a port, separated by a colon @@ -568,9 +568,9 @@ if (s == NULL) { return HTTP_BAD_REQUEST; } - uptr->hostname = pstrndup(p, hostinfo, s - hostinfo); + uptr->hostname = ap_pstrndup(p, hostinfo, s - hostinfo); ++s; - uptr->port_str = pstrdup(p, s); + uptr->port_str = ap_pstrdup(p, s); if (*s != '\0') { uptr->port = strtol(uptr->port_str, &endstr, 10); if (*endstr == '\0') { 1.29 +80 -80 apache-1.3/src/modules/example/mod_example.c Index: mod_example.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/example/mod_example.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- mod_example.c 1998/03/31 12:52:57 1.28 +++ mod_example.c 1998/04/11 12:00:37 1.29 @@ -255,7 +255,7 @@ static excfg *our_dconfig(request_rec *r) { - return (excfg *) get_module_config(r->per_dir_config, &example_module); + return (excfg *) ap_get_module_config(r->per_dir_config, &example_module); } #if 0 @@ -265,7 +265,7 @@ static excfg *our_sconfig(server_rec *s) { - return (excfg *) get_module_config(s->module_config, &example_module); + return (excfg *) ap_get_module_config(s->module_config, &example_module); } /* @@ -274,7 +274,7 @@ static excfg *our_rconfig(request_rec *r) { - return (excfg *) get_module_config(r->request_config, &example_module); + return (excfg *) ap_get_module_config(r->request_config, &example_module); } #endif @@ -287,14 +287,14 @@ * If we haven't already allocated our module-private pool, do so now. */ if (example_pool == NULL) { - example_pool = make_sub_pool(NULL); + example_pool = ap_make_sub_pool(NULL); }; /* * Likewise for the table of routine/environment pairs we visit outside of * request context. */ if (static_calls_made == NULL) { - static_calls_made = make_table(example_pool, 16); + static_calls_made = ap_make_table(example_pool, 16); }; } @@ -337,7 +337,7 @@ */ if (r != NULL) { p = r->pool; - if ((trace_copy = table_get(r->notes, TRACE_NOTE)) == NULL) { + if ((trace_copy = ap_table_get(r->notes, TRACE_NOTE)) == NULL) { trace_copy = ""; } } @@ -352,16 +352,16 @@ * Make a new sub-pool and copy any existing trace to it. Point the * trace cell at the copied value. */ - p = make_sub_pool(example_pool); + p = ap_make_sub_pool(example_pool); if (trace != NULL) { - trace = pstrdup(p, trace); + trace = ap_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) { - destroy_pool(example_subpool); + ap_destroy_pool(example_subpool); } example_subpool = p; trace_copy = trace; @@ -383,8 +383,8 @@ if (r == NULL) { char *key; - key = pstrcat(p, note, ":", where, NULL); - if (table_get(static_calls_made, key) != NULL) { + key = ap_pstrcat(p, note, ":", where, NULL); + if (ap_table_get(static_calls_made, key) != NULL) { /* * Been here, done this. */ @@ -395,17 +395,17 @@ * First time for this combination of routine and environment - * log it so we don't do it again. */ - table_set(static_calls_made, key, "been here"); + ap_table_set(static_calls_made, key, "been here"); } } - addon = pstrcat(p, " <LI>\n", " <DL>\n", " <DT><SAMP>", + addon = ap_pstrcat(p, " <LI>\n", " <DL>\n", " <DT><SAMP>", note, "</SAMP>\n", " </DT>\n", " <DD><SAMP>[", where, "]</SAMP>\n", " </DD>\n", " </DL>\n", " </LI>\n", NULL); sofar = (trace_copy == NULL) ? "" : trace_copy; - trace_copy = pstrcat(p, sofar, addon, NULL); + trace_copy = ap_pstrcat(p, sofar, addon, NULL); if (r != NULL) { - table_set(r->notes, TRACE_NOTE, trace_copy); + ap_table_set(r->notes, TRACE_NOTE, trace_copy); } else { trace = trace_copy; @@ -418,7 +418,7 @@ */ #define EXAMPLE_LOG_EACH 0 if (EXAMPLE_LOG_EACH && (s != NULL)) { - aplog_error(APLOG_MARK, APLOG_DEBUG, s, "mod_example: %s", note); + ap_log_error(APLOG_MARK, APLOG_DEBUG, s, "mod_example: %s", note); } } @@ -503,14 +503,14 @@ * is broken. */ r->content_type = "text/html"; - soft_timeout("send example call trace", r); - send_http_header(r); + ap_soft_timeout("send example call trace", r); + ap_send_http_header(r); /* * If we're only supposed to send header information (HEAD request), we're * already there. */ if (r->header_only) { - kill_timeout(r); + ap_kill_timeout(r); return OK; } @@ -518,63 +518,63 @@ * Now send our actual output. Since we tagged this as being * "text/html", we need to embed any HTML. */ - rputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n", r); - rputs("<HTML>\n", r); - rputs(" <HEAD>\n", r); - rputs(" <TITLE>mod_example Module Content-Handler Output\n", r); - rputs(" </TITLE>\n", r); - rputs(" </HEAD>\n", r); - rputs(" <BODY>\n", r); - rputs(" <H1><SAMP>mod_example</SAMP> Module Content-Handler Output\n", r); - rputs(" </H1>\n", r); - rputs(" <P>\n", r); - rprintf(r, " Apache HTTP Server version: \"%s\"\n", - apapi_get_server_version()); - rputs(" <BR>\n", r); - rprintf(r, " Server built: \"%s\"\n", apapi_get_server_built()); - rputs(" </P>\n", r);; - rputs(" <P>\n", r); - rputs(" The format for the callback trace is:\n", r); - rputs(" </P>\n", r); - rputs(" <DL>\n", r); - rputs(" <DT><EM>n</EM>.<SAMP><routine-name>", r); - rputs("(<routine-data>)</SAMP>\n", r); - rputs(" </DT>\n", r); - rputs(" <DD><SAMP>[<applies-to>]</SAMP>\n", r); - rputs(" </DD>\n", r); - rputs(" </DL>\n", r); - rputs(" <P>\n", r); - rputs(" The <SAMP><routine-data></SAMP> is supplied by\n", r); - rputs(" the routine when it requests the trace,\n", r); - rputs(" and the <SAMP><applies-to></SAMP> is extracted\n", r); - rputs(" from the configuration record at the time of the trace.\n", r); - rputs(" <STRONG>SVR()</STRONG> indicates a server environment\n", r); - rputs(" (blank means the main or default server, otherwise it's\n", r); - rputs(" the name of the VirtualHost); <STRONG>DIR()</STRONG>\n", r); - rputs(" indicates a location in the URL or filesystem\n", r); - rputs(" namespace.\n", r); - rputs(" </P>\n", r); - rprintf(r, " <H2>Static callbacks so far:</H2>\n <OL>\n%s </OL>\n", + ap_rputs("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\">\n", r); + ap_rputs("<HTML>\n", r); + ap_rputs(" <HEAD>\n", r); + ap_rputs(" <TITLE>mod_example Module Content-Handler Output\n", r); + ap_rputs(" </TITLE>\n", r); + ap_rputs(" </HEAD>\n", r); + ap_rputs(" <BODY>\n", r); + ap_rputs(" <H1><SAMP>mod_example</SAMP> Module Content-Handler Output\n", r); + ap_rputs(" </H1>\n", r); + ap_rputs(" <P>\n", r); + ap_rprintf(r, " Apache HTTP Server version: \"%s\"\n", + ap_get_server_version()); + ap_rputs(" <BR>\n", r); + ap_rprintf(r, " Server built: \"%s\"\n", ap_get_server_built()); + ap_rputs(" </P>\n", r);; + ap_rputs(" <P>\n", r); + ap_rputs(" The format for the callback trace is:\n", r); + ap_rputs(" </P>\n", r); + ap_rputs(" <DL>\n", r); + ap_rputs(" <DT><EM>n</EM>.<SAMP><routine-name>", r); + ap_rputs("(<routine-data>)</SAMP>\n", r); + ap_rputs(" </DT>\n", r); + ap_rputs(" <DD><SAMP>[<applies-to>]</SAMP>\n", r); + ap_rputs(" </DD>\n", r); + ap_rputs(" </DL>\n", r); + ap_rputs(" <P>\n", r); + ap_rputs(" The <SAMP><routine-data></SAMP> is supplied by\n", r); + ap_rputs(" the routine when it requests the trace,\n", r); + ap_rputs(" and the <SAMP><applies-to></SAMP> is extracted\n", r); + ap_rputs(" from the configuration record at the time of the trace.\n", r); + ap_rputs(" <STRONG>SVR()</STRONG> indicates a server environment\n", r); + ap_rputs(" (blank means the main or default server, otherwise it's\n", r); + ap_rputs(" the name of the VirtualHost); <STRONG>DIR()</STRONG>\n", r); + ap_rputs(" indicates a location in the URL or filesystem\n", r); + ap_rputs(" namespace.\n", r); + ap_rputs(" </P>\n", r); + ap_rprintf(r, " <H2>Static callbacks so far:</H2>\n <OL>\n%s </OL>\n", trace); - rputs(" <H2>Request-specific callbacks so far:</H2>\n", r); - rprintf(r, " <OL>\n%s </OL>\n", table_get(r->notes, TRACE_NOTE)); - rputs(" <H2>Environment for <EM>this</EM> call:</H2>\n", r); - rputs(" <UL>\n", r); - rprintf(r, " <LI>Applies-to: <SAMP>%s</SAMP>\n </LI>\n", dcfg->loc); - rprintf(r, " <LI>\"Example\" directive declared here: %s\n </LI>\n", + ap_rputs(" <H2>Request-specific callbacks so far:</H2>\n", r); + ap_rprintf(r, " <OL>\n%s </OL>\n", ap_table_get(r->notes, TRACE_NOTE)); + ap_rputs(" <H2>Environment for <EM>this</EM> call:</H2>\n", r); + ap_rputs(" <UL>\n", r); + ap_rprintf(r, " <LI>Applies-to: <SAMP>%s</SAMP>\n </LI>\n", dcfg->loc); + ap_rprintf(r, " <LI>\"Example\" directive declared here: %s\n </LI>\n", (dcfg->local ? "YES" : "NO")); - rprintf(r, " <LI>\"Example\" inherited: %s\n </LI>\n", + ap_rprintf(r, " <LI>\"Example\" inherited: %s\n </LI>\n", (dcfg->congenital ? "YES" : "NO")); - rputs(" </UL>\n", r); - rputs(" </BODY>\n", r); - rputs("</HTML>\n", r); + ap_rputs(" </UL>\n", r); + ap_rputs(" </BODY>\n", r); + ap_rputs("</HTML>\n", r); /* * We're all done, so cancel the timeout we set. Since this is probably * the end of the request we *could* assume this would be done during * post-processing - but it's possible that another handler might be * called and inherit our outstanding timer. Not good; to each its own. */ - kill_timeout(r); + ap_kill_timeout(r); /* * We did what we wanted to do, so tell the rest of the server we * succeeded. @@ -637,7 +637,7 @@ * we're being called. */ sname = (sname != NULL) ? sname : ""; - note = pstrcat(p, "example_init(", sname, ")", NULL); + note = ap_pstrcat(p, "example_init(", sname, ")", NULL); trace_add(s, NULL, NULL, note); } @@ -668,7 +668,7 @@ * we're being called. */ sname = (sname != NULL) ? sname : ""; - note = pstrcat(p, "example_child_init(", sname, ")", NULL); + note = ap_pstrcat(p, "example_child_init(", sname, ")", NULL); trace_add(s, NULL, NULL, note); } @@ -695,7 +695,7 @@ * we're being called. */ sname = (sname != NULL) ? sname : ""; - note = pstrcat(p, "example_child_exit(", sname, ")", NULL); + note = ap_pstrcat(p, "example_child_exit(", sname, ")", NULL); trace_add(s, NULL, NULL, note); } @@ -720,7 +720,7 @@ /* * Allocate the space for our record from the pool supplied. */ - cfg = (excfg *) pcalloc(p, sizeof(excfg)); + cfg = (excfg *) ap_pcalloc(p, sizeof(excfg)); /* * Now fill in the defaults. If there are any `parent' configuration * records, they'll get merged as part of a separate callback. @@ -732,7 +732,7 @@ * Finally, add our trace to the callback list. */ dname = (dname != NULL) ? dname : ""; - cfg->loc = pstrcat(p, "DIR(", dname, ")", NULL); + cfg->loc = ap_pstrcat(p, "DIR(", dname, ")", NULL); trace_add(NULL, NULL, cfg, "example_create_dir_config()"); return (void *) cfg; } @@ -756,7 +756,7 @@ void *newloc_conf) { - excfg *merged_config = (excfg *) pcalloc(p, sizeof(excfg)); + excfg *merged_config = (excfg *) ap_pcalloc(p, sizeof(excfg)); excfg *pconf = (excfg *) parent_conf; excfg *nconf = (excfg *) newloc_conf; char *note; @@ -766,7 +766,7 @@ * than getting merged. */ merged_config->local = nconf->local; - merged_config->loc = pstrdup(p, nconf->loc); + merged_config->loc = ap_pstrdup(p, nconf->loc); /* * Others, like the setting of the `congenital' flag, get ORed in. The * setting of that particular flag, for instance, is TRUE if it was ever @@ -784,7 +784,7 @@ * Now just record our being called in the trace list. Include the * locations we were asked to merge. */ - note = pstrcat(p, "example_merge_dir_config(\"", pconf->loc, "\",\"", + note = ap_pstrcat(p, "example_merge_dir_config(\"", pconf->loc, "\",\"", nconf->loc, "\")", NULL); trace_add(NULL, NULL, merged_config, note); return (void *) merged_config; @@ -807,7 +807,7 @@ * As with the example_create_dir_config() reoutine, we allocate and fill * in an empty record. */ - cfg = (excfg *) pcalloc(p, sizeof(excfg)); + cfg = (excfg *) ap_pcalloc(p, sizeof(excfg)); cfg->local = 0; cfg->congenital = 0; cfg->cmode = CONFIG_MODE_SERVER; @@ -815,7 +815,7 @@ * Note that we were called in the trace list. */ sname = (sname != NULL) ? sname : ""; - cfg->loc = pstrcat(p, "SVR(", sname, ")", NULL); + cfg->loc = ap_pstrcat(p, "SVR(", sname, ")", NULL); trace_add(s, NULL, cfg, "example_create_server_config()"); return (void *) cfg; } @@ -837,7 +837,7 @@ void *server2_conf) { - excfg *merged_config = (excfg *) pcalloc(p, sizeof(excfg)); + excfg *merged_config = (excfg *) ap_pcalloc(p, sizeof(excfg)); excfg *s1conf = (excfg *) server1_conf; excfg *s2conf = (excfg *) server2_conf; char *note; @@ -850,11 +850,11 @@ (s1conf->cmode == s2conf->cmode) ? s1conf->cmode : CONFIG_MODE_COMBO; merged_config->local = s2conf->local; merged_config->congenital = (s1conf->congenital | s1conf->local); - merged_config->loc = pstrdup(p, s2conf->loc); + merged_config->loc = ap_pstrdup(p, s2conf->loc); /* * Trace our call, including what we were asked to merge. */ - note = pstrcat(p, "example_merge_server_config(\"", s1conf->loc, "\",\"", + note = ap_pstrcat(p, "example_merge_server_config(\"", s1conf->loc, "\",\"", s2conf->loc, "\")", NULL); trace_add(NULL, NULL, merged_config, note); return (void *) merged_config; 1.7 +30 -30 apache-1.3/src/modules/experimental/mod_mmap_static.c Index: mod_mmap_static.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/experimental/mod_mmap_static.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- mod_mmap_static.c 1998/04/04 12:48:08 1.6 +++ mod_mmap_static.c 1998/04/11 12:00:38 1.7 @@ -138,9 +138,9 @@ static void *create_server_config(pool *p, server_rec *s) { - a_server_config *sconf = palloc(p, sizeof(*sconf)); + a_server_config *sconf = ap_palloc(p, sizeof(*sconf)); - sconf->files = make_array(p, 20, sizeof(a_file)); + sconf->files = ap_make_array(p, 20, sizeof(a_file)); sconf->inode_sorted = NULL; return sconf; } @@ -169,19 +169,19 @@ caddr_t mm; if (stat(filename, &tmp.finfo) == -1) { - aplog_error(APLOG_MARK, APLOG_WARNING, cmd->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, cmd->server, "mmap_static: unable to stat(%s), skipping", filename); return NULL; } if ((tmp.finfo.st_mode & S_IFMT) != S_IFREG) { - aplog_error(APLOG_MARK, APLOG_WARNING, cmd->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, cmd->server, "mmap_static: %s isn't a regular file, skipping", filename); return NULL; } - block_alarms(); + ap_block_alarms(); fd = open(filename, O_RDONLY, 0); if (fd == -1) { - aplog_error(APLOG_MARK, APLOG_WARNING, cmd->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, cmd->server, "mmap_static: unable to open(%s, O_RDONLY), skipping", filename); return NULL; } @@ -189,23 +189,23 @@ if (mm == (caddr_t)-1) { int save_errno = errno; close(fd); - unblock_alarms(); + ap_unblock_alarms(); errno = save_errno; - aplog_error(APLOG_MARK, APLOG_WARNING, cmd->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, cmd->server, "mmap_static: unable to mmap %s, skipping", filename); return NULL; } close(fd); tmp.mm = mm; - tmp.filename = pstrdup(cmd->pool, filename); - sconf = get_module_config(cmd->server->module_config, &mmap_static_module); - new_file = push_array(sconf->files); + tmp.filename = ap_pstrdup(cmd->pool, filename); + sconf = ap_get_module_config(cmd->server->module_config, &mmap_static_module); + new_file = ap_push_array(sconf->files); *new_file = tmp; if (sconf->files->nelts == 1) { /* first one, register the cleanup */ - register_cleanup(cmd->pool, sconf, cleanup_mmap, null_cleanup); + ap_register_cleanup(cmd->pool, sconf, cleanup_mmap, ap_null_cleanup); } - unblock_alarms(); + ap_unblock_alarms(); return NULL; } @@ -250,22 +250,22 @@ int i; /* sort the elements of the main_server, by filename */ - sconf = get_module_config(s->module_config, &mmap_static_module); + sconf = ap_get_module_config(s->module_config, &mmap_static_module); elts = (a_file *)sconf->files->elts; nelts = sconf->files->nelts; qsort(elts, nelts, sizeof(a_file), file_compare); /* build an index by inode as well, speeds up the search in the handler */ - inodes = make_array(p, nelts, sizeof(a_file *)); + inodes = ap_make_array(p, nelts, sizeof(a_file *)); sconf->inode_sorted = inodes; for (i = 0; i < nelts; ++i) { - *(a_file **)push_array(inodes) = &elts[i]; + *(a_file **)ap_push_array(inodes) = &elts[i]; } qsort(inodes->elts, nelts, sizeof(a_file *), inode_compare); /* and make the virtualhosts share the same thing */ for (s = s->next; s; s = s->next) { - set_module_config(s->module_config, &mmap_static_module, sconf); + ap_set_module_config(s->module_config, &mmap_static_module, sconf); } } @@ -285,7 +285,7 @@ if (res == DECLINED || !r->filename) { return res; } - sconf = get_module_config(r->server->module_config, &mmap_static_module); + sconf = ap_get_module_config(r->server->module_config, &mmap_static_module); tmp.filename = r->filename; match = (a_file *)bsearch(&tmp, sconf->files->elts, sconf->files->nelts, sizeof(a_file), file_compare); @@ -314,7 +314,7 @@ /* file doesn't exist, we won't be dealing with it */ if (r->finfo.st_mode == 0) return DECLINED; - sconf = get_module_config(r->server->module_config, &mmap_static_module); + sconf = ap_get_module_config(r->server->module_config, &mmap_static_module); tmp.finfo.st_dev = r->finfo.st_dev; tmp.finfo.st_ino = r->finfo.st_ino; ptmp = &tmp; @@ -331,28 +331,28 @@ /* This handler has no use for a request body (yet), but we still * need to read and discard it if the client sent one. */ - if ((errstatus = discard_request_body(r)) != OK) + if ((errstatus = ap_discard_request_body(r)) != OK) return errstatus; - update_mtime(r, match->finfo.st_mtime); - set_last_modified(r); - set_etag(r); - if (((errstatus = meets_conditions(r)) != OK) - || (errstatus = set_content_length (r, match->finfo.st_size))) { + ap_update_mtime(r, match->finfo.st_mtime); + ap_set_last_modified(r); + ap_set_etag(r); + if (((errstatus = ap_meets_conditions(r)) != OK) + || (errstatus = ap_set_content_length (r, match->finfo.st_size))) { return errstatus; } - rangestatus = set_byterange(r); - send_http_header(r); + rangestatus = ap_set_byterange(r); + ap_send_http_header(r); if (!r->header_only) { if (!rangestatus) { - send_mmap (match->mm, r, 0, match->finfo.st_size); + ap_send_mmap (match->mm, r, 0, match->finfo.st_size); } else { long offset, length; - while (each_byterange(r, &offset, &length)) { - send_mmap(match->mm, r, offset, length); + while (ap_each_byterange(r, &offset, &length)) { + ap_send_mmap(match->mm, r, offset, length); } } } 1.51 +65 -65 apache-1.3/src/modules/proxy/mod_proxy.c Index: mod_proxy.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/mod_proxy.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- mod_proxy.c 1998/04/01 14:41:43 1.50 +++ mod_proxy.c 1998/04/11 12:00:39 1.51 @@ -141,17 +141,17 @@ void *sconf = r->server->module_config; proxy_server_conf *conf; - conf = (proxy_server_conf *) get_module_config(sconf, &proxy_module); + conf = (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); if (conf->req && r->parsed_uri.scheme) { /* but it might be something vhosted */ if (!(r->parsed_uri.hostname && !strcasecmp(r->parsed_uri.scheme, http_method(r)) - && matches_request_vhost(r, r->parsed_uri.hostname, + && ap_matches_request_vhost(r, r->parsed_uri.hostname, r->parsed_uri.port_str ? r->parsed_uri.port : default_port(r)))) { r->proxyreq = 1; r->uri = r->unparsed_uri; - r->filename = pstrcat(r->pool, "proxy:", r->uri, NULL); + r->filename = ap_pstrcat(r->pool, "proxy:", r->uri, NULL); r->handler = "proxy-server"; } } @@ -161,7 +161,7 @@ && r->parsed_uri.port_str) { r->proxyreq = 1; r->uri = r->unparsed_uri; - r->filename = pstrcat(r->pool, "proxy:", r->uri, NULL); + r->filename = ap_pstrcat(r->pool, "proxy:", r->uri, NULL); r->handler = "proxy-server"; } return DECLINED; @@ -171,7 +171,7 @@ { void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); int i, len; struct proxy_alias *ent = (struct proxy_alias *) conf->aliases->elts; @@ -191,7 +191,7 @@ len = alias_match(r->uri, ent[i].fake); if (len > 0) { - r->filename = pstrcat(r->pool, "proxy:", ent[i].real, + r->filename = ap_pstrcat(r->pool, "proxy:", ent[i].real, r->uri + len, NULL); r->handler = "proxy-server"; r->proxyreq = 1; @@ -218,9 +218,9 @@ /* canonicalise each specific scheme */ if (strncasecmp(url, "http:", 5) == 0) - return proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT); + return ap_proxy_http_canon(r, url + 5, "http", DEFAULT_HTTP_PORT); else if (strncasecmp(url, "ftp:", 4) == 0) - return proxy_ftp_canon(r, url + 4); + return ap_proxy_ftp_canon(r, url + 4); p = strchr(url, ':'); if (p == NULL || p == url) @@ -231,7 +231,7 @@ static void proxy_init(server_rec *r, pool *p) { - proxy_garbage_init(r, p); + ap_proxy_garbage_init(r, p); } @@ -255,20 +255,20 @@ || strcasecmp(r->parsed_uri.hostname, "localhost") == 0) return DECLINED; /* host name has a dot already */ - ref = table_get(r->headers_in, "Referer"); + ref = ap_table_get(r->headers_in, "Referer"); /* Reassemble the request, but insert the domain after the host name */ /* Note that the domain name always starts with a dot */ - r->parsed_uri.hostname = pstrcat(r->pool, r->parsed_uri.hostname, + r->parsed_uri.hostname = ap_pstrcat(r->pool, r->parsed_uri.hostname, domain, NULL); - nuri = unparse_uri_components(r->pool, + nuri = ap_unparse_uri_components(r->pool, &r->parsed_uri, UNP_REVEALPASSWORD); - table_set(r->headers_out, "Location", nuri); - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, + ap_table_set(r->headers_out, "Location", nuri); + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, "Domain missing: %s sent to %s%s%s", r->uri, - unparse_uri_components(r->pool, &r->parsed_uri, + ap_unparse_uri_components(r->pool, &r->parsed_uri, UNP_OMITUSERINFO), ref ? " from " : "", ref ? ref : ""); @@ -283,7 +283,7 @@ char *url, *scheme, *p; void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); array_header *proxies = conf->proxies; struct proxy_remote *ents = (struct proxy_remote *) proxies->elts; int i, rc; @@ -293,7 +293,7 @@ if (!r->proxyreq || strncmp(r->filename, "proxy:", 6) != 0) return DECLINED; - if ((rc = setup_client_block(r, REQUEST_CHUNKED_ERROR))) + if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) return rc; url = r->filename + 6; @@ -301,7 +301,7 @@ if (p == NULL) return HTTP_BAD_REQUEST; - rc = proxy_cache_check(r, url, &conf->cache, &cr); + rc = ap_proxy_cache_check(r, url, &conf->cache, &cr); if (rc != DECLINED) return rc; @@ -313,7 +313,7 @@ } *p = '\0'; - scheme = pstrdup(r->pool, url); + scheme = ap_pstrdup(r->pool, url); *p = ':'; /* Check URI's destination host against NoProxy hosts */ @@ -331,7 +331,7 @@ { char msg[256]; sprintf(msg, (direct_connect) ? "NoProxy for %s" : "UseProxy for %s", r->uri); - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, msg); + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, msg); } #endif } @@ -349,11 +349,11 @@ * proxy code. */ if (r->method_number == M_CONNECT) - rc = proxy_connect_handler(r, cr, url, ents[i].hostname, + rc = ap_proxy_connect_handler(r, cr, url, ents[i].hostname, ents[i].port); /* we only know how to handle communication to a proxy via http */ else if (strcasecmp(ents[i].protocol, "http") == 0) - rc = proxy_http_handler(r, cr, url, ents[i].hostname, + rc = ap_proxy_http_handler(r, cr, url, ents[i].hostname, ents[i].port); else rc = DECLINED; @@ -371,11 +371,11 @@ */ /* handle the scheme */ if (r->method_number == M_CONNECT) - return proxy_connect_handler(r, cr, url, NULL, 0); + return ap_proxy_connect_handler(r, cr, url, NULL, 0); if (strcasecmp(scheme, "http") == 0) - return proxy_http_handler(r, cr, url, NULL, 0); + return ap_proxy_http_handler(r, cr, url, NULL, 0); if (strcasecmp(scheme, "ftp") == 0) - return proxy_ftp_handler(r, cr, url); + return ap_proxy_ftp_handler(r, cr, url); else return NOT_IMPLEMENTED; } @@ -386,14 +386,14 @@ static void * create_proxy_config(pool *p, server_rec *s) { - proxy_server_conf *ps = pcalloc(p, sizeof(proxy_server_conf)); + proxy_server_conf *ps = ap_pcalloc(p, sizeof(proxy_server_conf)); - ps->proxies = make_array(p, 10, sizeof(struct proxy_remote)); - ps->aliases = make_array(p, 10, sizeof(struct proxy_alias)); - ps->raliases = make_array(p, 10, sizeof(struct proxy_alias)); - ps->noproxies = make_array(p, 10, sizeof(struct noproxy_entry)); - ps->dirconn = make_array(p, 10, sizeof(struct dirconn_entry)); - ps->nocaches = make_array(p, 10, sizeof(struct nocache_entry)); + ps->proxies = ap_make_array(p, 10, sizeof(struct proxy_remote)); + ps->aliases = ap_make_array(p, 10, sizeof(struct proxy_alias)); + ps->raliases = ap_make_array(p, 10, sizeof(struct proxy_alias)); + ps->noproxies = ap_make_array(p, 10, sizeof(struct noproxy_entry)); + ps->dirconn = ap_make_array(p, 10, sizeof(struct dirconn_entry)); + ps->nocaches = ap_make_array(p, 10, sizeof(struct nocache_entry)); ps->domain = NULL; ps->req = 0; @@ -415,7 +415,7 @@ { server_rec *s = cmd->server; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(s->module_config, &proxy_module); + (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module); struct proxy_remote *new; char *p, *q; int port; @@ -433,8 +433,8 @@ port = -1; *p = '\0'; if (strchr(f, ':') == NULL) - str_tolower(f); /* lowercase scheme */ - str_tolower(p + 3); /* lowercase hostname */ + ap_str_tolower(f); /* lowercase scheme */ + ap_str_tolower(p + 3); /* lowercase hostname */ if (port == -1) { int i; @@ -444,7 +444,7 @@ port = defports[i].port; } - new = push_array(conf->proxies); + new = ap_push_array(conf->proxies); new->scheme = f; new->protocol = r; new->hostname = p + 3; @@ -457,10 +457,10 @@ { server_rec *s = cmd->server; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(s->module_config, &proxy_module); + (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module); struct proxy_alias *new; - new = push_array(conf->aliases); + new = ap_push_array(conf->aliases); new->fake = f; new->real = r; return NULL; @@ -473,9 +473,9 @@ proxy_server_conf *conf; struct proxy_alias *new; - conf = (proxy_server_conf *)get_module_config(s->module_config, + conf = (proxy_server_conf *)ap_get_module_config(s->module_config, &proxy_module); - new = push_array(conf->raliases); + new = ap_push_array(conf->raliases); new->fake = f; new->real = r; return NULL; @@ -486,7 +486,7 @@ { server_rec *s = parms->server; proxy_server_conf *conf = - get_module_config(s->module_config, &proxy_module); + ap_get_module_config(s->module_config, &proxy_module); struct noproxy_entry *new; struct noproxy_entry *list = (struct noproxy_entry *) conf->noproxies->elts; struct hostent hp; @@ -500,10 +500,10 @@ } if (!found) { - new = push_array(conf->noproxies); + new = ap_push_array(conf->noproxies); new->name = arg; /* Don't do name lookups on things that aren't dotted */ - if (strchr(arg, '.') != NULL && proxy_host2addr(new->name, &hp) == NULL) + if (strchr(arg, '.') != NULL && ap_proxy_host2addr(new->name, &hp) == NULL) memcpy(&new->addr, hp.h_addr, sizeof(struct in_addr)); else new->addr.s_addr = 0; @@ -519,7 +519,7 @@ { server_rec *s = parms->server; proxy_server_conf *conf = - get_module_config(s->module_config, &proxy_module); + ap_get_module_config(s->module_config, &proxy_module); struct dirconn_entry *New; struct dirconn_entry *list = (struct dirconn_entry *) conf->dirconn->elts; int found = 0; @@ -532,30 +532,30 @@ } if (!found) { - New = push_array(conf->dirconn); + New = ap_push_array(conf->dirconn); New->name = arg; New->hostentry = NULL; - if (proxy_is_ipaddr(New, parms->pool)) { + if (ap_proxy_is_ipaddr(New, parms->pool)) { #if DEBUGGING fprintf(stderr, "Parsed addr %s\n", inet_ntoa(New->addr)); fprintf(stderr, "Parsed mask %s\n", inet_ntoa(New->mask)); #endif } - else if (proxy_is_domainname(New, parms->pool)) { - str_tolower(New->name); + else if (ap_proxy_is_domainname(New, parms->pool)) { + ap_str_tolower(New->name); #if DEBUGGING fprintf(stderr, "Parsed domain %s\n", New->name); #endif } - else if (proxy_is_hostname(New, parms->pool)) { - str_tolower(New->name); + else if (ap_proxy_is_hostname(New, parms->pool)) { + ap_str_tolower(New->name); #if DEBUGGING fprintf(stderr, "Parsed host %s\n", New->name); #endif } else { - proxy_is_word(New, parms->pool); + ap_proxy_is_word(New, parms->pool); #if DEBUGGING fprintf(stderr, "Parsed word %s\n", New->name); #endif @@ -568,7 +568,7 @@ set_proxy_domain(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); if (arg[0] != '.') return "Domain name must start with a dot."; @@ -581,7 +581,7 @@ set_proxy_req(cmd_parms *parms, void *dummy, int flag) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); psf->req = flag; return NULL; @@ -592,7 +592,7 @@ set_cache_size(cmd_parms *parms, char *struct_ptr, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); int val; if (sscanf(arg, "%d", &val) != 1) @@ -605,7 +605,7 @@ set_cache_root(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); psf->cache.root = arg; @@ -616,7 +616,7 @@ set_cache_factor(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); double val; if (sscanf(arg, "%lg", &val) != 1) @@ -630,7 +630,7 @@ set_cache_maxex(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); double val; if (sscanf(arg, "%lg", &val) != 1) @@ -643,7 +643,7 @@ set_cache_defex(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); double val; if (sscanf(arg, "%lg", &val) != 1) @@ -656,7 +656,7 @@ set_cache_gcint(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); double val; if (sscanf(arg, "%lg", &val) != 1) @@ -669,7 +669,7 @@ set_cache_dirlevels(cmd_parms *parms, char *struct_ptr, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); int val; val = atoi(arg); @@ -685,7 +685,7 @@ set_cache_dirlength(cmd_parms *parms, char *struct_ptr, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); int val; val = atoi(arg); @@ -702,7 +702,7 @@ { server_rec *s = parms->server; proxy_server_conf *conf = - get_module_config(s->module_config, &proxy_module); + ap_get_module_config(s->module_config, &proxy_module); struct nocache_entry *new; struct nocache_entry *list = (struct nocache_entry *) conf->nocaches->elts; struct hostent hp; @@ -716,10 +716,10 @@ } if (!found) { - new = push_array(conf->nocaches); + new = ap_push_array(conf->nocaches); new->name = arg; /* Don't do name lookups on things that aren't dotted */ - if (strchr(arg, '.') != NULL && proxy_host2addr(new->name, &hp) == NULL) + if (strchr(arg, '.') != NULL && ap_proxy_host2addr(new->name, &hp) == NULL) /*@@@FIXME: This copies only the first of (possibly many) IP addrs */ memcpy(&new->addr, hp.h_addr, sizeof(struct in_addr)); else @@ -732,7 +732,7 @@ set_recv_buffer_size(cmd_parms *parms, void *dummy, char *arg) { proxy_server_conf *psf = - get_module_config(parms->server->module_config, &proxy_module); + ap_get_module_config(parms->server->module_config, &proxy_module); int s = atoi(arg); if (s < 512 && s != 0) { return "ProxyReceiveBufferSize must be >= 512 bytes, or 0 for system default."; 1.33 +34 -34 apache-1.3/src/modules/proxy/mod_proxy.h Index: mod_proxy.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/mod_proxy.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- mod_proxy.h 1998/03/31 12:53:00 1.32 +++ mod_proxy.h 1998/04/11 12:00:39 1.33 @@ -240,59 +240,59 @@ /* proxy_cache.c */ -void proxy_cache_tidy(struct cache_req *c); -int proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, +void ap_proxy_cache_tidy(struct cache_req *c); +int ap_proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, struct cache_req **cr); -int proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, +int ap_proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, const int is_HTTP1, int nocache); -void proxy_garbage_coll(request_rec *r); +void ap_proxy_garbage_coll(request_rec *r); /* proxy_connect.c */ -int proxy_connect_handler(request_rec *r, struct cache_req *c, char *url, +int ap_proxy_connect_handler(request_rec *r, struct cache_req *c, char *url, const char *proxyhost, int proxyport); /* proxy_ftp.c */ -int proxy_ftp_canon(request_rec *r, char *url); -int proxy_ftp_handler(request_rec *r, struct cache_req *c, char *url); +int ap_proxy_ftp_canon(request_rec *r, char *url); +int ap_proxy_ftp_handler(request_rec *r, struct cache_req *c, char *url); /* proxy_http.c */ -int proxy_http_canon(request_rec *r, char *url, const char *scheme, +int ap_proxy_http_canon(request_rec *r, char *url, const char *scheme, int def_port); -int proxy_http_handler(request_rec *r, struct cache_req *c, char *url, +int ap_proxy_http_handler(request_rec *r, struct cache_req *c, char *url, const char *proxyhost, int proxyport); /* proxy_util.c */ -int proxy_hex2c(const char *x); -void proxy_c2hex(int ch, char *x); -char *proxy_canonenc(pool *p, const char *x, int len, enum enctype t, +int ap_proxy_hex2c(const char *x); +void ap_proxy_c2hex(int ch, char *x); +char *ap_proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc); -char *proxy_canon_netloc(pool *p, char **const urlp, char **userp, +char *ap_proxy_canon_netloc(pool *p, char **const urlp, char **userp, char **passwordp, char **hostp, int *port); -char *proxy_date_canon(pool *p, char *x); -array_header *proxy_read_headers(pool *p, char *buffer, int size, BUFF *f); -long int proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c); -struct hdr_entry *proxy_get_header(array_header *hdrs_arr, const char *name); -struct hdr_entry *proxy_add_header(array_header *hdrs_arr, char *field, +char *ap_proxy_date_canon(pool *p, char *x); +array_header *ap_proxy_read_headers(pool *p, char *buffer, int size, BUFF *f); +long int ap_proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c); +struct hdr_entry *ap_proxy_get_header(array_header *hdrs_arr, const char *name); +struct hdr_entry *ap_proxy_add_header(array_header *hdrs_arr, char *field, char *value, int rep); -void proxy_del_header(array_header *hdrs_arr, const char *field); -void proxy_send_headers(request_rec *r, const char *respline, +void ap_proxy_del_header(array_header *hdrs_arr, const char *field); +void ap_proxy_send_headers(request_rec *r, const char *respline, array_header *hdrs_arr); -int proxy_liststr(const char *list, const char *val); -void proxy_hash(const char *it, char *val, int ndepth, int nlength); -int proxy_hex2sec(const char *x); -void proxy_sec2hex(int t, char *y); -void proxy_log_uerror(const char *routine, const char *file, const char *err, +int ap_proxy_liststr(const char *list, const char *val); +void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength); +int ap_proxy_hex2sec(const char *x); +void ap_proxy_sec2hex(int t, char *y); +void ap_proxy_log_uerror(const char *routine, const char *file, const char *err, server_rec *s); -BUFF *proxy_cache_error(struct cache_req *r); -int proxyerror(request_rec *r, const char *message); -const char *proxy_host2addr(const char *host, struct hostent *reqhp); -int proxy_is_ipaddr(struct dirconn_entry *This, pool *p); -int proxy_is_domainname(struct dirconn_entry *This, pool *p); -int proxy_is_hostname(struct dirconn_entry *This, pool *p); -int proxy_is_word(struct dirconn_entry *This, pool *p); -int proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r); -int proxy_garbage_init(server_rec *, pool *); +BUFF *ap_proxy_cache_error(struct cache_req *r); +int ap_proxyerror(request_rec *r, const char *message); +const char *ap_proxy_host2addr(const char *host, struct hostent *reqhp); +int ap_proxy_is_ipaddr(struct dirconn_entry *This, pool *p); +int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p); +int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p); +int ap_proxy_is_word(struct dirconn_entry *This, pool *p); +int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r); +int ap_proxy_garbage_init(server_rec *, pool *); 1.36 +137 -137 apache-1.3/src/modules/proxy/proxy_cache.c Index: proxy_cache.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_cache.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- proxy_cache.c 1998/03/31 12:53:01 1.35 +++ proxy_cache.c 1998/04/11 12:00:39 1.36 @@ -100,10 +100,10 @@ static mutex *garbage_mutex = NULL; -int proxy_garbage_init(server_rec *r, pool *p) +int ap_proxy_garbage_init(server_rec *r, pool *p) { if (!garbage_mutex) - garbage_mutex = create_mutex(NULL); + garbage_mutex = ap_create_mutex(NULL); return (0); } @@ -113,24 +113,24 @@ const char *cachedir, const char *cachesubdir); static void help_proxy_garbage_coll(request_rec *r); -void proxy_garbage_coll(request_rec *r) +void ap_proxy_garbage_coll(request_rec *r) { static int inside = 0; - (void) acquire_mutex(garbage_mutex); + (void) ap_acquire_mutex(garbage_mutex); if (inside == 1) { - (void) release_mutex(garbage_mutex); + (void) ap_release_mutex(garbage_mutex); return; } else inside = 1; - (void) release_mutex(garbage_mutex); + (void) ap_release_mutex(garbage_mutex); help_proxy_garbage_coll(r); - (void) acquire_mutex(garbage_mutex); + (void) ap_acquire_mutex(garbage_mutex); inside = 0; - (void) release_mutex(garbage_mutex); + (void) ap_release_mutex(garbage_mutex); } @@ -139,7 +139,7 @@ const char *cachedir; void *sconf = r->server->module_config; proxy_server_conf *pconf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); const struct cache_conf *conf = &pconf->cache; array_header *files; struct stat buf; @@ -157,23 +157,23 @@ if (garbage_now != -1 && lastcheck != BAD_DATE && garbage_now < lastcheck + every) return; - block_alarms(); /* avoid SIGALRM on big cache cleanup */ + ap_block_alarms(); /* avoid SIGALRM on big cache cleanup */ - filename = palloc(r->pool, strlen(cachedir) + HASH_LEN + 2); + filename = ap_palloc(r->pool, strlen(cachedir) + HASH_LEN + 2); strcpy(filename, cachedir); strcat(filename, "/.time"); if (stat(filename, &buf) == -1) { /* does not exist */ if (errno != ENOENT) { - proxy_log_uerror("stat", filename, NULL, r->server); - unblock_alarms(); + ap_proxy_log_uerror("stat", filename, NULL, r->server); + ap_unblock_alarms(); return; } if ((timefd = creat(filename, 0666)) == -1) { if (errno != EEXIST) - proxy_log_uerror("creat", filename, NULL, r->server); + ap_proxy_log_uerror("creat", filename, NULL, r->server); else lastcheck = abs(garbage_now); /* someone else got in there */ - unblock_alarms(); + ap_unblock_alarms(); return; } close(timefd); @@ -181,20 +181,20 @@ else { lastcheck = buf.st_mtime; /* save the time */ if (garbage_now < lastcheck + every) { - unblock_alarms(); + ap_unblock_alarms(); return; } if (utime(filename, NULL) == -1) - proxy_log_uerror("utimes", filename, NULL, r->server); + ap_proxy_log_uerror("utimes", filename, NULL, r->server); } - files = make_array(r->pool, 100, sizeof(struct gc_ent *)); + files = ap_make_array(r->pool, 100, sizeof(struct gc_ent *)); curblocks = 0; curbytes = 0; sub_garbage_coll(r, files, cachedir, "/"); if (curblocks < cachesize || curblocks + curbytes <= cachesize) { - unblock_alarms(); + ap_unblock_alarms(); return; } @@ -210,7 +210,7 @@ #else if (unlink(filename) == -1) { if (errno != ENOENT) - proxy_log_uerror("unlink", filename, NULL, r->server); + ap_proxy_log_uerror("unlink", filename, NULL, r->server); } else #endif @@ -225,7 +225,7 @@ break; } } - unblock_alarms(); + ap_unblock_alarms(); } static int sub_garbage_coll(request_rec *r, array_header *files, @@ -248,7 +248,7 @@ Explain1("GC Examining directory %s", cachedir); dir = opendir(cachedir); if (dir == NULL) { - proxy_log_uerror("opendir", cachedir, NULL, r->server); + ap_proxy_log_uerror("opendir", cachedir, NULL, r->server); return 0; } @@ -262,7 +262,7 @@ /* then stat it to see how old it is; delete temporary files > 1 day old */ if (stat(filename, &buf) == -1) { if (errno != ENOENT) - proxy_log_uerror("stat", filename, NULL, r->server); + ap_proxy_log_uerror("stat", filename, NULL, r->server); } else if (garbage_now != -1 && buf.st_atime < garbage_now - SEC_ONE_DAY && buf.st_mtime < garbage_now - SEC_ONE_DAY) { @@ -305,12 +305,12 @@ fd = open(filename, O_RDONLY | O_BINARY); if (fd == -1) { if (errno != ENOENT) - proxy_log_uerror("open", filename, NULL, + ap_proxy_log_uerror("open", filename, NULL, r->server); continue; } if (fstat(fd, &buf) == -1) { - proxy_log_uerror("fstat", filename, NULL, r->server); + ap_proxy_log_uerror("fstat", filename, NULL, r->server); close(fd); continue; } @@ -338,19 +338,19 @@ i = read(fd, line, 26); if (i == -1) { - proxy_log_uerror("read", filename, NULL, r->server); + ap_proxy_log_uerror("read", filename, NULL, r->server); close(fd); continue; } close(fd); line[i] = '\0'; - garbage_expire = proxy_hex2sec(line + 18); - if (!checkmask(line, "&&&&&&&& &&&&&&&& &&&&&&&&") || + garbage_expire = ap_proxy_hex2sec(line + 18); + if (!ap_checkmask(line, "&&&&&&&& &&&&&&&& &&&&&&&&") || garbage_expire == BAD_DATE) { /* bad file */ if (garbage_now != -1 && buf.st_atime > garbage_now + SEC_ONE_DAY && buf.st_mtime > garbage_now + SEC_ONE_DAY) { - log_error("proxy: deleting bad cache file", r->server); + ap_log_error_old("proxy: deleting bad cache file", r->server); #if TESTING fprintf(stderr, "Would unlink bad file %s\n", filename); #else @@ -368,12 +368,12 @@ */ /* FIXME: We should make the array an array of gc_ents, not gc_ent *s */ - fent = palloc(r->pool, sizeof(struct gc_ent)); + fent = ap_palloc(r->pool, sizeof(struct gc_ent)); fent->len = buf.st_size; fent->expire = garbage_expire; strcpy(fent->file, cachesubdir); strcat(fent->file, ent->d_name); - *(struct gc_ent **) push_array(files) = fent; + *(struct gc_ent **) ap_push_array(files) = fent; /* accumulate in blocks, to cope with directories > 4Gb */ curblocks += buf.st_size >> 10; /* Kbytes */ @@ -405,25 +405,25 @@ * date SP lastmod SP expire SP count SP content-length CRLF * dates are stored as hex seconds since 1970 */ - len = bgets(urlbuff, 1034, cachefp); + len = ap_bgets(urlbuff, 1034, cachefp); if (len == -1) return -1; if (len == 0 || urlbuff[len - 1] != '\n') return 0; urlbuff[len - 1] = '\0'; - if (!checkmask(urlbuff, + if (!ap_checkmask(urlbuff, "&&&&&&&& &&&&&&&& &&&&&&&& &&&&&&&& &&&&&&&&")) return 0; - c->date = proxy_hex2sec(urlbuff); - c->lmod = proxy_hex2sec(urlbuff + 9); - c->expire = proxy_hex2sec(urlbuff + 18); - c->version = proxy_hex2sec(urlbuff + 27); - c->len = proxy_hex2sec(urlbuff + 36); + c->date = ap_proxy_hex2sec(urlbuff); + c->lmod = ap_proxy_hex2sec(urlbuff + 9); + c->expire = ap_proxy_hex2sec(urlbuff + 18); + c->version = ap_proxy_hex2sec(urlbuff + 27); + c->len = ap_proxy_hex2sec(urlbuff + 36); /* check that we have the same URL */ - len = bgets(urlbuff, 1034, cachefp); + len = ap_bgets(urlbuff, 1034, cachefp); if (len == -1) return -1; if (len == 0 || strncmp(urlbuff, "X-URL: ", 7) != 0 || @@ -434,29 +434,29 @@ return 0; /* What follows is the message */ - len = bgets(urlbuff, 1034, cachefp); + len = ap_bgets(urlbuff, 1034, cachefp); if (len == -1) return -1; if (len == 0 || urlbuff[len - 1] != '\n') return 0; urlbuff[--len] = '\0'; - c->resp_line = pstrdup(p, urlbuff); + c->resp_line = ap_pstrdup(p, urlbuff); strp = strchr(urlbuff, ' '); if (strp == NULL) return 0; c->status = atoi(strp); - c->hdrs = proxy_read_headers(p, urlbuff, 1034, cachefp); + c->hdrs = ap_proxy_read_headers(p, urlbuff, 1034, cachefp); if (c->hdrs == NULL) return -1; if (c->len != -1) { /* add a content-length header */ struct hdr_entry *q; - q = proxy_get_header(c->hdrs, "Content-Length"); + q = ap_proxy_get_header(c->hdrs, "Content-Length"); if (q == NULL) { - strp = palloc(p, 15); + strp = ap_palloc(p, 15); ap_snprintf(strp, 15, "%u", c->len); - proxy_add_header(c->hdrs, "Content-Length", strp, HDR_REP); + ap_proxy_add_header(c->hdrs, "Content-Length", strp, HDR_REP); } } return 1; @@ -477,7 +477,7 @@ * if last modified after if-modified-since then add * last modified date to request */ -int proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, +int ap_proxy_cache_check(request_rec *r, char *url, struct cache_conf *conf, struct cache_req **cr) { char hashfile[66], *imstr, *pragma, *auth; @@ -488,49 +488,49 @@ const long int zero = 0L; void *sconf = r->server->module_config; proxy_server_conf *pconf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); - c = pcalloc(r->pool, sizeof(struct cache_req)); + c = ap_pcalloc(r->pool, sizeof(struct cache_req)); *cr = c; c->req = r; - c->url = pstrdup(r->pool, url); + c->url = ap_pstrdup(r->pool, url); /* get the If-Modified-Since date of the request */ c->ims = BAD_DATE; - imstr = table_get(r->headers_in, "If-Modified-Since"); + imstr = ap_table_get(r->headers_in, "If-Modified-Since"); if (imstr != NULL) { /* this may modify the value in the original table */ - imstr = proxy_date_canon(r->pool, imstr); - c->ims = parseHTTPdate(imstr); + imstr = ap_proxy_date_canon(r->pool, imstr); + c->ims = ap_parseHTTPdate(imstr); if (c->ims == BAD_DATE) /* bad or out of range date; remove it */ - table_unset(r->headers_in, "If-Modified-Since"); + ap_table_unset(r->headers_in, "If-Modified-Since"); } /* find the filename for this cache entry */ - proxy_hash(url, hashfile, pconf->cache.dirlevels, pconf->cache.dirlength); + ap_proxy_hash(url, hashfile, pconf->cache.dirlevels, pconf->cache.dirlength); if (conf->root != NULL) - c->filename = pstrcat(r->pool, conf->root, "/", hashfile, NULL); + c->filename = ap_pstrcat(r->pool, conf->root, "/", hashfile, NULL); else c->filename = NULL; cachefp = NULL; /* find out about whether the request can access the cache */ - pragma = table_get(r->headers_in, "Pragma"); - auth = table_get(r->headers_in, "Authorization"); + pragma = ap_table_get(r->headers_in, "Pragma"); + auth = ap_table_get(r->headers_in, "Authorization"); Explain5("Request for %s, pragma=%s, auth=%s, ims=%ld, imstr=%s", url, pragma, auth, c->ims, imstr); if (c->filename != NULL && r->method_number == M_GET && - strlen(url) < 1024 && !proxy_liststr(pragma, "no-cache") && + strlen(url) < 1024 && !ap_proxy_liststr(pragma, "no-cache") && auth == NULL) { Explain1("Check file %s", c->filename); cfd = open(c->filename, O_RDWR | O_BINARY); if (cfd != -1) { - note_cleanups_for_fd(r->pool, cfd); - cachefp = bcreate(r->pool, B_RD | B_WR); - bpushfd(cachefp, cfd, cfd); + ap_note_cleanups_for_fd(r->pool, cfd); + cachefp = ap_bcreate(r->pool, B_RD | B_WR); + ap_bpushfd(cachefp, cfd, cfd); } else if (errno != ENOENT) - proxy_log_uerror("open", c->filename, + ap_proxy_log_uerror("open", c->filename, "proxy: error opening cache file", r->server); #ifdef EXPLAIN else @@ -541,17 +541,17 @@ if (cachefp != NULL) { i = rdcache(r->pool, cachefp, c); if (i == -1) - proxy_log_uerror("read", c->filename, + ap_proxy_log_uerror("read", c->filename, "proxy: error reading cache file", r->server); else if (i == 0) - log_error("proxy: bad cache file", r->server); + ap_log_error_old("proxy: bad cache file", r->server); if (i != 1) { - pclosef(r->pool, cachefp->fd); + ap_pclosef(r->pool, cachefp->fd); cachefp = NULL; } } if (cachefp == NULL) - c->hdrs = make_array(r->pool, 2, sizeof(struct hdr_entry)); + c->hdrs = ap_make_array(r->pool, 2, sizeof(struct hdr_entry)); /* FIXME: Shouldn't we check the URL somewhere? */ now = time(NULL); /* Ok, have we got some un-expired data? */ @@ -569,11 +569,11 @@ */ struct hdr_entry *q; - q = proxy_get_header(c->hdrs, "Expires"); + q = ap_proxy_get_header(c->hdrs, "Expires"); if (q != NULL && q->value != NULL) - table_set(r->headers_out, "Expires", q->value); + ap_table_set(r->headers_out, "Expires", q->value); } - pclosef(r->pool, cachefp->fd); + ap_pclosef(r->pool, cachefp->fd); Explain0("Use local copy, cached file hasn't changed"); return USE_LOCAL_COPY; } @@ -583,15 +583,15 @@ r->status_line = strchr(c->resp_line, ' ') + 1; r->status = c->status; if (!r->assbackwards) { - soft_timeout("proxy send headers", r); - proxy_send_headers(r, c->resp_line, c->hdrs); - kill_timeout(r); + ap_soft_timeout("proxy send headers", r); + ap_proxy_send_headers(r, c->resp_line, c->hdrs); + ap_kill_timeout(r); } - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; if (!r->header_only) - proxy_send_fb(cachefp, r, NULL, NULL); - pclosef(r->pool, cachefp->fd); + ap_proxy_send_fb(cachefp, r, NULL, NULL); + ap_pclosef(r->pool, cachefp->fd); return OK; } @@ -607,10 +607,10 @@ if (c->ims == BAD_DATE || c->ims < c->lmod) { struct hdr_entry *q; - q = proxy_get_header(c->hdrs, "Last-Modified"); + q = ap_proxy_get_header(c->hdrs, "Last-Modified"); if (q != NULL && q->value != NULL) - table_set(r->headers_in, "If-Modified-Since", + ap_table_set(r->headers_in, "If-Modified-Since", (char *) q->value); } } @@ -633,7 +633,7 @@ * from the cache, maybe updating the header line * otherwise, delete the old cached file and open a new temporary file */ -int proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, +int ap_proxy_cache_update(struct cache_req *c, array_header *resp_hdrs, const int is_HTTP1, int nocache) { request_rec *r = c->req; @@ -644,7 +644,7 @@ char buff[46]; void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); const long int zero = 0L; c->tempfile = NULL; @@ -653,18 +653,18 @@ /* read expiry date; if a bad date, then leave it so the client can * read it */ - expire = proxy_get_header(resp_hdrs, "Expires"); + expire = ap_proxy_get_header(resp_hdrs, "Expires"); if (expire != NULL) - expc = parseHTTPdate(expire->value); + expc = ap_parseHTTPdate(expire->value); else expc = BAD_DATE; /* * read the last-modified date; if the date is bad, then delete it */ - lmods = proxy_get_header(resp_hdrs, "Last-Modified"); + lmods = ap_proxy_get_header(resp_hdrs, "Last-Modified"); if (lmods != NULL) { - lmod = parseHTTPdate(lmods->value); + lmod = ap_parseHTTPdate(lmods->value); if (lmod == BAD_DATE) { /* kill last modified date */ lmods->value = NULL; @@ -688,12 +688,12 @@ (r->status == 304 && c->fp == NULL) || (r->status == 200 && lmods == NULL && is_HTTP1) || r->header_only || - table_get(r->headers_in, "Authorization") != NULL || + ap_table_get(r->headers_in, "Authorization") != NULL || nocache) { Explain1("Response is not cacheable, unlinking %s", c->filename); /* close the file */ if (c->fp != NULL) { - pclosef(r->pool, c->fp->fd); + ap_pclosef(r->pool, c->fp->fd); c->fp = NULL; } /* delete the previously cached file */ @@ -705,9 +705,9 @@ /* * Read the date. Generate one if one is not supplied */ - dates = proxy_get_header(resp_hdrs, "Date"); + dates = ap_proxy_get_header(resp_hdrs, "Date"); if (dates != NULL) - date = parseHTTPdate(dates->value); + date = ap_parseHTTPdate(dates->value); else date = BAD_DATE; @@ -718,8 +718,8 @@ /* add one; N.B. use the time _now_ rather than when we were checking the cache */ date = abs(now); - p = gm_timestr_822(r->pool, now); - dates = proxy_add_header(resp_hdrs, "Date", p, HDR_REP); + p = ap_gm_timestr_822(r->pool, now); + dates = ap_proxy_add_header(resp_hdrs, "Date", p, HDR_REP); Explain0("Added date header"); } @@ -739,9 +739,9 @@ /* we now need to calculate the expire data for the object. */ if (expire == NULL && c->fp != NULL) { /* no expiry data sent in response */ - expire = proxy_get_header(c->hdrs, "Expires"); + expire = ap_proxy_get_header(c->hdrs, "Expires"); if (expire != NULL) - expc = parseHTTPdate(expire->value); + expc = ap_parseHTTPdate(expire->value); } /* so we now have the expiry date */ /* if no expiry date then @@ -765,21 +765,21 @@ } /* get the content-length header */ - clen = proxy_get_header(c->hdrs, "Content-Length"); + clen = ap_proxy_get_header(c->hdrs, "Content-Length"); if (clen == NULL) c->len = -1; else c->len = atoi(clen->value); - proxy_sec2hex(date, buff); + ap_proxy_sec2hex(date, buff); buff[8] = ' '; - proxy_sec2hex(lmod, buff + 9); + ap_proxy_sec2hex(lmod, buff + 9); buff[17] = ' '; - proxy_sec2hex(expc, buff + 18); + ap_proxy_sec2hex(expc, buff + 18); buff[26] = ' '; - proxy_sec2hex(c->version++, buff + 27); + ap_proxy_sec2hex(c->version++, buff + 27); buff[35] = ' '; - proxy_sec2hex(c->len, buff + 36); + ap_proxy_sec2hex(c->len, buff + 36); buff[44] = '\n'; buff[45] = '\0'; @@ -791,13 +791,13 @@ if (lmod != c->lmod || expc != c->expire || date != c->date) { off_t curpos = lseek(c->fp->fd, 0, SEEK_SET); if (curpos == -1) - proxy_log_uerror("lseek", c->filename, + ap_proxy_log_uerror("lseek", c->filename, "proxy: error seeking on cache file", r->server); else if (write(c->fp->fd, buff, 35) == -1) - proxy_log_uerror("write", c->filename, + ap_proxy_log_uerror("write", c->filename, "proxy: error updating cache file", r->server); } - pclosef(r->pool, c->fp->fd); + ap_pclosef(r->pool, c->fp->fd); Explain0("Remote document not modified, use local copy"); /* CHECKME: Is this right? Shouldn't we check IMS again here? */ return USE_LOCAL_COPY; @@ -808,44 +808,44 @@ r->status_line = strchr(c->resp_line, ' ') + 1; r->status = c->status; if (!r->assbackwards) { - soft_timeout("proxy send headers", r); - proxy_send_headers(r, c->resp_line, c->hdrs); - kill_timeout(r); + ap_soft_timeout("proxy send headers", r); + ap_proxy_send_headers(r, c->resp_line, c->hdrs); + ap_kill_timeout(r); } - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; if (!r->header_only) - proxy_send_fb(c->fp, r, NULL, NULL); + ap_proxy_send_fb(c->fp, r, NULL, NULL); /* set any changed headers somehow */ /* update dates and version, but not content-length */ if (lmod != c->lmod || expc != c->expire || date != c->date) { off_t curpos = lseek(c->fp->fd, 0, SEEK_SET); if (curpos == -1) - proxy_log_uerror("lseek", c->filename, + ap_proxy_log_uerror("lseek", c->filename, "proxy: error seeking on cache file", r->server); else if (write(c->fp->fd, buff, 35) == -1) - proxy_log_uerror("write", c->filename, + ap_proxy_log_uerror("write", c->filename, "proxy: error updating cache file", r->server); } - pclosef(r->pool, c->fp->fd); + ap_pclosef(r->pool, c->fp->fd); return OK; } } /* new or modified file */ if (c->fp != NULL) { - pclosef(r->pool, c->fp->fd); + ap_pclosef(r->pool, c->fp->fd); c->fp->fd = -1; } c->version = 0; - proxy_sec2hex(0, buff + 27); + ap_proxy_sec2hex(0, buff + 27); buff[35] = ' '; /* open temporary file */ #define TMPFILESTR "/tmpXXXXXX" if (conf->cache.root == NULL) return DECLINED; - c->tempfile = palloc(r->pool, strlen(conf->cache.root) + sizeof(TMPFILESTR)); + c->tempfile = ap_palloc(r->pool, strlen(conf->cache.root) + sizeof(TMPFILESTR)); strcpy(c->tempfile, conf->cache.root); strcat(c->tempfile, TMPFILESTR); #undef TMPFILESTR @@ -857,25 +857,25 @@ i = open(c->tempfile, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0622); if (i == -1) { - proxy_log_uerror("open", c->tempfile, + ap_proxy_log_uerror("open", c->tempfile, "proxy: error creating cache file", r->server); return DECLINED; } - note_cleanups_for_fd(r->pool, i); - c->fp = bcreate(r->pool, B_WR); - bpushfd(c->fp, -1, i); + ap_note_cleanups_for_fd(r->pool, i); + c->fp = ap_bcreate(r->pool, B_WR); + ap_bpushfd(c->fp, -1, i); - if (bvputs(c->fp, buff, "X-URL: ", c->url, "\n", NULL) == -1) { - proxy_log_uerror("write", c->tempfile, + if (ap_bvputs(c->fp, buff, "X-URL: ", c->url, "\n", NULL) == -1) { + ap_proxy_log_uerror("write", c->tempfile, "proxy: error writing cache file", r->server); - pclosef(r->pool, c->fp->fd); + ap_pclosef(r->pool, c->fp->fd); unlink(c->tempfile); c->fp = NULL; } return DECLINED; } -void proxy_cache_tidy(struct cache_req *c) +void ap_proxy_cache_tidy(struct cache_req *c) { server_rec *s = c->req->server; long int bc; @@ -883,18 +883,18 @@ if (c->fp == NULL) return; - bgetopt(c->req->connection->client, BO_BYTECT, &bc); + ap_bgetopt(c->req->connection->client, BO_BYTECT, &bc); if (c->len != -1) { /* file lengths don't match; don't cache it */ if (bc != c->len) { - pclosef(c->req->pool, c->fp->fd); /* no need to flush */ + ap_pclosef(c->req->pool, c->fp->fd); /* no need to flush */ unlink(c->tempfile); return; } } else if (c->req->connection->aborted) { - pclosef(c->req->pool, c->fp->fd); /* no need to flush */ + ap_pclosef(c->req->pool, c->fp->fd); /* no need to flush */ unlink(c->tempfile); return; } @@ -904,40 +904,40 @@ off_t curpos; c->len = bc; - bflush(c->fp); - proxy_sec2hex(c->len, buff); + ap_bflush(c->fp); + ap_proxy_sec2hex(c->len, buff); curpos = lseek(c->fp->fd, 36, SEEK_SET); if (curpos == -1) - proxy_log_uerror("lseek", c->tempfile, + ap_proxy_log_uerror("lseek", c->tempfile, "proxy: error seeking on cache file", s); else if (write(c->fp->fd, buff, 8) == -1) - proxy_log_uerror("write", c->tempfile, + ap_proxy_log_uerror("write", c->tempfile, "proxy: error updating cache file", s); } - if (bflush(c->fp) == -1) { - proxy_log_uerror("write", c->tempfile, + if (ap_bflush(c->fp) == -1) { + ap_proxy_log_uerror("write", c->tempfile, "proxy: error writing to cache file", s); - pclosef(c->req->pool, c->fp->fd); + ap_pclosef(c->req->pool, c->fp->fd); unlink(c->tempfile); return; } - if (pclosef(c->req->pool, c->fp->fd) == -1) { - proxy_log_uerror("close", c->tempfile, + if (ap_pclosef(c->req->pool, c->fp->fd) == -1) { + ap_proxy_log_uerror("close", c->tempfile, "proxy: error closing cache file", s); unlink(c->tempfile); return; } if (unlink(c->filename) == -1 && errno != ENOENT) { - proxy_log_uerror("unlink", c->filename, + ap_proxy_log_uerror("unlink", c->filename, "proxy: error deleting old cache file", s); } else { char *p; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(s->module_config, &proxy_module); + (proxy_server_conf *) ap_get_module_config(s->module_config, &proxy_module); for (p = c->filename + strlen(conf->cache.root) + 1;;) { p = strchr(p, '/'); @@ -949,7 +949,7 @@ #else if (mkdir(c->filename, S_IREAD | S_IWRITE | S_IEXEC) < 0 && errno != EEXIST) #endif /* WIN32 */ - proxy_log_uerror("mkdir", c->filename, + ap_proxy_log_uerror("mkdir", c->filename, "proxy: error creating cache directory", s); *p = '/'; ++p; @@ -957,18 +957,18 @@ #if defined(__EMX__) || defined(WIN32) /* Under OS/2 use rename. */ if (rename(c->tempfile, c->filename) == -1) - proxy_log_uerror("rename", c->filename, + ap_proxy_log_uerror("rename", c->filename, "proxy: error renaming cache file", s); } #else if (link(c->tempfile, c->filename) == -1) - proxy_log_uerror("link", c->filename, + ap_proxy_log_uerror("link", c->filename, "proxy: error linking cache file", s); } if (unlink(c->tempfile) == -1) - proxy_log_uerror("unlink", c->tempfile, + ap_proxy_log_uerror("unlink", c->tempfile, "proxy: error deleting temp file", s); #endif 1.27 +17 -17 apache-1.3/src/modules/proxy/proxy_connect.c Index: proxy_connect.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_connect.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- proxy_connect.c 1998/03/31 12:53:01 1.26 +++ proxy_connect.c 1998/04/11 12:00:40 1.27 @@ -97,7 +97,7 @@ * FIXME: no check for r->assbackwards, whatever that is. */ -int proxy_connect_handler(request_rec *r, struct cache_req *c, char *url, +int ap_proxy_connect_handler(request_rec *r, struct cache_req *c, char *url, const char *proxyhost, int proxyport) { struct sockaddr_in server; @@ -112,7 +112,7 @@ void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); struct noproxy_entry *npent = (struct noproxy_entry *) conf->noproxies->elts; memset(&server, '\0', sizeof(server)); @@ -134,7 +134,7 @@ for (i = 0; i < conf->noproxies->nelts; i++) { if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL) || destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*') - return proxyerror(r, "Connect to remote machine blocked"); + return ap_proxyerror(r, "Connect to remote machine blocked"); } switch (port) { @@ -153,26 +153,26 @@ } server.sin_port = (proxyport ? htons(proxyport) : htons(port)); - err = proxy_host2addr(proxyhost ? proxyhost : host, &server_hp); + err = ap_proxy_host2addr(proxyhost ? proxyhost : host, &server_hp); if (err != NULL) - return proxyerror(r, err); /* give up */ + return ap_proxyerror(r, err); /* give up */ - sock = psocket(r->pool, PF_INET, SOCK_STREAM, IPPROTO_TCP); + sock = ap_psocket(r->pool, PF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "proxy: error creating socket"); return SERVER_ERROR; } #ifndef WIN32 if (sock >= FD_SETSIZE) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_WARNING, NULL, "proxy_connect_handler: filedescriptor (%u) " "larger than FD_SETSIZE (%u) " "found, you probably need to rebuild Apache with a " "larger FD_SETSIZE", sock, FD_SETSIZE); - pclosesocket(r->pool, sock); + ap_pclosesocket(r->pool, sock); return SERVER_ERROR; } #endif @@ -181,14 +181,14 @@ while (server_hp.h_addr_list[j] != NULL) { memcpy(&server.sin_addr, server_hp.h_addr_list[j], sizeof(struct in_addr)); - i = proxy_doconnect(sock, &server, r); + i = ap_proxy_doconnect(sock, &server, r); if (i == 0) break; j++; } if (i == -1) { - pclosesocket(r->pool, sock); - return proxyerror(r, "Could not connect to remote machine"); + ap_pclosesocket(r->pool, sock); + return ap_proxyerror(r, "Could not connect to remote machine"); } /* If we are connecting through a remote proxy, we need to pass @@ -204,14 +204,14 @@ r->uri); write(sock, buffer, strlen(buffer)); ap_snprintf(buffer, sizeof(buffer), - "Proxy-agent: %s" CRLF CRLF, apapi_get_server_version()); + "Proxy-agent: %s" CRLF CRLF, ap_get_server_version()); write(sock, buffer, strlen(buffer)); } else { Explain0("Returning 200 OK Status"); - rvputs(r, "HTTP/1.0 200 Connection established" CRLF, NULL); - rvputs(r, "Proxy-agent: ", apapi_get_server_version(), CRLF CRLF, NULL); - bflush(r->connection->client); + ap_rvputs(r, "HTTP/1.0 200 Connection established" CRLF, NULL); + ap_rvputs(r, "Proxy-agent: ", ap_get_server_version(), CRLF CRLF, NULL); + ap_bflush(r->connection->client); } while (1) { /* Infinite loop until error (one side closes the connection) */ @@ -258,7 +258,7 @@ break; } - pclosesocket(r->pool, sock); + ap_pclosesocket(r->pool, sock); return OK; } 1.57 +205 -205 apache-1.3/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- proxy_ftp.c 1998/03/31 12:53:02 1.56 +++ proxy_ftp.c 1998/04/11 12:00:40 1.57 @@ -75,7 +75,7 @@ /* decode it if not already done */ ch = x[i]; if (ch == '%' && isxdigit(x[i + 1]) && isxdigit(x[i + 2])) { - ch = proxy_hex2c(&x[i + 1]); + ch = ap_proxy_hex2c(&x[i + 1]); i += 2; } x[j] = ch; @@ -95,7 +95,7 @@ for (i = 0; x[i] != '\0'; i++) { ch = x[i]; if (ch == '%' && isxdigit(x[i + 1]) && isxdigit(x[i + 2])) { - ch = proxy_hex2c(&x[i + 1]); + ch = ap_proxy_hex2c(&x[i + 1]); i += 2; } #ifndef CHARSET_EBCDIC @@ -111,7 +111,7 @@ /* * Canonicalise ftp URLs. */ -int proxy_ftp_canon(request_rec *r, char *url) +int ap_proxy_ftp_canon(request_rec *r, char *url) { char *user, *password, *host, *path, *parms, *strp, sport[7]; pool *p = r->pool; @@ -119,7 +119,7 @@ int port; port = DEFAULT_FTP_PORT; - err = proxy_canon_netloc(p, &url, &user, &password, &host, &port); + err = ap_proxy_canon_netloc(p, &url, &user, &password, &host, &port); if (err) return HTTP_BAD_REQUEST; if (user != NULL && !ftp_check_string(user)) @@ -136,14 +136,14 @@ strp = strchr(url, ';'); if (strp != NULL) { *(strp++) = '\0'; - parms = proxy_canonenc(p, strp, strlen(strp), enc_parm, r->proxyreq); + parms = ap_proxy_canonenc(p, strp, strlen(strp), enc_parm, r->proxyreq); if (parms == NULL) return HTTP_BAD_REQUEST; } else parms = ""; - path = proxy_canonenc(p, url, strlen(url), enc_path, r->proxyreq); + path = ap_proxy_canonenc(p, url, strlen(url), enc_path, r->proxyreq); if (path == NULL) return HTTP_BAD_REQUEST; if (!ftp_check_string(path)) @@ -151,16 +151,16 @@ if (!r->proxyreq && r->args != NULL) { if (strp != NULL) { - strp = proxy_canonenc(p, r->args, strlen(r->args), enc_parm, 1); + strp = ap_proxy_canonenc(p, r->args, strlen(r->args), enc_parm, 1); if (strp == NULL) return HTTP_BAD_REQUEST; - parms = pstrcat(p, parms, "?", strp, NULL); + parms = ap_pstrcat(p, parms, "?", strp, NULL); } else { - strp = proxy_canonenc(p, r->args, strlen(r->args), enc_fpath, 1); + strp = ap_proxy_canonenc(p, r->args, strlen(r->args), enc_fpath, 1); if (strp == NULL) return HTTP_BAD_REQUEST; - path = pstrcat(p, path, "?", strp, NULL); + path = ap_pstrcat(p, path, "?", strp, NULL); } r->args = NULL; } @@ -172,7 +172,7 @@ else sport[0] = '\0'; - r->filename = pstrcat(p, "proxy:ftp://", (user != NULL) ? user : "", + r->filename = ap_pstrcat(p, "proxy:ftp://", (user != NULL) ? user : "", (password != NULL) ? ":" : "", (password != NULL) ? password : "", (user != NULL) ? "@" : "", host, sport, "/", path, @@ -190,7 +190,7 @@ int len, status; char linebuff[100], buff[5]; - len = bgets(linebuff, 100, f); + len = ap_bgets(linebuff, 100, f); if (len == -1) return -1; /* check format */ @@ -201,7 +201,7 @@ status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0'; if (linebuff[len - 1] != '\n') { - (void)bskiplf(f); + (void)ap_bskiplf(f); } /* skip continuation lines */ @@ -209,11 +209,11 @@ memcpy(buff, linebuff, 3); buff[3] = ' '; do { - len = bgets(linebuff, 100, f); + len = ap_bgets(linebuff, 100, f); if (len == -1) return -1; if (linebuff[len - 1] != '\n') { - (void)bskiplf(f); + (void)ap_bskiplf(f); } } while (memcmp(linebuff, buff, 4) != 0); } @@ -232,7 +232,7 @@ char *mb = msgbuf; int ml = msglen; - len = bgets(linebuff, 100, f); + len = ap_bgets(linebuff, 100, f); if (len == -1) return -1; if (len < 5 || !isdigit(linebuff[0]) || !isdigit(linebuff[1]) || @@ -244,17 +244,17 @@ mb = ap_cpystrn(mb, linebuff+4, len-4 < ml ? len-4 : ml); if (linebuff[len - 1] != '\n') - (void)bskiplf(f); + (void)ap_bskiplf(f); if (linebuff[3] == '-') { memcpy(buff, linebuff, 3); buff[3] = ' '; do { - len = bgets(linebuff, 100, f); + len = ap_bgets(linebuff, 100, f); if (len == -1) return -1; if (linebuff[len - 1] != '\n') { - (void)bskiplf(f); + (void)ap_bskiplf(f); } mb = ap_cpystrn(mb, linebuff+4, len-4 < ml ? len-4 : ml); } while (memcmp(linebuff, buff, 4) != 0); @@ -279,7 +279,7 @@ char *dir, *path, *reldir, *site, *psite; const char *sig; - tempurl = pstrdup(r->pool, url); + tempurl = ap_pstrdup(r->pool, url); (void)decodeenc(tempurl); @@ -294,7 +294,7 @@ } /* Save "scheme://site" prefix */ - site = psite = pstrndup(r->pool, tempurl, hostlen); + site = psite = ap_pstrndup(r->pool, tempurl, hostlen); if ((n = strcspn(tempurl, "@")) != strlen(tempurl) && n < hostlen) { /* hide user/passwd */ memmove(tempurl + (n - 5), tempurl, 6); @@ -302,11 +302,11 @@ hostlen -= (n-5); /* Save "scheme://site" prefix without user/password */ - site = pstrndup(r->pool, tempurl, hostlen); + site = ap_pstrndup(r->pool, tempurl, hostlen); } /* Copy path, strip (all except the last) trailing slashes */ - path = dir = pstrcat(r->pool, tempurl+hostlen, "/", NULL); + path = dir = ap_pstrcat(r->pool, tempurl+hostlen, "/", NULL); while ((n = strlen(path)) > 1 && path[n-1] == '/' && path[n-2] == '/') path[n-1] = '\0'; @@ -317,9 +317,9 @@ "<BODY><H2>Directory of " "<A HREF=\"/\">%s</A>/", tempurl, psite, path, site); - bputs(buf, con->client); + ap_bputs(buf, con->client); if (f2 != NULL) - bputs(buf, f2); + ap_bputs(buf, f2); total_bytes_sent += strlen(buf); while ((dir = strchr(dir+1, '/')) != NULL) @@ -331,16 +331,16 @@ ++reldir; /* print "path/" component */ ap_snprintf(buf, sizeof(buf), "<A HREF=\"/%s/\">%s</A>/", path+1, reldir); - bputs(buf, con->client); + ap_bputs(buf, con->client); if (f2 != NULL) - bputs(buf, f2); + ap_bputs(buf, f2); total_bytes_sent += strlen(buf); *dir = '/'; } ap_snprintf(buf, sizeof(buf), "</H2>\n<HR><PRE>"); - bputs(buf, con->client); + ap_bputs(buf, con->client); if (f2 != NULL) - bputs(buf, f2); + ap_bputs(buf, f2); total_bytes_sent += strlen(buf); for (hostlen=0; url[hostlen]!='/'; ++hostlen) @@ -352,10 +352,10 @@ hostlen = 0; while (!con->aborted) { - n = bgets(buf, IOBUFSIZE, f); + n = ap_bgets(buf, IOBUFSIZE, f); if (n == -1) { /* input error */ if (f2 != NULL) - f2 = proxy_cache_error(c); + f2 = ap_proxy_cache_error(c); break; } if (n == 0) @@ -416,36 +416,36 @@ total_bytes_sent += n; if (f2 != NULL) - if (bwrite(f2, buf, n) != n) - f2 = proxy_cache_error(c); + if (ap_bwrite(f2, buf, n) != n) + f2 = ap_proxy_cache_error(c); while (n && !r->connection->aborted) { - w = bwrite(con->client, &buf[o], n); + w = ap_bwrite(con->client, &buf[o], n); if (w <= 0) break; - reset_timeout(r); /* reset timeout after successfule write */ + ap_reset_timeout(r); /* reset timeout after successfule write */ n -= w; o += w; } } site = "</PRE><HR>\n"; - bputs(site, con->client); + ap_bputs(site, con->client); if (f2 != NULL) - bputs(site, f2); + ap_bputs(site, f2); total_bytes_sent += strlen(site); - sig = psignature("", r); - bputs(sig, con->client); + sig = ap_psignature("", r); + ap_bputs(sig, con->client); if (f2 != NULL) - bputs(sig, f2); + ap_bputs(sig, f2); total_bytes_sent += strlen(sig); site = "</BODY></HTML>\n"; - bputs(site, con->client); + ap_bputs(site, con->client); if (f2 != NULL) - bputs(site, f2); + ap_bputs(site, f2); total_bytes_sent += strlen(site); - bflush(con->client); + ap_bflush(con->client); return total_bytes_sent; } @@ -456,7 +456,7 @@ * Troy Morrison <[EMAIL PROTECTED]> * PASV added by Chuck */ -int proxy_ftp_handler(request_rec *r, struct cache_req *c, char *url) +int ap_proxy_ftp_handler(request_rec *r, struct cache_req *c, char *url) { char *host, *path, *strp, *user, *password, *parms; const char *err; @@ -477,7 +477,7 @@ void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); struct noproxy_entry *npent = (struct noproxy_entry *) conf->noproxies->elts; struct nocache_entry *ncent = (struct nocache_entry *) conf->nocaches->elts; @@ -502,11 +502,11 @@ /* allocate a buffer for the response message */ resplen = MAX_STRING_LEN; - resp = (char *)palloc(r->pool, resplen); + resp = (char *)ap_palloc(r->pool, resplen); /* We break the URL into host, port, path-search */ - host = pstrdup(p, url + 6); + host = ap_pstrdup(p, url + 6); port = DEFAULT_FTP_PORT; path = strchr(host, '/'); if (path == NULL) @@ -551,7 +551,7 @@ for (i = 0; i < conf->noproxies->nelts; i++) { if ((npent[i].name != NULL && strstr(host, npent[i].name) != NULL) || destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*') - return proxyerror(r, "Connect to remote machine blocked"); + return ap_proxyerror(r, "Connect to remote machine blocked"); } Explain2("FTP: connect to %s:%d", host, port); @@ -563,13 +563,13 @@ memset(&server, 0, sizeof(struct sockaddr_in)); server.sin_family = AF_INET; server.sin_port = htons(port); - err = proxy_host2addr(host, &server_hp); + err = ap_proxy_host2addr(host, &server_hp); if (err != NULL) - return proxyerror(r, err); /* give up */ + return ap_proxyerror(r, err); /* give up */ - sock = psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); + sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { - proxy_log_uerror("socket", NULL, "proxy: error creating socket", + ap_proxy_log_uerror("socket", NULL, "proxy: error creating socket", r->server); return SERVER_ERROR; } @@ -578,7 +578,7 @@ if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (const char *) &conf->recv_buffer_size, sizeof(int)) == -1) { - proxy_log_uerror("setsockopt", "(SO_RCVBUF)", + ap_proxy_log_uerror("setsockopt", "(SO_RCVBUF)", "Failed to set ProxyReceiveBufferSize, using default", r->server); } @@ -587,9 +587,9 @@ if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &one, sizeof(one)) == -1) { #ifndef _OSD_POSIX /* BS2000 has this option "always on" */ - proxy_log_uerror("setsockopt", NULL, + ap_proxy_log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option", r->server); - pclosesocket(p, sock); + ap_pclosesocket(p, sock); return SERVER_ERROR; #endif /*_OSD_POSIX*/ } @@ -600,7 +600,7 @@ for (; ip_addr->s_addr != 0; ++ip_addr) { memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr)); - i = proxy_doconnect(sock, &server, r); + i = ap_proxy_doconnect(sock, &server, r); if (i == 0) break; } @@ -610,44 +610,44 @@ while (server_hp.h_addr_list[j] != NULL) { memcpy(&server.sin_addr, server_hp.h_addr_list[j], sizeof(struct in_addr)); - i = proxy_doconnect(sock, &server, r); + i = ap_proxy_doconnect(sock, &server, r); if (i == 0) break; j++; } #endif if (i == -1) { - pclosesocket(p, sock); - return proxyerror(r, "Could not connect to remote machine"); + ap_pclosesocket(p, sock); + return ap_proxyerror(r, "Could not connect to remote machine"); } - f = bcreate(p, B_RDWR | B_SOCKET); - bpushfd(f, sock, sock); + f = ap_bcreate(p, B_RDWR | B_SOCKET); + ap_bpushfd(f, sock, sock); /* shouldn't we implement telnet control options here? */ #ifdef CHARSET_EBCDIC - bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1); + ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 1); #endif /*CHARSET_EBCDIC*/ /* possible results: 120, 220, 421 */ - hard_timeout("proxy ftp", r); + ap_hard_timeout("proxy ftp", r); i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error reading from remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error reading from remote server"); } if (i != 220) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } Explain0("FTP: connected."); - bputs("USER ", f); - bwrite(f, user, userlen); - bputs(CRLF, f); - bflush(f); /* capture any errors */ + ap_bputs("USER ", f); + ap_bwrite(f, user, userlen); + ap_bputs(CRLF, f); + ap_bflush(f); /* capture any errors */ Explain1("FTP: USER %s", user); /* possible results; 230, 331, 332, 421, 500, 501, 530 */ @@ -655,43 +655,43 @@ i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (i == 530) { - kill_timeout(r); - return proxyerror(r, "Not logged in"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Not logged in"); } if (i != 230 && i != 331) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } if (i == 331) { /* send password */ if (password == NULL) return FORBIDDEN; - bputs("PASS ", f); - bwrite(f, password, passlen); - bputs(CRLF, f); - bflush(f); + ap_bputs("PASS ", f); + ap_bwrite(f, password, passlen); + ap_bputs(CRLF, f); + ap_bflush(f); Explain1("FTP: PASS %s", password); /* possible results 202, 230, 332, 421, 500, 501, 503, 530 */ i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (i == 332) { - kill_timeout(r); - return proxyerror(r, "Need account for login"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Need account for login"); } if (i == 530) { - kill_timeout(r); - return proxyerror(r, "Not logged in"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Not logged in"); } if (i != 230 && i != 202) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } } @@ -707,25 +707,25 @@ *strp = '\0'; len = decodeenc(path); - bputs("CWD ", f); - bwrite(f, path, len); - bputs(CRLF, f); - bflush(f); + ap_bputs("CWD ", f); + ap_bwrite(f, path, len); + ap_bputs(CRLF, f); + ap_bflush(f); Explain1("FTP: CWD %s", path); /* responses: 250, 421, 500, 501, 502, 530, 550 */ /* 1,3 error, 2 success, 4,5 failure */ i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (i == 550) { - kill_timeout(r); + ap_kill_timeout(r); return NOT_FOUND; } if (i != 250) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } @@ -747,18 +747,18 @@ /* set type to image */ /* TM - Added \015\012 to the end of TYPE I, otherwise it hangs the connection */ - bputs("TYPE I" CRLF, f); - bflush(f); + ap_bputs("TYPE I" CRLF, f); + ap_bflush(f); Explain0("FTP: TYPE I"); /* responses: 200, 421, 500, 501, 504, 530 */ i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (i != 200 && i != 504) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } /* Allow not implemented */ @@ -767,35 +767,35 @@ } /* try to set up PASV data connection first */ - dsock = psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); + dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); if (dsock == -1) { - proxy_log_uerror("socket", NULL, "proxy: error creating PASV socket", + ap_proxy_log_uerror("socket", NULL, "proxy: error creating PASV socket", r->server); - bclose(f); - kill_timeout(r); + ap_bclose(f); + ap_kill_timeout(r); return SERVER_ERROR; } if (conf->recv_buffer_size) { if (setsockopt(dsock, SOL_SOCKET, SO_RCVBUF, (const char *) &conf->recv_buffer_size, sizeof(int)) == -1) { - proxy_log_uerror("setsockopt", "(SO_RCVBUF)", + ap_proxy_log_uerror("setsockopt", "(SO_RCVBUF)", "Failed to set ProxyReceiveBufferSize, using default", r->server); } } - bputs("PASV" CRLF, f); - bflush(f); + ap_bputs("PASV" CRLF, f); + ap_bflush(f); Explain0("FTP: PASV command issued"); /* possible results: 227, 421, 500, 501, 502, 530 */ - i = bgets(pasv, sizeof(pasv), f); + i = ap_bgets(pasv, sizeof(pasv), f); if (i == -1) { - proxy_log_uerror("command", NULL, "PASV: control connection is toast", + ap_proxy_log_uerror("command", NULL, "PASV: control connection is toast", r->server); - pclosesocket(p, dsock); - bclose(f); - kill_timeout(r); + ap_pclosesocket(p, dsock); + ap_bclose(f); + ap_kill_timeout(r); return SERVER_ERROR; } else { @@ -822,47 +822,47 @@ data_addr.sin_family = AF_INET; data_addr.sin_addr.s_addr = htonl(paddr); data_addr.sin_port = htons(pport); - i = proxy_doconnect(dsock, &data_addr, r); + i = ap_proxy_doconnect(dsock, &data_addr, r); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Could not connect to remote machine"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Could not connect to remote machine"); } else { pasvmode = 1; } } else - pclosesocket(p, dsock); /* and try the regular way */ + ap_pclosesocket(p, dsock); /* and try the regular way */ } if (!pasvmode) { /* set up data connection */ clen = sizeof(struct sockaddr_in); if (getsockname(sock, (struct sockaddr *) &server, &clen) < 0) { - proxy_log_uerror("getsockname", NULL, + ap_proxy_log_uerror("getsockname", NULL, "proxy: error getting socket address", r->server); - bclose(f); - kill_timeout(r); + ap_bclose(f); + ap_kill_timeout(r); return SERVER_ERROR; } - dsock = psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); + dsock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); if (dsock == -1) { - proxy_log_uerror("socket", NULL, "proxy: error creating socket", + ap_proxy_log_uerror("socket", NULL, "proxy: error creating socket", r->server); - bclose(f); - kill_timeout(r); + ap_bclose(f); + ap_kill_timeout(r); return SERVER_ERROR; } if (setsockopt(dsock, SOL_SOCKET, SO_REUSEADDR, (void *) &one, sizeof(one)) == -1) { #ifndef _OSD_POSIX /* BS2000 has this option "always on" */ - proxy_log_uerror("setsockopt", NULL, + ap_proxy_log_uerror("setsockopt", NULL, "proxy: error setting reuseaddr option", r->server); - pclosesocket(p, dsock); - bclose(f); - kill_timeout(r); + ap_pclosesocket(p, dsock); + ap_bclose(f); + ap_kill_timeout(r); return SERVER_ERROR; #endif /*_OSD_POSIX*/ } @@ -872,10 +872,10 @@ char buff[22]; ap_snprintf(buff, sizeof(buff), "%s:%d", inet_ntoa(server.sin_addr), server.sin_port); - proxy_log_uerror("bind", buff, + ap_proxy_log_uerror("bind", buff, "proxy: error binding to ftp data socket", r->server); - bclose(f); - pclosesocket(p, dsock); + ap_bclose(f); + ap_pclosesocket(p, dsock); return SERVER_ERROR; } listen(dsock, 2); /* only need a short queue */ @@ -890,10 +890,10 @@ parms = "d"; } else { - bputs("SIZE ", f); - bwrite(f, path, len); - bputs(CRLF, f); - bflush(f); + ap_bputs("SIZE ", f); + ap_bwrite(f, path, len); + ap_bputs(CRLF, f); + ap_bflush(f); Explain1("FTP: SIZE %s", path); i = ftp_getrc_msg(f, resp, resplen); Explain2("FTP: returned status %d with response %s", i, resp); @@ -901,23 +901,23 @@ if (i == 550) { /* Not a regular file */ Explain0("FTP: SIZE shows this is a directory"); parms = "d"; - bputs("CWD ", f); - bwrite(f, path, len); - bputs(CRLF, f); - bflush(f); + ap_bputs("CWD ", f); + ap_bwrite(f, path, len); + ap_bputs(CRLF, f); + ap_bflush(f); Explain1("FTP: CWD %s", path); i = ftp_getrc(f); Explain1("FTP: returned status %d", i); if (i == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (i == 550) { - kill_timeout(r); + ap_kill_timeout(r); return NOT_FOUND; } if (i != 250) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } path = ""; @@ -931,78 +931,78 @@ if (parms[0] == 'd') { if (len != 0) - bputs("LIST ", f); + ap_bputs("LIST ", f); else - bputs("LIST -lag", f); + ap_bputs("LIST -lag", f); Explain1("FTP: LIST %s", (len == 0 ? "" : path)); } else { - bputs("RETR ", f); + ap_bputs("RETR ", f); Explain1("FTP: RETR %s", path); } - bwrite(f, path, len); - bputs(CRLF, f); - bflush(f); + ap_bwrite(f, path, len); + ap_bputs(CRLF, f); + ap_bflush(f); /* RETR: 110, 125, 150, 226, 250, 421, 425, 426, 450, 451, 500, 501, 530, 550 NLST: 125, 150, 226, 250, 421, 425, 426, 450, 451, 500, 501, 502, 530 */ rc = ftp_getrc(f); Explain1("FTP: returned status %d", rc); if (rc == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (rc == 550) { Explain0("FTP: RETR failed, trying LIST instead"); parms = "d"; - bputs("CWD ", f); - bwrite(f, path, len); - bputs(CRLF, f); - bflush(f); + ap_bputs("CWD ", f); + ap_bwrite(f, path, len); + ap_bputs(CRLF, f); + ap_bflush(f); Explain1("FTP: CWD %s", path); rc = ftp_getrc(f); Explain1("FTP: returned status %d", rc); if (rc == -1) { - kill_timeout(r); - return proxyerror(r, "Error sending to remote server"); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error sending to remote server"); } if (rc == 550) { - kill_timeout(r); + ap_kill_timeout(r); return NOT_FOUND; } if (rc != 250) { - kill_timeout(r); + ap_kill_timeout(r); return BAD_GATEWAY; } - bputs("LIST -lag" CRLF, f); - bflush(f); + ap_bputs("LIST -lag" CRLF, f); + ap_bflush(f); Explain0("FTP: LIST -lag"); rc = ftp_getrc(f); Explain1("FTP: returned status %d", rc); if (rc == -1) - return proxyerror(r, "Error sending to remote server"); + return ap_proxyerror(r, "Error sending to remote server"); } - kill_timeout(r); + ap_kill_timeout(r); if (rc != 125 && rc != 150 && rc != 226 && rc != 250) return BAD_GATEWAY; r->status = 200; r->status_line = "200 OK"; - resp_hdrs = make_array(p, 2, sizeof(struct hdr_entry)); + resp_hdrs = ap_make_array(p, 2, sizeof(struct hdr_entry)); if (parms[0] == 'd') - proxy_add_header(resp_hdrs, "Content-Type", "text/html", HDR_REP); + ap_proxy_add_header(resp_hdrs, "Content-Type", "text/html", HDR_REP); else { if (r->content_type != NULL) { - proxy_add_header(resp_hdrs, "Content-Type", r->content_type, + ap_proxy_add_header(resp_hdrs, "Content-Type", r->content_type, HDR_REP); Explain1("FTP: Content-Type set to %s", r->content_type); } else { - proxy_add_header(resp_hdrs, "Content-Type", "text/plain", HDR_REP); + ap_proxy_add_header(resp_hdrs, "Content-Type", "text/plain", HDR_REP); } if (parms[0] != 'a' && size != NULL) { - proxy_add_header(resp_hdrs, "Content-Length", size, HDR_REP); + ap_proxy_add_header(resp_hdrs, "Content-Length", size, HDR_REP); Explain1("FTP: Content-Length set to %s", size); } } @@ -1014,53 +1014,53 @@ nocache = 1; } - i = proxy_cache_update(c, resp_hdrs, 0, nocache); + i = ap_proxy_cache_update(c, resp_hdrs, 0, nocache); if (i != DECLINED) { - pclosesocket(p, dsock); - bclose(f); + ap_pclosesocket(p, dsock); + ap_bclose(f); return i; } cache = c->fp; if (!pasvmode) { /* wait for connection */ - hard_timeout("proxy ftp data connect", r); + ap_hard_timeout("proxy ftp data connect", r); clen = sizeof(struct sockaddr_in); do csd = accept(dsock, (struct sockaddr *) &server, &clen); while (csd == -1 && errno == EINTR); if (csd == -1) { - proxy_log_uerror("accept", NULL, + ap_proxy_log_uerror("accept", NULL, "proxy: failed to accept data connection", r->server); - pclosesocket(p, dsock); - bclose(f); - kill_timeout(r); - proxy_cache_error(c); + ap_pclosesocket(p, dsock); + ap_bclose(f); + ap_kill_timeout(r); + ap_proxy_cache_error(c); return BAD_GATEWAY; } - note_cleanups_for_socket(p, csd); - data = bcreate(p, B_RDWR | B_SOCKET); - bpushfd(data, csd, -1); - kill_timeout(r); + ap_note_cleanups_for_socket(p, csd); + data = ap_bcreate(p, B_RDWR | B_SOCKET); + ap_bpushfd(data, csd, -1); + ap_kill_timeout(r); } else { - data = bcreate(p, B_RDWR | B_SOCKET); - bpushfd(data, dsock, dsock); + data = ap_bcreate(p, B_RDWR | B_SOCKET); + ap_bpushfd(data, dsock, dsock); } #ifdef CHARSET_EBCDIC /* bsetflag(data, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0);*/ #endif /*CHARSET_EBCDIC*/ - hard_timeout("proxy receive", r); + ap_hard_timeout("proxy receive", r); /* send response */ /* write status line */ if (!r->assbackwards) - rvputs(r, "HTTP/1.0 ", r->status_line, CRLF, NULL); + ap_rvputs(r, "HTTP/1.0 ", r->status_line, CRLF, NULL); if (cache != NULL) - if (bvputs(cache, "HTTP/1.0 ", r->status_line, CRLF, + if (ap_bvputs(cache, "HTTP/1.0 ", r->status_line, CRLF, NULL) == -1) - cache = proxy_cache_error(c); + cache = ap_proxy_cache_error(c); /* send headers */ len = resp_hdrs->nelts; @@ -1070,61 +1070,61 @@ hdr[i].value[0] == '\0') continue; if (!r->assbackwards) - rvputs(r, hdr[i].field, ": ", hdr[i].value, CRLF, NULL); + ap_rvputs(r, hdr[i].field, ": ", hdr[i].value, CRLF, NULL); if (cache != NULL) - if (bvputs(cache, hdr[i].field, ": ", hdr[i].value, CRLF, + if (ap_bvputs(cache, hdr[i].field, ": ", hdr[i].value, CRLF, NULL) == -1) - cache = proxy_cache_error(c); + cache = ap_proxy_cache_error(c); } if (!r->assbackwards) - rputs(CRLF, r); + ap_rputs(CRLF, r); if (cache != NULL) - if (bputs(CRLF, cache) == -1) - cache = proxy_cache_error(c); + if (ap_bputs(CRLF, cache) == -1) + cache = ap_proxy_cache_error(c); - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; /* send body */ if (!r->header_only) { if (parms[0] != 'd') - proxy_send_fb(data, r, cache, c); + ap_proxy_send_fb(data, r, cache, c); else send_dir(data, r, cache, c, url); if (rc == 125 || rc == 150) rc = ftp_getrc(f); if (rc != 226 && rc != 250) - proxy_cache_error(c); + ap_proxy_cache_error(c); } else { /* abort the transfer */ - bputs("ABOR" CRLF, f); - bflush(f); + ap_bputs("ABOR" CRLF, f); + ap_bflush(f); if (!pasvmode) - bclose(data); + ap_bclose(data); Explain0("FTP: ABOR"); /* responses: 225, 226, 421, 500, 501, 502 */ i = ftp_getrc(f); Explain1("FTP: returned status %d", i); } - kill_timeout(r); - proxy_cache_tidy(c); + ap_kill_timeout(r); + ap_proxy_cache_tidy(c); /* finish */ - bputs("QUIT" CRLF, f); - bflush(f); + ap_bputs("QUIT" CRLF, f); + ap_bflush(f); Explain0("FTP: QUIT"); /* responses: 221, 500 */ if (pasvmode) - bclose(data); - bclose(f); + ap_bclose(data); + ap_bclose(f); - rflush(r); /* flush before garbage collection */ + ap_rflush(r); /* flush before garbage collection */ - proxy_garbage_coll(r); + ap_proxy_garbage_coll(r); return OK; } 1.46 +76 -76 apache-1.3/src/modules/proxy/proxy_http.c Index: proxy_http.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_http.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- proxy_http.c 1998/03/31 12:53:02 1.45 +++ proxy_http.c 1998/04/11 12:00:40 1.46 @@ -69,7 +69,7 @@ * url is the URL starting with the first '/' * def_port is the default port for this scheme. */ -int proxy_http_canon(request_rec *r, char *url, const char *scheme, int def_port) +int ap_proxy_http_canon(request_rec *r, char *url, const char *scheme, int def_port) { char *host, *path, *search, sport[7]; const char *err; @@ -79,7 +79,7 @@ * We break the URL into host, port, path, search */ port = def_port; - err = proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port); + err = ap_proxy_canon_netloc(r->pool, &url, NULL, NULL, &host, &port); if (err) return HTTP_BAD_REQUEST; @@ -97,7 +97,7 @@ search = r->args; /* process path */ - path = proxy_canonenc(r->pool, url, strlen(url), enc_path, r->proxyreq); + path = ap_proxy_canonenc(r->pool, url, strlen(url), enc_path, r->proxyreq); if (path == NULL) return HTTP_BAD_REQUEST; @@ -106,7 +106,7 @@ else sport[0] = '\0'; - r->filename = pstrcat(r->pool, "proxy:", scheme, "://", host, sport, "/", + r->filename = ap_pstrcat(r->pool, "proxy:", scheme, "://", host, sport, "/", path, (search) ? "?" : "", (search) ? search : "", NULL); return OK; } @@ -120,14 +120,14 @@ char *u; sconf = r->server->module_config; - conf = (proxy_server_conf *)get_module_config(sconf, &proxy_module); + conf = (proxy_server_conf *)ap_get_module_config(sconf, &proxy_module); l1 = strlen(url); ent = (struct proxy_alias *)conf->raliases->elts; for (i = 0; i < conf->raliases->nelts; i++) { l2 = strlen(ent[i].real); if (l1 >= l2 && strncmp(ent[i].real, url, l2) == 0) { - u = pstrcat(r->pool, ent[i].fake, &url[l2], NULL); - return construct_url(r->pool, u, r); + u = ap_pstrcat(r->pool, ent[i].fake, &url[l2], NULL); + return ap_construct_url(r->pool, u, r); } } return url; @@ -137,9 +137,9 @@ static void clear_connection(table *headers) { char *name; - char *next = table_get(headers, "Connection"); + char *next = ap_table_get(headers, "Connection"); - table_unset(headers, "Proxy-Connection"); + ap_table_unset(headers, "Proxy-Connection"); if (!next) return; @@ -151,9 +151,9 @@ *next = '\0'; ++next; } - table_unset(headers, name); + ap_table_unset(headers, name); } - table_unset(headers, "Connection"); + ap_table_unset(headers, "Connection"); } /* @@ -165,7 +165,7 @@ * we return DECLINED so that we can try another proxy. (Or the direct * route.) */ -int proxy_http_handler(request_rec *r, struct cache_req *c, char *url, +int ap_proxy_http_handler(request_rec *r, struct cache_req *c, char *url, const char *proxyhost, int proxyport) { char *strp; @@ -187,7 +187,7 @@ void *sconf = r->server->module_config; proxy_server_conf *conf = - (proxy_server_conf *) get_module_config(sconf, &proxy_module); + (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module); struct noproxy_entry *npent = (struct noproxy_entry *) conf->noproxies->elts; struct nocache_entry *ncent = (struct nocache_entry *) conf->nocaches->elts; int nocache = 0; @@ -204,11 +204,11 @@ destport = DEFAULT_HTTP_PORT; strp = strchr(urlptr, '/'); if (strp == NULL) { - desthost = pstrdup(p, urlptr); + desthost = ap_pstrdup(p, urlptr); urlptr = "/"; } else { - char *q = palloc(p, strp - urlptr + 1); + char *q = ap_palloc(p, strp - urlptr + 1); memcpy(q, urlptr, strp - urlptr); q[strp - urlptr] = '\0'; urlptr = strp; @@ -229,25 +229,25 @@ for (i = 0; i < conf->noproxies->nelts; i++) { if ((npent[i].name != NULL && strstr(desthost, npent[i].name) != NULL) || destaddr.s_addr == npent[i].addr.s_addr || npent[i].name[0] == '*') - return proxyerror(r, "Connect to remote machine blocked"); + return ap_proxyerror(r, "Connect to remote machine blocked"); } if (proxyhost != NULL) { server.sin_port = htons(proxyport); - err = proxy_host2addr(proxyhost, &server_hp); + err = ap_proxy_host2addr(proxyhost, &server_hp); if (err != NULL) return DECLINED; /* try another */ } else { server.sin_port = htons(destport); - err = proxy_host2addr(desthost, &server_hp); + err = ap_proxy_host2addr(desthost, &server_hp); if (err != NULL) - return proxyerror(r, err); /* give up */ + return ap_proxyerror(r, err); /* give up */ } - sock = psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); + sock = ap_psocket(p, PF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "proxy: error creating socket"); return HTTP_INTERNAL_SERVER_ERROR; } @@ -256,7 +256,7 @@ if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (const char *) &conf->recv_buffer_size, sizeof(int)) == -1) { - proxy_log_uerror("setsockopt", "(SO_RCVBUF)", + ap_proxy_log_uerror("setsockopt", "(SO_RCVBUF)", "Failed to set ReceiveBufferSize, using default", r->server); } @@ -268,7 +268,7 @@ for (; ip_addr->s_addr != 0; ++ip_addr) { memcpy(&server.sin_addr, ip_addr, sizeof(struct in_addr)); - i = proxy_doconnect(sock, &server, r); + i = ap_proxy_doconnect(sock, &server, r); if (i == 0) break; } @@ -278,7 +278,7 @@ while (server_hp.h_addr_list[j] != NULL) { memcpy(&server.sin_addr, server_hp.h_addr_list[j], sizeof(struct in_addr)); - i = proxy_doconnect(sock, &server, r); + i = ap_proxy_doconnect(sock, &server, r); if (i == 0) break; j++; @@ -288,22 +288,22 @@ if (proxyhost != NULL) return DECLINED; /* try again another way */ else - return proxyerror(r, "Could not connect to remote machine"); + return ap_proxyerror(r, "Could not connect to remote machine"); } clear_connection(r->headers_in); /* Strip connection-based headers */ - f = bcreate(p, B_RDWR | B_SOCKET); - bpushfd(f, sock, sock); + f = ap_bcreate(p, B_RDWR | B_SOCKET); + ap_bpushfd(f, sock, sock); - hard_timeout("proxy send", r); - bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF, + ap_hard_timeout("proxy send", r); + ap_bvputs(f, r->method, " ", proxyhost ? url : urlptr, " HTTP/1.0" CRLF, NULL); - bvputs(f, "Host: ", desthost, NULL); + ap_bvputs(f, "Host: ", desthost, NULL); if (destportstr != NULL && destport != DEFAULT_HTTP_PORT) - bvputs(f, ":", destportstr, CRLF, NULL); + ap_bvputs(f, ":", destportstr, CRLF, NULL); else - bputs(CRLF, f); + ap_bputs(CRLF, f); reqhdrs_arr = table_elts(r->headers_in); reqhdrs = (table_entry *) reqhdrs_arr->elts; @@ -313,34 +313,34 @@ || !strcasecmp(reqhdrs[i].key, "Host") /* Already sent */ ||!strcasecmp(reqhdrs[i].key, "Proxy-Authorization")) continue; - bvputs(f, reqhdrs[i].key, ": ", reqhdrs[i].val, CRLF, NULL); + ap_bvputs(f, reqhdrs[i].key, ": ", reqhdrs[i].val, CRLF, NULL); } - bputs(CRLF, f); + ap_bputs(CRLF, f); /* send the request data, if any. N.B. should we trap SIGPIPE ? */ - if (should_client_block(r)) { - while ((i = get_client_block(r, buffer, HUGE_STRING_LEN)) > 0) - bwrite(f, buffer, i); + if (ap_should_client_block(r)) { + while ((i = ap_get_client_block(r, buffer, HUGE_STRING_LEN)) > 0) + ap_bwrite(f, buffer, i); } - bflush(f); - kill_timeout(r); + ap_bflush(f); + ap_kill_timeout(r); - hard_timeout("proxy receive", r); + ap_hard_timeout("proxy receive", r); - len = bgets(buffer, HUGE_STRING_LEN - 1, f); + len = ap_bgets(buffer, HUGE_STRING_LEN - 1, f); if (len == -1 || len == 0) { - bclose(f); - kill_timeout(r); - return proxyerror(r, "Error reading from remote server"); + ap_bclose(f); + ap_kill_timeout(r); + return ap_proxyerror(r, "Error reading from remote server"); } /* Is it an HTTP/1 response? This is buggy if we ever see an HTTP/1.10 */ - if (checkmask(buffer, "HTTP/#.# ###*")) { + if (ap_checkmask(buffer, "HTTP/#.# ###*")) { /* If not an HTTP/1 messsage or if the status line was > 8192 bytes */ if (buffer[5] != '1' || buffer[len - 1] != '\n') { - bclose(f); - kill_timeout(r); + ap_bclose(f); + ap_kill_timeout(r); return BAD_GATEWAY; } backasswards = 0; @@ -349,13 +349,13 @@ buffer[12] = '\0'; r->status = atoi(&buffer[9]); buffer[12] = ' '; - r->status_line = pstrdup(p, &buffer[9]); + r->status_line = ap_pstrdup(p, &buffer[9]); /* read the headers. */ /* N.B. for HTTP/1.0 clients, we have to fold line-wrapped headers */ /* Also, take care with headers with multiple occurences. */ - resp_hdrs = proxy_read_headers(p, buffer, HUGE_STRING_LEN, f); + resp_hdrs = ap_proxy_read_headers(p, buffer, HUGE_STRING_LEN, f); clear_connection((table *) resp_hdrs); /* Strip Connection hdrs */ } @@ -366,10 +366,10 @@ r->status_line = "200 OK"; /* no headers */ - resp_hdrs = make_array(p, 2, sizeof(struct hdr_entry)); + resp_hdrs = ap_make_array(p, 2, sizeof(struct hdr_entry)); } - kill_timeout(r); + ap_kill_timeout(r); /* * HTTP/1.0 requires us to accept 3 types of dates, but only generate @@ -384,7 +384,7 @@ if (strcasecmp(strp, "Date") == 0 || strcasecmp(strp, "Last-Modified") == 0 || strcasecmp(strp, "Expires") == 0) - hdr[i].value = proxy_date_canon(p, hdr[i].value); + hdr[i].value = ap_proxy_date_canon(p, hdr[i].value); if (strcasecmp(strp, "Location") == 0 || strcasecmp(strp, "URI") == 0) hdr[i].value = proxy_location_reverse_map(r, hdr[i].value); @@ -397,22 +397,22 @@ nocache = 1; } - i = proxy_cache_update(c, resp_hdrs, !backasswards, nocache); + i = ap_proxy_cache_update(c, resp_hdrs, !backasswards, nocache); if (i != DECLINED) { - bclose(f); + ap_bclose(f); return i; } cache = c->fp; - hard_timeout("proxy receive", r); + ap_hard_timeout("proxy receive", r); /* write status line */ if (!r->assbackwards) - rvputs(r, "HTTP/1.0 ", r->status_line, CRLF, NULL); + ap_rvputs(r, "HTTP/1.0 ", r->status_line, CRLF, NULL); if (cache != NULL) - if (bvputs(cache, "HTTP/1.0 ", r->status_line, CRLF, NULL) == -1) - cache = proxy_cache_error(c); + if (ap_bvputs(cache, "HTTP/1.0 ", r->status_line, CRLF, NULL) == -1) + cache = ap_proxy_cache_error(c); /* send headers */ for (i = 0; i < resp_hdrs->nelts; i++) { @@ -420,50 +420,50 @@ hdr[i].value[0] == '\0') continue; if (!r->assbackwards) { - rvputs(r, hdr[i].field, ": ", hdr[i].value, CRLF, NULL); - table_set(r->headers_out, hdr[i].field, hdr[i].value); + ap_rvputs(r, hdr[i].field, ": ", hdr[i].value, CRLF, NULL); + ap_table_set(r->headers_out, hdr[i].field, hdr[i].value); } if (cache != NULL) - if (bvputs(cache, hdr[i].field, ": ", hdr[i].value, CRLF, + if (ap_bvputs(cache, hdr[i].field, ": ", hdr[i].value, CRLF, NULL) == -1) - cache = proxy_cache_error(c); + cache = ap_proxy_cache_error(c); } if (!r->assbackwards) - rputs(CRLF, r); + ap_rputs(CRLF, r); if (cache != NULL) - if (bputs(CRLF, cache) == -1) - cache = proxy_cache_error(c); + if (ap_bputs(CRLF, cache) == -1) + cache = ap_proxy_cache_error(c); - bsetopt(r->connection->client, BO_BYTECT, &zero); + ap_bsetopt(r->connection->client, BO_BYTECT, &zero); r->sent_bodyct = 1; /* Is it an HTTP/0.9 respose? If so, send the extra data */ if (backasswards) { - bwrite(r->connection->client, buffer, len); + ap_bwrite(r->connection->client, buffer, len); if (cache != NULL) - if (bwrite(f, buffer, len) != len) - cache = proxy_cache_error(c); + if (ap_bwrite(f, buffer, len) != len) + cache = ap_proxy_cache_error(c); } - kill_timeout(r); + ap_kill_timeout(r); #ifdef CHARSET_EBCDIC /* What we read/write after the header should not be modified * (i.e., the cache copy is ASCII, not EBCDIC, even for text/html) */ - bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); - bsetflag(r->connection->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); + ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); + ap_bsetflag(r->connection->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); #endif /* send body */ /* if header only, then cache will be NULL */ /* HTTP/1.0 tells us to read to EOF, rather than content-length bytes */ if (!r->header_only) - proxy_send_fb(f, r, cache, c); + ap_proxy_send_fb(f, r, cache, c); - proxy_cache_tidy(c); + ap_proxy_cache_tidy(c); - bclose(f); + ap_bclose(f); - proxy_garbage_coll(r); + ap_proxy_garbage_coll(r); return OK; } 1.59 +87 -87 apache-1.3/src/modules/proxy/proxy_util.c Index: proxy_util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- proxy_util.c 1998/04/06 05:21:42 1.58 +++ proxy_util.c 1998/04/11 12:00:40 1.59 @@ -69,7 +69,7 @@ static int proxy_match_word(struct dirconn_entry *This, request_rec *r); /* already called in the knowledge that the characters are hex digits */ -int proxy_hex2c(const char *x) +int ap_proxy_hex2c(const char *x) { int i, ch; @@ -96,7 +96,7 @@ #endif /*CHARSET_EBCDIC*/ } -void proxy_c2hex(int ch, char *x) +void ap_proxy_c2hex(int ch, char *x) { #ifndef CHARSET_EBCDIC int i; @@ -134,7 +134,7 @@ * those which must not be touched. */ char * - proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc) + ap_proxy_canonenc(pool *p, const char *x, int len, enum enctype t, int isenc) { int i, j, ch; char *y; @@ -166,7 +166,7 @@ else reserved = ""; - y = palloc(p, 3 * len + 1); + y = ap_palloc(p, 3 * len + 1); for (i = 0, j = 0; i < len; i++, j++) { /* always handle '/' first */ @@ -179,17 +179,17 @@ if (isenc && ch == '%') { if (!isxdigit(x[i + 1]) || !isxdigit(x[i + 2])) return NULL; - ch = proxy_hex2c(&x[i + 1]); + ch = ap_proxy_hex2c(&x[i + 1]); i += 2; if (ch != 0 && strchr(reserved, ch)) { /* keep it encoded */ - proxy_c2hex(ch, &y[j]); + ap_proxy_c2hex(ch, &y[j]); j += 2; continue; } } /* recode it, if necessary */ if (!isalnum(ch) && !strchr(allowed, ch)) { - proxy_c2hex(ch, &y[j]); + ap_proxy_c2hex(ch, &y[j]); j += 2; } else @@ -210,7 +210,7 @@ * Returns an error string. */ char * - proxy_canon_netloc(pool *p, char **const urlp, char **userp, + ap_proxy_canon_netloc(pool *p, char **const urlp, char **userp, char **passwordp, char **hostp, int *port) { int i; @@ -238,12 +238,12 @@ strp = strchr(user, ':'); if (strp != NULL) { *strp = '\0'; - password = proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, 1); + password = ap_proxy_canonenc(p, strp + 1, strlen(strp + 1), enc_user, 1); if (password == NULL) return "Bad %-escape in URL (password)"; } - user = proxy_canonenc(p, user, strlen(user), enc_user, 1); + user = ap_proxy_canonenc(p, user, strlen(user), enc_user, 1); if (user == NULL) return "Bad %-escape in URL (username)"; } @@ -268,7 +268,7 @@ if (*port > 65535) return "Port number in URL > 65535"; } - str_tolower(host); /* DNS names are case-insensitive */ + ap_str_tolower(host); /* DNS names are case-insensitive */ if (*host == '\0') return "Missing host in URL"; /* check hostname syntax */ @@ -305,7 +305,7 @@ * formatted, then it exits very quickly. */ char * - proxy_date_canon(pool *p, char *x) + ap_proxy_date_canon(pool *p, char *x) { int wk, mday, year, hour, min, sec, mon; char *q, month[4], zone[4], week[4]; @@ -340,7 +340,7 @@ &min, &sec, &year) != 7) return x; for (wk = 0; wk < 7; wk++) - if (strcmp(week, day_snames[wk]) == 0) + if (strcmp(week, ap_day_snames[wk]) == 0) break; if (wk == 7) return x; @@ -348,15 +348,15 @@ /* check date */ for (mon = 0; mon < 12; mon++) - if (strcmp(month, month_snames[mon]) == 0) + if (strcmp(month, ap_month_snames[mon]) == 0) break; if (mon == 12) return x; if (strlen(x) < 30) - x = palloc(p, 30); - ap_snprintf(x, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", day_snames[wk], mday, - month_snames[mon], year, hour, min, sec); + x = ap_palloc(p, 30); + ap_snprintf(x, 30, "%s, %.2d %s %d %.2d:%.2d:%.2d GMT", ap_day_snames[wk], mday, + ap_month_snames[mon], year, hour, min, sec); return x; } @@ -365,19 +365,19 @@ * Returns NULL on file error */ array_header * - proxy_read_headers(pool *p, char *buffer, int size, BUFF *f) + ap_proxy_read_headers(pool *p, char *buffer, int size, BUFF *f) { int gotcr, len, i, j; array_header *resp_hdrs; struct hdr_entry *hdr; char *strp; - resp_hdrs = make_array(p, 10, sizeof(struct hdr_entry)); + resp_hdrs = ap_make_array(p, 10, sizeof(struct hdr_entry)); hdr = NULL; gotcr = 1; for (;;) { - len = bgets(buffer, size, f); + len = ap_bgets(buffer, size, f); if (len == -1) return NULL; if (len == 0) @@ -394,14 +394,14 @@ if (hdr == NULL) { /* error!! */ if (!i) { - i = bskiplf(f); + i = ap_bskiplf(f); if (i == -1) return NULL; } gotcr = 1; continue; } - hdr->value = pstrcat(p, hdr->value, buffer, NULL); + hdr->value = ap_pstrcat(p, hdr->value, buffer, NULL); } else if (gotcr && len == 0) break; @@ -410,7 +410,7 @@ if (strp == NULL) { /* error!! */ if (!gotcr) { - i = bskiplf(f); + i = ap_bskiplf(f); if (i == -1) return NULL; } @@ -418,12 +418,12 @@ hdr = NULL; continue; } - hdr = push_array(resp_hdrs); + hdr = ap_push_array(resp_hdrs); *(strp++) = '\0'; - hdr->field = pstrdup(p, buffer); + hdr->field = ap_pstrdup(p, buffer); while (*strp == ' ' || *strp == '\t') strp++; - hdr->value = pstrdup(p, strp); + hdr->value = ap_pstrdup(p, strp); gotcr = i; } } @@ -440,7 +440,7 @@ return resp_hdrs; } -long int proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c) +long int ap_proxy_send_fb(BUFF *f, request_rec *r, BUFF *f2, struct cache_req *c) { char buf[IOBUFSIZE]; long total_bytes_sent; @@ -451,23 +451,23 @@ #ifdef CHARSET_EBCDIC /* The cache copy is ASCII, not EBCDIC, even for text/html) */ - bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); + ap_bsetflag(f, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); if (f2 != NULL) - bsetflag(f2, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); - bsetflag(con->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); + ap_bsetflag(f2, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); + ap_bsetflag(con->client, B_ASCII2EBCDIC|B_EBCDIC2ASCII, 0); #endif /* Since we are reading from one buffer and writing to another, * it is unsafe to do a soft_timeout here, at least until the proxy * has its own timeout handler which can set both buffers to EOUT. */ - hard_timeout("proxy send body", r); + ap_hard_timeout("proxy send body", r); while (!con->aborted && f != NULL) { - n = bread(f, buf, IOBUFSIZE); + n = ap_bread(f, buf, IOBUFSIZE); if (n == -1) { /* input error */ if (f2 != NULL) - f2 = proxy_cache_error(c); + f2 = ap_proxy_cache_error(c); break; } if (n == 0) @@ -476,14 +476,14 @@ total_bytes_sent += n; if (f2 != NULL) - if (bwrite(f2, buf, n) != n) - f2 = proxy_cache_error(c); + if (ap_bwrite(f2, buf, n) != n) + f2 = ap_proxy_cache_error(c); while (n && !con->aborted) { - w = bwrite(con->client, &buf[o], n); + w = ap_bwrite(con->client, &buf[o], n); if (w <= 0) { if (f2 != NULL) { - pclosef(c->req->pool, c->fp->fd); + ap_pclosef(c->req->pool, c->fp->fd); c->fp = NULL; f2 = NULL; con->aborted = 1; @@ -491,15 +491,15 @@ } break; } - reset_timeout(r); /* reset timeout after successful write */ + ap_reset_timeout(r); /* reset timeout after successful write */ n -= w; o += w; } } if (!con->aborted) - bflush(con->client); + ap_bflush(con->client); - kill_timeout(r); + ap_kill_timeout(r); return total_bytes_sent; } @@ -507,7 +507,7 @@ * Read a header from the array, returning the first entry */ struct hdr_entry * - proxy_get_header(array_header *hdrs_arr, const char *name) + ap_proxy_get_header(array_header *hdrs_arr, const char *name) { struct hdr_entry *hdrs; int i; @@ -526,7 +526,7 @@ * is not subsequently overwritten */ struct hdr_entry * - proxy_add_header(array_header *hdrs_arr, char *field, char *value, + ap_proxy_add_header(array_header *hdrs_arr, char *field, char *value, int rep) { int i; @@ -540,14 +540,14 @@ return hdrs; } - hdrs = push_array(hdrs_arr); + hdrs = ap_push_array(hdrs_arr); hdrs->field = field; hdrs->value = value; return hdrs; } -void proxy_del_header(array_header *hdrs_arr, const char *field) +void ap_proxy_del_header(array_header *hdrs_arr, const char *field) { int i; struct hdr_entry *hdrs; @@ -566,7 +566,7 @@ * * A timeout should be set before calling this routine. */ -void proxy_send_headers(request_rec *r, const char *respline, array_header *hdrs_arr) +void ap_proxy_send_headers(request_rec *r, const char *respline, array_header *hdrs_arr) { struct hdr_entry *hdrs; int i; @@ -574,16 +574,16 @@ hdrs = (struct hdr_entry *) hdrs_arr->elts; - bputs(respline, fp); - bputs(CRLF, fp); + ap_bputs(respline, fp); + ap_bputs(CRLF, fp); for (i = 0; i < hdrs_arr->nelts; i++) { if (hdrs[i].field == NULL) continue; - bvputs(fp, hdrs[i].field, ": ", hdrs[i].value, CRLF, NULL); - table_set(r->headers_out, hdrs[i].field, hdrs[i].value); + ap_bvputs(fp, hdrs[i].field, ": ", hdrs[i].value, CRLF, NULL); + ap_table_set(r->headers_out, hdrs[i].field, hdrs[i].value); } - bputs(CRLF, fp); + ap_bputs(CRLF, fp); } @@ -593,7 +593,7 @@ * The return returns 1 if the token val is found in the list, or 0 * otherwise. */ -int proxy_liststr(const char *list, const char *val) +int ap_proxy_liststr(const char *list, const char *val) { int len, i; const char *p; @@ -626,7 +626,7 @@ * On NT, the file system is NOT case sensitive. So, a == A * need to map to smaller set of characters */ -void proxy_hash(const char *it, char *val, int ndepth, int nlength) +void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength) { AP_MD5_CTX context; unsigned char digest[16]; @@ -635,9 +635,9 @@ unsigned int x; static const char enc_table[32] = "abcdefghijklmnopqrstuvwxyz012345"; - MD5Init(&context); - MD5Update(&context, (const unsigned char *) it, strlen(it)); - MD5Final(digest, &context); + ap_MD5Init(&context); + ap_MD5Update(&context, (const unsigned char *) it, strlen(it)); + ap_MD5Final(digest, &context); /* encode 128 bits as 26 characters, using a modified uuencoding */ /* the encoding is 5 bytes -> 8 characters @@ -673,7 +673,7 @@ #else -void proxy_hash(const char *it, char *val, int ndepth, int nlength) +void ap_proxy_hash(const char *it, char *val, int ndepth, int nlength) { AP_MD5_CTX context; unsigned char digest[16]; @@ -690,9 +690,9 @@ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_@"; #endif - MD5Init(&context); - MD5Update(&context, (const unsigned char *) it, strlen(it)); - MD5Final(digest, &context); + ap_MD5Init(&context); + ap_MD5Update(&context, (const unsigned char *) it, strlen(it)); + ap_MD5Final(digest, &context); /* encode 128 bits as 22 characters, using a modified uuencoding */ /* the encoding is 3 bytes -> 4 characters @@ -726,7 +726,7 @@ /* * Converts 8 hex digits to a time integer */ -int proxy_hex2sec(const char *x) +int ap_proxy_hex2sec(const char *x) { int i, ch; unsigned int j; @@ -750,7 +750,7 @@ /* * Converts a time integer to 8 hex digits */ -void proxy_sec2hex(int t, char *y) +void ap_proxy_sec2hex(int t, char *y) { int i, ch; unsigned int j = t; @@ -766,12 +766,12 @@ y[8] = '\0'; } -void proxy_log_uerror(const char *routine, const char *file, const char *err, +void ap_proxy_log_uerror(const char *routine, const char *file, const char *err, server_rec *s) { char *p, *q; - q = get_time(); + q = ap_get_time(); p = strerror(errno); if (err != NULL) { @@ -792,35 +792,35 @@ } BUFF * - proxy_cache_error(struct cache_req *c) + ap_proxy_cache_error(struct cache_req *c) { - proxy_log_uerror("write", c->tempfile, "proxy: error writing to cache file", + ap_proxy_log_uerror("write", c->tempfile, "proxy: error writing to cache file", c->req->server); - pclosef(c->req->pool, c->fp->fd); + ap_pclosef(c->req->pool, c->fp->fd); c->fp = NULL; unlink(c->tempfile); return NULL; } -int proxyerror(request_rec *r, const char *message) +int ap_proxyerror(request_rec *r, const char *message) { r->status = SERVER_ERROR; r->status_line = "500 Proxy Error"; r->content_type = "text/html"; - send_http_header(r); - soft_timeout("proxy error", r); + ap_send_http_header(r); + ap_soft_timeout("proxy error", r); - rvputs(r, "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" + ap_rvputs(r, "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" "<html><head><title>Proxy Error</title><head>\n<body>" "<h1>Proxy Error</h1>\n" "The proxy server could not handle this request.\n<p>\n" "Reason: <b>", message, "</b>\n", - psignature("<HR>\n", r), + ap_psignature("<HR>\n", r), "</body><html>\n", NULL); - kill_timeout(r); + ap_kill_timeout(r); return OK; } @@ -828,7 +828,7 @@ * This routine returns its own error message */ const char * - proxy_host2addr(const char *host, struct hostent *reqhp) + ap_proxy_host2addr(const char *host, struct hostent *reqhp) { int i; struct hostent *hp; @@ -877,12 +877,12 @@ || url[1] != '/' || url[2] != '/') return NULL; - url = pstrdup(r->pool, &url[1]); /* make it point to "//", which is what proxy_canon_netloc expects */ + url = ap_pstrdup(r->pool, &url[1]); /* make it point to "//", which is what proxy_canon_netloc expects */ - err = proxy_canon_netloc(r->pool, &url, &user, &password, &host, &port); + err = ap_proxy_canon_netloc(r->pool, &url, &user, &password, &host, &port); if (err != NULL) - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, err); + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_NOERRNO, r->server, err); r->hostname = host; @@ -890,7 +890,7 @@ } /* Return TRUE if addr represents an IP address (or an IP network address) */ -int proxy_is_ipaddr(struct dirconn_entry *This, pool *p) +int ap_proxy_is_ipaddr(struct dirconn_entry *This, pool *p) { const char *addr = This->name; long ip_addr[4]; @@ -1032,7 +1032,7 @@ struct hostent the_host; memset(&the_host, '\0', sizeof the_host); - found = proxy_host2addr(host, &the_host); + found = ap_proxy_host2addr(host, &the_host); if (found != NULL) { #if DEBUGGING @@ -1071,7 +1071,7 @@ } /* Return TRUE if addr represents a domain name */ -int proxy_is_domainname(struct dirconn_entry *This, pool *p) +int ap_proxy_is_domainname(struct dirconn_entry *This, pool *p) { char *addr = This->name; int i; @@ -1124,7 +1124,7 @@ } /* Return TRUE if addr represents a host name */ -int proxy_is_hostname(struct dirconn_entry *This, pool *p) +int ap_proxy_is_hostname(struct dirconn_entry *This, pool *p) { struct hostent host; char *addr = This->name; @@ -1144,10 +1144,10 @@ } #endif - if (addr[i] != '\0' || proxy_host2addr(addr, &host) != NULL) + if (addr[i] != '\0' || ap_proxy_host2addr(addr, &host) != NULL) return 0; - This->hostentry = pduphostent (p, &host); + This->hostentry = ap_pduphostent (p, &host); /* Strip trailing dots */ for (i = strlen(addr) - 1; i > 0 && addr[i] == '.'; --i) @@ -1190,7 +1190,7 @@ } /* Return TRUE if addr is to be matched as a word */ -int proxy_is_word(struct dirconn_entry *This, pool *p) +int ap_proxy_is_word(struct dirconn_entry *This, pool *p) { This->matcher = proxy_match_word; return 1; @@ -1203,11 +1203,11 @@ return host != NULL && strstr(host, This->name) != NULL; } -int proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r) +int ap_proxy_doconnect(int sock, struct sockaddr_in *addr, request_rec *r) { int i; - hard_timeout("proxy connect", r); + ap_hard_timeout("proxy connect", r); do { i = connect(sock, (struct sockaddr *) addr, sizeof(struct sockaddr_in)); #ifdef WIN32 @@ -1220,9 +1220,9 @@ ap_snprintf(details, sizeof(details), "%s port %d", inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); - proxy_log_uerror("connect", details, NULL, r->server); + ap_proxy_log_uerror("connect", details, NULL, r->server); } - kill_timeout(r); + ap_kill_timeout(r); return i; } 1.34 +9 -9 apache-1.3/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_access.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mod_access.c 1998/03/31 12:53:05 1.33 +++ mod_access.c 1998/04/11 12:00:43 1.34 @@ -104,13 +104,13 @@ static void *create_access_dir_config(pool *p, char *dummy) { access_dir_conf *conf = - (access_dir_conf *) pcalloc(p, sizeof(access_dir_conf)); + (access_dir_conf *) ap_pcalloc(p, sizeof(access_dir_conf)); int i; for (i = 0; i < METHODS; ++i) conf->order[i] = DENY_THEN_ALLOW; - conf->allows = make_array(p, 1, sizeof(allowdeny)); - conf->denys = make_array(p, 1, sizeof(allowdeny)); + conf->allows = ap_make_array(p, 1, sizeof(allowdeny)); + conf->denys = ap_make_array(p, 1, sizeof(allowdeny)); return (void *) conf; } @@ -152,7 +152,7 @@ if (strcasecmp(from, "from")) return "allow and deny must be followed by 'from'"; - a = (allowdeny *) push_array(cmd->info ? d->allows : d->denys); + a = (allowdeny *) ap_push_array(cmd->info ? d->allows : d->denys); a->x.from = where; a->limited = cmd->limited; @@ -305,7 +305,7 @@ switch (ap[i].type) { case T_ENV: - if (table_get(r->subprocess_env, ap[i].x.from)) { + if (ap_table_get(r->subprocess_env, ap[i].x.from)) { return 1; } break; @@ -323,7 +323,7 @@ case T_HOST: if (!gothost) { - remotehost = get_remote_host(r->connection, r->per_dir_config, + remotehost = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_DOUBLE_REV); if ((remotehost == NULL) || is_ip(remotehost)) @@ -350,7 +350,7 @@ int method = r->method_number; access_dir_conf *a = (access_dir_conf *) - get_module_config(r->per_dir_config, &access_module); + ap_get_module_config(r->per_dir_config, &access_module); int ret = OK; if (a->order[method] == ALLOW_THEN_DENY) { @@ -375,8 +375,8 @@ } if (ret == FORBIDDEN - && (satisfies(r) != SATISFY_ANY || !some_auth_required(r))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + && (ap_satisfies(r) != SATISFY_ANY || !ap_some_auth_required(r))) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Client denied by server configuration: %s", r->filename); } 1.26 +10 -10 apache-1.3/src/modules/standard/mod_actions.c Index: mod_actions.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_actions.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mod_actions.c 1998/03/31 12:53:06 1.25 +++ mod_actions.c 1998/04/11 12:00:43 1.26 @@ -93,9 +93,9 @@ static void *create_action_dir_config(pool *p, char *dummy) { action_dir_config *new = - (action_dir_config *) palloc(p, sizeof(action_dir_config)); + (action_dir_config *) ap_palloc(p, sizeof(action_dir_config)); - new->action_types = make_table(p, 4); + new->action_types = ap_make_table(p, 4); new->get = NULL; new->post = NULL; new->put = NULL; @@ -109,9 +109,9 @@ action_dir_config *base = (action_dir_config *) basev; action_dir_config *add = (action_dir_config *) addv; action_dir_config *new = - (action_dir_config *) palloc(p, sizeof(action_dir_config)); + (action_dir_config *) ap_palloc(p, sizeof(action_dir_config)); - new->action_types = overlay_tables(p, add->action_types, + new->action_types = ap_overlay_tables(p, add->action_types, base->action_types); new->get = add->get ? add->get : base->get; @@ -125,7 +125,7 @@ static const char *add_action(cmd_parms *cmd, action_dir_config * m, char *type, char *script) { - table_setn(m->action_types, type, script); + ap_table_setn(m->action_types, type, script); return NULL; } @@ -158,7 +158,7 @@ static int action_handler(request_rec *r) { action_dir_config *conf = - (action_dir_config *) get_module_config(r->per_dir_config, &action_module); + (action_dir_config *) ap_get_module_config(r->per_dir_config, &action_module); char *t, *action = r->handler ? r->handler : r->content_type; char *script = NULL; @@ -187,11 +187,11 @@ return DECLINED; /* Second, check for actions (which override the method scripts) */ - if ((t = table_get(conf->action_types, - action ? action : default_type(r)))) { + if ((t = ap_table_get(conf->action_types, + action ? action : ap_default_type(r)))) { script = t; if (r->finfo.st_mode == 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "File does not exist: %s", r->filename); return NOT_FOUND; } @@ -200,7 +200,7 @@ if (script == NULL) return DECLINED; - internal_redirect_handler(pstrcat(r->pool, script, escape_uri(r->pool, + ap_internal_redirect_handler(ap_pstrcat(r->pool, script, escape_uri(r->pool, r->uri), r->args ? "?" : NULL, r->args, NULL), r); return OK; } 1.34 +29 -29 apache-1.3/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_alias.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mod_alias.c 1998/03/31 12:53:06 1.33 +++ mod_alias.c 1998/04/11 12:00:43 1.34 @@ -88,38 +88,38 @@ static void *create_alias_config(pool *p, server_rec *s) { alias_server_conf *a = - (alias_server_conf *) pcalloc(p, sizeof(alias_server_conf)); + (alias_server_conf *) ap_pcalloc(p, sizeof(alias_server_conf)); - a->aliases = make_array(p, 20, sizeof(alias_entry)); - a->redirects = make_array(p, 20, sizeof(alias_entry)); + a->aliases = ap_make_array(p, 20, sizeof(alias_entry)); + a->redirects = ap_make_array(p, 20, sizeof(alias_entry)); return a; } static void *create_alias_dir_config(pool *p, char *d) { alias_dir_conf *a = - (alias_dir_conf *) pcalloc(p, sizeof(alias_dir_conf)); - a->redirects = make_array(p, 2, sizeof(alias_entry)); + (alias_dir_conf *) ap_pcalloc(p, sizeof(alias_dir_conf)); + a->redirects = ap_make_array(p, 2, sizeof(alias_entry)); return a; } static void *merge_alias_config(pool *p, void *basev, void *overridesv) { alias_server_conf *a = - (alias_server_conf *) pcalloc(p, sizeof(alias_server_conf)); + (alias_server_conf *) ap_pcalloc(p, sizeof(alias_server_conf)); alias_server_conf *base = (alias_server_conf *) basev, *overrides = (alias_server_conf *) overridesv; - a->aliases = append_arrays(p, overrides->aliases, base->aliases); - a->redirects = append_arrays(p, overrides->redirects, base->redirects); + a->aliases = ap_append_arrays(p, overrides->aliases, base->aliases); + a->redirects = ap_append_arrays(p, overrides->redirects, base->redirects); return a; } static void *merge_alias_dir_config(pool *p, void *basev, void *overridesv) { alias_dir_conf *a = - (alias_dir_conf *) pcalloc(p, sizeof(alias_dir_conf)); + (alias_dir_conf *) ap_pcalloc(p, sizeof(alias_dir_conf)); alias_dir_conf *base = (alias_dir_conf *) basev, *overrides = (alias_dir_conf *) overridesv; - a->redirects = append_arrays(p, overrides->redirects, base->redirects); + a->redirects = ap_append_arrays(p, overrides->redirects, base->redirects); return a; } @@ -128,13 +128,13 @@ { server_rec *s = cmd->server; alias_server_conf *conf = - (alias_server_conf *) get_module_config(s->module_config, &alias_module); - alias_entry *new = push_array(conf->aliases); + (alias_server_conf *) ap_get_module_config(s->module_config, &alias_module); + alias_entry *new = ap_push_array(conf->aliases); /* XX r can NOT be relative to DocumentRoot here... compat bug. */ if (use_regex) { - new->regexp = pregcomp(cmd->pool, f, REG_EXTENDED); + new->regexp = ap_pregcomp(cmd->pool, f, REG_EXTENDED); if (new->regexp == NULL) return "Regular expression could not be compiled."; } @@ -163,7 +163,7 @@ alias_entry *new; server_rec *s = cmd->server; alias_server_conf *serverconf = - (alias_server_conf *) get_module_config(s->module_config, &alias_module); + (alias_server_conf *) ap_get_module_config(s->module_config, &alias_module); int status = (int) (long) cmd->info; regex_t *r = NULL; char *f = arg2; @@ -185,7 +185,7 @@ } if (use_regex) { - r = pregcomp(cmd->pool, f, REG_EXTENDED); + r = ap_pregcomp(cmd->pool, f, REG_EXTENDED); if (r == NULL) return "Regular expression could not be compiled."; } @@ -193,7 +193,7 @@ if (is_HTTP_REDIRECT(status)) { if (!url) return "URL to redirect to is missing"; - if (!use_regex && !is_url(url)) + if (!use_regex && !ap_is_url(url)) return "Redirect to non-URL"; } else { @@ -202,9 +202,9 @@ } if (cmd->path) - new = push_array(dirconf->redirects); + new = ap_push_array(dirconf->redirects); else - new = push_array(serverconf->redirects); + new = ap_push_array(serverconf->redirects); new->fake = f; new->real = url; @@ -302,7 +302,7 @@ if (p->regexp) { if (!regexec(p->regexp, r->uri, p->regexp->re_nsub + 1, regm, 0)) { if (p->real) { - found = pregsub(r->pool, p->real, r->uri, + found = ap_pregsub(r->pool, p->real, r->uri, p->regexp->re_nsub + 1, regm); if (found && doesc) { found = escape_uri(r->pool, found); @@ -310,7 +310,7 @@ } else { /* need something non-null */ - found = pstrdup(r->pool, ""); + found = ap_pstrdup(r->pool, ""); } } } @@ -320,19 +320,19 @@ if (l > 0) { if (doesc) { char *escurl; - escurl = os_escape_path(r->pool, r->uri + l, 1); + escurl = ap_escape_path(r->pool, r->uri + l, 1); - found = pstrcat(r->pool, p->real, escurl, NULL); + found = ap_pstrcat(r->pool, p->real, escurl, NULL); } else - found = pstrcat(r->pool, p->real, r->uri + l, NULL); + found = ap_pstrcat(r->pool, p->real, r->uri + l, NULL); } } if (found) { if (p->handler) { /* Set handler, and leave a note for mod_cgi */ r->handler = p->handler; - table_setn(r->notes, "alias-forced-type", r->handler); + ap_table_setn(r->notes, "alias-forced-type", r->handler); } *status = p->redir_status; @@ -349,7 +349,7 @@ { void *sconf = r->server->module_config; alias_server_conf *serverconf = - (alias_server_conf *) get_module_config(sconf, &alias_module); + (alias_server_conf *) ap_get_module_config(sconf, &alias_module); char *ret; int status; @@ -365,9 +365,9 @@ if (is_HTTP_REDIRECT(status)) { /* include QUERY_STRING if any */ if (r->args) { - ret = pstrcat(r->pool, ret, "?", r->args, NULL); + ret = ap_pstrcat(r->pool, ret, "?", r->args, NULL); } - table_setn(r->headers_out, "Location", ret); + ap_table_setn(r->headers_out, "Location", ret); } return status; } @@ -384,7 +384,7 @@ { void *dconf = r->per_dir_config; alias_dir_conf *dirconf = - (alias_dir_conf *) get_module_config(dconf, &alias_module); + (alias_dir_conf *) ap_get_module_config(dconf, &alias_module); char *ret; int status; @@ -392,7 +392,7 @@ if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL) { if (is_HTTP_REDIRECT(status)) - table_setn(r->headers_out, "Location", ret); + ap_table_setn(r->headers_out, "Location", ret); return status; } 1.27 +10 -10 apache-1.3/src/modules/standard/mod_asis.c Index: mod_asis.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_asis.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_asis.c 1998/03/31 12:53:07 1.26 +++ mod_asis.c 1998/04/11 12:00:43 1.27 @@ -72,26 +72,26 @@ if (r->method_number != M_GET) return DECLINED; if (r->finfo.st_mode == 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "File does not exist: %s", r->filename); return NOT_FOUND; } - f = pfopen(r->pool, r->filename, "r"); + f = ap_pfopen(r->pool, r->filename, "r"); if (f == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "file permissions deny server access: %s", r->filename); return FORBIDDEN; } scan_script_header(r, f); - location = table_get(r->headers_out, "Location"); + location = ap_table_get(r->headers_out, "Location"); if (location && location[0] == '/' && ((r->status == HTTP_OK) || is_HTTP_REDIRECT(r->status))) { - pfclose(r->pool, f); + ap_pfclose(r->pool, f); /* Internal redirect -- fake-up a pseudo-request */ r->status = HTTP_OK; @@ -99,18 +99,18 @@ /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = pstrdup(r->pool, "GET"); + r->method = ap_pstrdup(r->pool, "GET"); r->method_number = M_GET; - internal_redirect_handler(location, r); + ap_internal_redirect_handler(location, r); return OK; } - send_http_header(r); + ap_send_http_header(r); if (!r->header_only) - send_fd(f, r); + ap_send_fd(f, r); - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return OK; } 1.35 +34 -34 apache-1.3/src/modules/standard/mod_auth.c Index: mod_auth.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- mod_auth.c 1998/03/31 12:53:07 1.34 +++ mod_auth.c 1998/04/11 12:00:44 1.35 @@ -87,7 +87,7 @@ static void *create_auth_dir_config(pool *p, char *d) { auth_config_rec *sec = - (auth_config_rec *) pcalloc(p, sizeof(auth_config_rec)); + (auth_config_rec *) ap_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 */ @@ -97,9 +97,9 @@ static const char *set_auth_slot(cmd_parms *cmd, void *offset, char *f, char *t) { if (t && strcmp(t, "standard")) - return pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); + return ap_pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); - return set_file_slot(cmd, offset, f); + return ap_set_file_slot(cmd, offset, f); } static const command_rec auth_cmds[] = @@ -110,7 +110,7 @@ {"AuthGroupFile", set_auth_slot, (void *) XtOffsetOf(auth_config_rec, auth_grpfile), OR_AUTHCFG, TAKE12, "text file containing group names and member user IDs"}, - {"AuthAuthoritative", set_flag_slot, + {"AuthAuthoritative", ap_set_flag_slot, (void *) XtOffsetOf(auth_config_rec, auth_authoritative), OR_AUTHCFG, FLAG, "Set to 'no' to allow access control to be passed along to lower modules if the UserID is not known to this module"}, @@ -125,60 +125,60 @@ char l[MAX_STRING_LEN]; const char *rpw, *w; - if (!(f = pcfg_openfile(r->pool, auth_pwfile))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + if (!(f = ap_pcfg_openfile(r->pool, auth_pwfile))) { + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "Could not open password file: %s", auth_pwfile); return NULL; } - while (!(cfg_getline(l, MAX_STRING_LEN, f))) { + while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { if ((l[0] == '#') || (!l[0])) continue; rpw = l; - w = getword(r->pool, &rpw, ':'); + w = ap_getword(r->pool, &rpw, ':'); if (!strcmp(user, w)) { - cfg_closefile(f); - return getword(r->pool, &rpw, ':'); + ap_cfg_closefile(f); + return ap_getword(r->pool, &rpw, ':'); } } - cfg_closefile(f); + ap_cfg_closefile(f); return NULL; } static table *groups_for_user(pool *p, char *user, char *grpfile) { configfile_t *f; - table *grps = make_table(p, 15); + table *grps = ap_make_table(p, 15); pool *sp; char l[MAX_STRING_LEN]; const char *group_name, *ll, *w; - if (!(f = pcfg_openfile(p, grpfile))) { + if (!(f = ap_pcfg_openfile(p, grpfile))) { /*add? aplog_error(APLOG_MARK, APLOG_ERR, NULL, "Could not open group file: %s", grpfile);*/ return NULL; } - sp = make_sub_pool(p); + sp = ap_make_sub_pool(p); - while (!(cfg_getline(l, MAX_STRING_LEN, f))) { + while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { if ((l[0] == '#') || (!l[0])) continue; ll = l; - clear_pool(sp); + ap_clear_pool(sp); - group_name = getword(sp, &ll, ':'); + group_name = ap_getword(sp, &ll, ':'); while (ll[0]) { - w = getword_conf(sp, &ll); + w = ap_getword_conf(sp, &ll); if (!strcmp(w, user)) { - table_setn(grps, pstrdup(p, group_name), "in"); + ap_table_setn(grps, ap_pstrdup(p, group_name), "in"); break; } } } - cfg_closefile(f); - destroy_pool(sp); + ap_cfg_closefile(f); + ap_destroy_pool(sp); return grps; } @@ -199,12 +199,12 @@ static int authenticate_basic_user(request_rec *r) { auth_config_rec *sec = - (auth_config_rec *) get_module_config(r->per_dir_config, &auth_module); + (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module); conn_rec *c = r->connection; char *sent_pw, *real_pw; int res; - if ((res = get_basic_auth_pw(r, &sent_pw))) + if ((res = ap_get_basic_auth_pw(r, &sent_pw))) return res; if (!sec->auth_pwfile) @@ -213,16 +213,16 @@ if (!(real_pw = get_pw(r, c->user, sec->auth_pwfile))) { if (!(sec->auth_authoritative)) return DECLINED; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not found: %s", c->user, r->uri); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } /* anyone know where the prototype for crypt is? */ if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s: password mismatch: %s", c->user, r->uri); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } return OK; @@ -233,14 +233,14 @@ static int check_user_access(request_rec *r) { auth_config_rec *sec = - (auth_config_rec *) get_module_config(r->per_dir_config, &auth_module); + (auth_config_rec *) ap_get_module_config(r->per_dir_config, &auth_module); char *user = r->connection->user; int m = r->method_number; int method_restricted = 0; register int x; const char *t, *w; table *grpstatus; - array_header *reqs_arr = requires(r); + array_header *reqs_arr = ap_requires(r); require_line *reqs; /* BUG FIX: tadc, 11-Nov-1995. If there is no "requires" directive, @@ -263,12 +263,12 @@ method_restricted = 1; t = reqs[x].requirement; - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); if (!strcmp(w, "valid-user")) return OK; if (!strcmp(w, "user")) { while (t[0]) { - w = getword_conf(r->pool, &t); + w = ap_getword_conf(r->pool, &t); if (!strcmp(user, w)) return OK; } @@ -278,8 +278,8 @@ return DECLINED; /* DBM group? Something else? */ while (t[0]) { - w = getword_conf(r->pool, &t); - if (table_get(grpstatus, w)) + w = ap_getword_conf(r->pool, &t); + if (ap_table_get(grpstatus, w)) return OK; } } @@ -291,7 +291,7 @@ if (!(sec->auth_authoritative)) return DECLINED; - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } 1.33 +8 -8 apache-1.3/src/modules/standard/mod_auth_anon.c Index: mod_auth_anon.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_anon.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- mod_auth_anon.c 1998/03/31 12:53:07 1.32 +++ mod_auth_anon.c 1998/04/11 12:00:44 1.33 @@ -119,7 +119,7 @@ static void *create_anon_auth_dir_config(pool *p, char *d) { anon_auth_config_rec *sec = (anon_auth_config_rec *) - pcalloc(p, sizeof(anon_auth_config_rec)); + ap_pcalloc(p, sizeof(anon_auth_config_rec)); if (!sec) return NULL; /* no memory... */ @@ -180,7 +180,7 @@ first = sec->auth_anon_passwords; if ( - (!(sec->auth_anon_passwords = (auth_anon *) palloc(cmd->pool, sizeof(auth_anon)))) || + (!(sec->auth_anon_passwords = (auth_anon *) ap_palloc(cmd->pool, sizeof(auth_anon)))) || (!(sec->auth_anon_passwords->password = arg)) ) return "Failed to claim memory for an anonymous password..."; @@ -214,13 +214,13 @@ static int anon_authenticate_basic_user(request_rec *r) { anon_auth_config_rec *sec = - (anon_auth_config_rec *) get_module_config(r->per_dir_config, + (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config, &anon_auth_module); conn_rec *c = r->connection; char *send_pw; int res = DECLINED; - if ((res = get_basic_auth_pw(r, &send_pw))) + if ((res = ap_get_basic_auth_pw(r, &send_pw))) return res; /* Ignore if we are not configured */ @@ -251,8 +251,8 @@ && ((!sec->auth_anon_verifyemail) || ((strpbrk("@", send_pw) != NULL) && (strpbrk(".", send_pw) != NULL)))) { - if (sec->auth_anon_logemail && is_initial_req(r)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r->server, + if (sec->auth_anon_logemail && ap_is_initial_req(r)) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, r->server, "Anonymous: Passwd <%s> Accepted", send_pw ? send_pw : "\'none\'"); } @@ -260,7 +260,7 @@ } else { if (sec->auth_anon_authoritative) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Anonymous: Authoritative, Passwd <%s> not accepted", send_pw ? send_pw : "\'none\'"); return AUTH_REQUIRED; @@ -276,7 +276,7 @@ #ifdef NOTYET conn_rec *c = r->connection; anon_auth_config_rec *sec = - (anon_auth_config_rec *) get_module_config(r->per_dir_config, + (anon_auth_config_rec *) ap_get_module_config(r->per_dir_config, &anon_auth_module); if (!sec->auth_anon) 1.30 +22 -22 apache-1.3/src/modules/standard/mod_auth_db.c Index: mod_auth_db.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_db.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- mod_auth_db.c 1998/03/31 12:53:08 1.29 +++ mod_auth_db.c 1998/04/11 12:00:44 1.30 @@ -107,7 +107,7 @@ static void *create_db_auth_dir_config(pool *p, char *d) { db_auth_config_rec *sec - = (db_auth_config_rec *) pcalloc(p, sizeof(db_auth_config_rec)); + = (db_auth_config_rec *) ap_pcalloc(p, sizeof(db_auth_config_rec)); sec->auth_dbpwfile = NULL; sec->auth_dbgrpfile = NULL; sec->auth_dbauthoritative = 1; /* fortress is secure by default */ @@ -119,15 +119,15 @@ if (!t || strcmp(t, "db")) return DECLINE_CMD; - return set_file_slot(cmd, offset, f); + return ap_set_file_slot(cmd, offset, f); } static const command_rec db_auth_cmds[] = { - {"AuthDBUserFile", set_file_slot, + {"AuthDBUserFile", ap_set_file_slot, (void *) XtOffsetOf(db_auth_config_rec, auth_dbpwfile), OR_AUTHCFG, TAKE1, NULL}, - {"AuthDBGroupFile", set_file_slot, + {"AuthDBGroupFile", ap_set_file_slot, (void *) XtOffsetOf(db_auth_config_rec, auth_dbgrpfile), OR_AUTHCFG, TAKE1, NULL}, {"AuthUserFile", set_db_slot, @@ -136,7 +136,7 @@ {"AuthGroupFile", set_db_slot, (void *) XtOffsetOf(db_auth_config_rec, auth_dbgrpfile), OR_AUTHCFG, TAKE12, NULL}, - {"AuthDBAuthoritative", set_flag_slot, + {"AuthDBAuthoritative", ap_set_flag_slot, (void *) XtOffsetOf(db_auth_config_rec, auth_dbauthoritative), OR_AUTHCFG, FLAG, "Set to 'no' to allow access control to be passed along to lower modules if the userID is not known to this module"}, @@ -155,13 +155,13 @@ q.size = strlen(q.data); if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "could not open db auth file: %s", auth_dbpwfile); return NULL; } if (!((f->get) (f, &q, &d, 0))) { - pw = palloc(r->pool, d.size + 1); + pw = ap_palloc(r->pool, d.size + 1); strncpy(pw, d.data, d.size); pw[d.size] = '\0'; /* Terminate the string */ } @@ -202,13 +202,13 @@ static int db_authenticate_basic_user(request_rec *r) { db_auth_config_rec *sec = - (db_auth_config_rec *) get_module_config(r->per_dir_config, + (db_auth_config_rec *) ap_get_module_config(r->per_dir_config, &db_auth_module); conn_rec *c = r->connection; char *sent_pw, *real_pw, *colon_pw; int res; - if ((res = get_basic_auth_pw(r, &sent_pw))) + if ((res = ap_get_basic_auth_pw(r, &sent_pw))) return res; if (!sec->auth_dbpwfile) @@ -217,9 +217,9 @@ if (!(real_pw = get_db_pw(r, c->user, sec->auth_dbpwfile))) { if (!(sec->auth_dbauthoritative)) return DECLINED; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "DB user %s not found: %s", c->user, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } /* Password is up to first : if exists */ @@ -228,9 +228,9 @@ *colon_pw = '\0'; /* anyone know where the prototype for crypt is? */ if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "DB user %s: password mismatch: %s", c->user, r->uri); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } return OK; @@ -241,12 +241,12 @@ static int db_check_auth(request_rec *r) { db_auth_config_rec *sec = - (db_auth_config_rec *) get_module_config(r->per_dir_config, + (db_auth_config_rec *) ap_get_module_config(r->per_dir_config, &db_auth_module); char *user = r->connection->user; int m = r->method_number; - array_header *reqs_arr = requires(r); + array_header *reqs_arr = ap_requires(r); require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL; register int x; @@ -264,7 +264,7 @@ continue; t = reqs[x].requirement; - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); if (!strcmp(w, "group") && sec->auth_dbgrpfile) { const char *orig_groups, *groups; @@ -273,25 +273,25 @@ if (!(groups = get_db_grp(r, user, sec->auth_dbgrpfile))) { if (!(sec->auth_dbauthoritative)) return DECLINED; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not in DB group file %s: %s", user, sec->auth_dbgrpfile, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } orig_groups = groups; while (t[0]) { - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); groups = orig_groups; while (groups[0]) { - v = getword(r->pool, &groups, ','); + v = ap_getword(r->pool, &groups, ','); if (!strcmp(v, w)) return OK; } } - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not in right group: %s", user, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } } 1.37 +22 -22 apache-1.3/src/modules/standard/mod_auth_dbm.c Index: mod_auth_dbm.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_auth_dbm.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- mod_auth_dbm.c 1998/03/31 12:53:08 1.36 +++ mod_auth_dbm.c 1998/04/11 12:00:44 1.37 @@ -100,7 +100,7 @@ static void *create_dbm_auth_dir_config(pool *p, char *d) { dbm_auth_config_rec *sec - = (dbm_auth_config_rec *) pcalloc(p, sizeof(dbm_auth_config_rec)); + = (dbm_auth_config_rec *) ap_pcalloc(p, sizeof(dbm_auth_config_rec)); sec->auth_dbmpwfile = NULL; sec->auth_dbmgrpfile = NULL; @@ -114,15 +114,15 @@ if (!t || strcmp(t, "dbm")) return DECLINE_CMD; - return set_file_slot(cmd, offset, f); + return ap_set_file_slot(cmd, offset, f); } static const command_rec dbm_auth_cmds[] = { - {"AuthDBMUserFile", set_file_slot, + {"AuthDBMUserFile", ap_set_file_slot, (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmpwfile), OR_AUTHCFG, TAKE1, NULL}, - {"AuthDBMGroupFile", set_file_slot, + {"AuthDBMGroupFile", ap_set_file_slot, (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile), OR_AUTHCFG, TAKE1, NULL}, {"AuthUserFile", set_dbm_slot, @@ -131,7 +131,7 @@ {"AuthGroupFile", set_dbm_slot, (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmgrpfile), OR_AUTHCFG, TAKE12, NULL}, - {"AuthDBMAuthoritative", set_flag_slot, + {"AuthDBMAuthoritative", ap_set_flag_slot, (void *) XtOffsetOf(dbm_auth_config_rec, auth_dbmauthoritative), OR_AUTHCFG, FLAG, "Set to 'no' to allow access control to be passed along to lower modules, if the UserID is not known in this module"}, {NULL} @@ -154,7 +154,7 @@ if (!(f = dbm_open(auth_dbmpwfile, O_RDONLY, 0664))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "could not open dbm auth file: %s", auth_dbmpwfile); return NULL; } @@ -162,7 +162,7 @@ d = dbm_fetch(f, q); if (d.dptr) { - pw = palloc(r->pool, d.dsize + 1); + pw = ap_palloc(r->pool, d.dsize + 1); strncpy(pw, d.dptr, d.dsize); pw[d.dsize] = '\0'; /* Terminate the string */ } @@ -203,13 +203,13 @@ static int dbm_authenticate_basic_user(request_rec *r) { dbm_auth_config_rec *sec = - (dbm_auth_config_rec *) get_module_config(r->per_dir_config, + (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config, &dbm_auth_module); conn_rec *c = r->connection; char *sent_pw, *real_pw, *colon_pw; int res; - if ((res = get_basic_auth_pw(r, &sent_pw))) + if ((res = ap_get_basic_auth_pw(r, &sent_pw))) return res; if (!sec->auth_dbmpwfile) @@ -218,9 +218,9 @@ if (!(real_pw = get_dbm_pw(r, c->user, sec->auth_dbmpwfile))) { if (!(sec->auth_dbmauthoritative)) return DECLINED; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "DBM user %s not found: %s", c->user, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } /* Password is up to first : if exists */ @@ -229,9 +229,9 @@ *colon_pw = '\0'; /* anyone know where the prototype for crypt is? */ if (strcmp(real_pw, (char *) crypt(sent_pw, real_pw))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s: password mismatch: %s", c->user, r->uri); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } return OK; @@ -242,12 +242,12 @@ static int dbm_check_auth(request_rec *r) { dbm_auth_config_rec *sec = - (dbm_auth_config_rec *) get_module_config(r->per_dir_config, + (dbm_auth_config_rec *) ap_get_module_config(r->per_dir_config, &dbm_auth_module); char *user = r->connection->user; int m = r->method_number; - array_header *reqs_arr = requires(r); + array_header *reqs_arr = ap_requires(r); require_line *reqs = reqs_arr ? (require_line *) reqs_arr->elts : NULL; register int x; @@ -265,7 +265,7 @@ continue; t = reqs[x].requirement; - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); if (!strcmp(w, "group") && sec->auth_dbmgrpfile) { const char *orig_groups, *groups; @@ -274,26 +274,26 @@ if (!(groups = get_dbm_grp(r, user, sec->auth_dbmgrpfile))) { if (!(sec->auth_dbmauthoritative)) return DECLINED; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not in DBM group file %s: %s", user, sec->auth_dbmgrpfile, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } orig_groups = groups; while (t[0]) { - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); groups = orig_groups; while (groups[0]) { - v = getword(r->pool, &groups, ','); + v = ap_getword(r->pool, &groups, ','); if (!strcmp(v, w)) return OK; } } - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not in right group: %s", user, r->filename); - note_basic_auth_failure(r); + ap_note_basic_auth_failure(r); return AUTH_REQUIRED; } } 1.73 +130 -130 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.72 retrieving revision 1.73 diff -u -r1.72 -r1.73 --- mod_autoindex.c 1998/03/31 12:53:09 1.72 +++ mod_autoindex.c 1998/04/11 12:00:44 1.73 @@ -142,7 +142,7 @@ */ static void emit_preamble(request_rec *r, char *title) { - rvputs + ap_rvputs ( r, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n", @@ -156,7 +156,7 @@ static void push_item(array_header *arr, char *type, char *to, char *path, char *data) { - struct item *p = (struct item *) push_array(arr); + struct item *p = (struct item *) ap_push_array(arr); if (!to) to = ""; @@ -164,13 +164,13 @@ path = ""; p->type = type; - p->data = data ? pstrdup(arr->pool, data) : NULL; - p->apply_path = pstrcat(arr->pool, path, "*", NULL); + p->data = data ? ap_pstrdup(arr->pool, data) : NULL; + p->apply_path = ap_pstrcat(arr->pool, path, "*", NULL); - if ((type == BY_PATH) && (!is_matchexp(to))) - p->apply_to = pstrcat(arr->pool, "*", to, NULL); + if ((type == BY_PATH) && (!ap_is_matchexp(to))) + p->apply_to = ap_pstrcat(arr->pool, "*", to, NULL); else if (to) - p->apply_to = pstrdup(arr->pool, to); + p->apply_to = ap_pstrdup(arr->pool, to); else p->apply_to = NULL; } @@ -181,7 +181,7 @@ if (!strcmp(to, "**DIRECTORY**")) to = "^^DIRECTORY^^"; if (cmd->info == BY_ENCODING) { - str_tolower(to); + ap_str_tolower(to); } push_item(((autoindex_config_rec *) d)->alt_list, cmd->info, to, cmd->path, alt); @@ -190,7 +190,7 @@ static const char *add_icon(cmd_parms *cmd, void *d, char *icon, char *to) { - char *iconbak = pstrdup(cmd->pool, icon); + char *iconbak = ap_pstrdup(cmd->pool, icon); if (icon[0] == '(') { char *alt; @@ -199,7 +199,7 @@ if (cl == NULL) { return "missing closing paren"; } - alt = getword_nc(cmd->pool, &iconbak, ','); + alt = ap_getword_nc(cmd->pool, &iconbak, ','); *cl = '\0'; /* Lose closing paren */ add_alt(cmd, d, &alt[1], to); } @@ -207,7 +207,7 @@ if (!strcmp(to, "**DIRECTORY**")) to = "^^DIRECTORY^^"; if (cmd->info == BY_ENCODING) { - str_tolower(to); + ap_str_tolower(to); } push_item(((autoindex_config_rec *) d)->icon_list, cmd->info, to, cmd->path, @@ -272,7 +272,7 @@ autoindex_config_rec *d_cfg = (autoindex_config_rec *) d; while (optstr[0]) { - w = getword_conf(cmd->pool, &optstr); + w = ap_getword_conf(cmd->pool, &optstr); if (!strcasecmp(w, "FancyIndexing")) opts |= FANCY_INDEXING; else if (!strcasecmp(w, "IconsAreLinks")) @@ -294,10 +294,10 @@ opts = 0; else if (!strncasecmp(w, "IconWidth", 9)) { if (strchr(w, '=') != NULL) { - const char *x = pstrdup(cmd->pool, w); + const char *x = ap_pstrdup(cmd->pool, w); char *val; - val = getword(cmd->pool, &x, '='); - val = getword(cmd->pool, &x, '='); + val = ap_getword(cmd->pool, &x, '='); + val = ap_getword(cmd->pool, &x, '='); d_cfg->icon_width = atoi(val); } else { @@ -306,10 +306,10 @@ } else if (!strncasecmp(w, "IconHeight", 10)) { if (strchr(w, '=') != NULL) { - const char *x = pstrdup(cmd->pool, w); + const char *x = ap_pstrdup(cmd->pool, w); char *val; - val = getword(cmd->pool, &x, '='); - val = getword(cmd->pool, &x, '='); + val = ap_getword(cmd->pool, &x, '='); + val = ap_getword(cmd->pool, &x, '='); d_cfg->icon_height = atoi(val); } else { @@ -348,7 +348,7 @@ {"ReadmeName", add_readme, NULL, DIR_CMD_PERMS, TAKE1, "a filename"}, {"FancyIndexing", fancy_indexing, NULL, DIR_CMD_PERMS, FLAG, "Limited to 'on' or 'off' (superseded by IndexOptions FancyIndexing)"}, - {"DefaultIcon", set_string_slot, + {"DefaultIcon", ap_set_string_slot, (void *) XtOffsetOf(autoindex_config_rec, default_icon), DIR_CMD_PERMS, TAKE1, "an icon URL"}, {NULL} @@ -357,24 +357,24 @@ static void *create_autoindex_config(pool *p, char *dummy) { autoindex_config_rec *new = - (autoindex_config_rec *) pcalloc(p, sizeof(autoindex_config_rec)); + (autoindex_config_rec *) ap_pcalloc(p, sizeof(autoindex_config_rec)); new->icon_width = 0; new->icon_height = 0; - new->icon_list = make_array(p, 4, sizeof(struct item)); - new->alt_list = make_array(p, 4, sizeof(struct item)); - new->desc_list = make_array(p, 4, sizeof(struct item)); - new->ign_list = make_array(p, 4, sizeof(struct item)); - new->hdr_list = make_array(p, 4, sizeof(struct item)); - new->rdme_list = make_array(p, 4, sizeof(struct item)); - new->opts_list = make_array(p, 4, sizeof(struct item)); + new->icon_list = ap_make_array(p, 4, sizeof(struct item)); + new->alt_list = ap_make_array(p, 4, sizeof(struct item)); + new->desc_list = ap_make_array(p, 4, sizeof(struct item)); + new->ign_list = ap_make_array(p, 4, sizeof(struct item)); + new->hdr_list = ap_make_array(p, 4, sizeof(struct item)); + new->rdme_list = ap_make_array(p, 4, sizeof(struct item)); + new->opts_list = ap_make_array(p, 4, sizeof(struct item)); return (void *) new; } static void *merge_autoindex_configs(pool *p, void *basev, void *addv) { - autoindex_config_rec *new = (autoindex_config_rec *) pcalloc(p, sizeof(autoindex_config_rec)); + autoindex_config_rec *new = (autoindex_config_rec *) ap_pcalloc(p, sizeof(autoindex_config_rec)); autoindex_config_rec *base = (autoindex_config_rec *) basev; autoindex_config_rec *add = (autoindex_config_rec *) addv; @@ -382,13 +382,13 @@ new->icon_height = add->icon_height ? add->icon_height : base->icon_height; new->icon_width = add->icon_width ? add->icon_width : base->icon_width; - new->alt_list = append_arrays(p, add->alt_list, base->alt_list); - new->ign_list = append_arrays(p, add->ign_list, base->ign_list); - new->hdr_list = append_arrays(p, add->hdr_list, base->hdr_list); - new->desc_list = append_arrays(p, add->desc_list, base->desc_list); - new->icon_list = append_arrays(p, add->icon_list, base->icon_list); - new->rdme_list = append_arrays(p, add->rdme_list, base->rdme_list); - new->opts_list = append_arrays(p, add->opts_list, base->opts_list); + new->alt_list = ap_append_arrays(p, add->alt_list, base->alt_list); + new->ign_list = ap_append_arrays(p, add->ign_list, base->ign_list); + new->hdr_list = ap_append_arrays(p, add->hdr_list, base->hdr_list); + new->desc_list = ap_append_arrays(p, add->desc_list, base->desc_list); + new->icon_list = ap_append_arrays(p, add->icon_list, base->icon_list); + new->rdme_list = ap_append_arrays(p, add->rdme_list, base->rdme_list); + new->opts_list = ap_append_arrays(p, add->opts_list, base->opts_list); return new; } @@ -427,23 +427,23 @@ struct item *p = &items[i]; /* Special cased for ^^DIRECTORY^^ and ^^BLANKICON^^ */ - if ((path[0] == '^') || (!strcmp_match(path, p->apply_path))) { + if ((path[0] == '^') || (!ap_strcmp_match(path, p->apply_path))) { if (!*(p->apply_to)) return p->data; else if (p->type == BY_PATH || path[0] == '^') { - if (!strcmp_match(path, p->apply_to)) + if (!ap_strcmp_match(path, p->apply_to)) return p->data; } else if (!path_only) { if (!content_encoding) { if (p->type == BY_TYPE) { - if (content_type && !strcmp_match(content_type, p->apply_to)) + if (content_type && !ap_strcmp_match(content_type, p->apply_to)) return p->data; } } else { if (p->type == BY_ENCODING) { - if (!strcmp_match(content_encoding, p->apply_to)) + if (!ap_strcmp_match(content_encoding, p->apply_to)) return p->data; } } @@ -496,7 +496,7 @@ else ap++; - if (!strcmp_match(path, p->apply_path) && !strcmp_match(tt, ap)) + if (!ap_strcmp_match(path, p->apply_path) && !ap_strcmp_match(tt, ap)) return 1; } return 0; @@ -512,7 +512,7 @@ for (i = 0; i < list->nelts; ++i) { struct item *p = &items[i]; - if (!strcmp_match(path, p->apply_path)) + if (!ap_strcmp_match(path, p->apply_path)) return (int) (long) p->type; } return 0; @@ -536,7 +536,7 @@ int plaintext = 0; request_rec *rr; autoindex_config_rec *cfg = - (autoindex_config_rec *) get_module_config + (autoindex_config_rec *) ap_get_module_config ( r->per_dir_config, &autoindex_module @@ -544,8 +544,8 @@ int autoindex_opts = find_opts(cfg, r); /* XXX: this is a load of crap, it needs to do a full sub_req_lookup_uri */ - fn = make_full_path(r->pool, name, readme_fname); - fn = pstrcat(r->pool, fn, ".html", NULL); + fn = ap_make_full_path(r->pool, name, readme_fname); + fn = ap_pstrcat(r->pool, fn, ".html", NULL); if (stat(fn, &finfo) == -1) { /* A brief fake multiviews search for README.html */ fn[strlen(fn) - 5] = '\0'; @@ -553,19 +553,19 @@ return 0; plaintext = 1; if (hrule) - rputs("<HR>\n", r); + ap_rputs("<HR>\n", r); } else if (hrule) - rputs("<HR>\n", r); + ap_rputs("<HR>\n", r); /* XXX: when the above is rewritten properly, this necessary security * check will be redundant. -djg */ - rr = sub_req_lookup_file(fn, r); + rr = ap_sub_req_lookup_file(fn, r); if (rr->status != HTTP_OK) { - destroy_sub_req(rr); + ap_destroy_sub_req(rr); return 0; } - destroy_sub_req(rr); - if (!(f = pfopen(r->pool, fn, "r"))) + ap_destroy_sub_req(rr); + if (!(f = ap_pfopen(r->pool, fn, "r"))) return 0; if ( (whichend == FRONT_MATTER) && @@ -574,12 +574,12 @@ emit_preamble(r, title); } if (!plaintext) { - send_fd(f, r); + ap_send_fd(f, r); } else { char buf[IOBUFSIZE + 1]; int i, n, c, ch; - rputs("<PRE>\n", r); + ap_rputs("<PRE>\n", r); while (!feof(f)) { do n = fread(buf, sizeof(char), IOBUFSIZE, f); @@ -594,20 +594,20 @@ break; ch = buf[i]; buf[i] = '\0'; - rputs(&buf[c], r); + ap_rputs(&buf[c], r); if (ch == '<') - rputs("<", r); + ap_rputs("<", r); else if (ch == '>') - rputs(">", r); + ap_rputs(">", r); else if (ch == '&') - rputs("&", r); + ap_rputs("&", r); c = i + 1; } } } - pfclose(r->pool, f); + ap_pfclose(r->pool, f); if (plaintext) - rputs("</PRE>\n", r); + ap_rputs("</PRE>\n", r); return 1; } @@ -625,18 +625,18 @@ && (!strcmp(r->content_type, "text/html") || !strcmp(r->content_type, INCLUDES_MAGIC_TYPE)) && !r->content_encoding) { - if (!(thefile = pfopen(r->pool, r->filename, "r"))) + if (!(thefile = ap_pfopen(r->pool, r->filename, "r"))) return NULL; n = fread(titlebuf, sizeof(char), MAX_STRING_LEN - 1, thefile); if (n <= 0) { - pfclose(r->pool, thefile); + ap_pfclose(r->pool, thefile); return NULL; } titlebuf[n] = '\0'; for (x = 0, p = 0; titlebuf[x]; x++) { if (toupper(titlebuf[x]) == find[p]) { if (!find[++p]) { - if ((p = ind(&titlebuf[++x], '<')) != -1) + if ((p = ap_ind(&titlebuf[++x], '<')) != -1) titlebuf[x + p] = '\0'; /* Scan for line breaks for Tanmoy's secretary */ for (y = x; titlebuf[y]; y++) { @@ -649,14 +649,14 @@ } } } - pfclose(r->pool, thefile); - return pstrdup(r->pool, &titlebuf[x]); + ap_pfclose(r->pool, thefile); + return ap_pstrdup(r->pool, &titlebuf[x]); } } else p = 0; } - pfclose(r->pool, thefile); + ap_pfclose(r->pool, thefile); } return NULL; } @@ -671,11 +671,11 @@ if ((name[0] == '.') && (!name[1])) return (NULL); - if (ignore_entry(d, make_full_path(r->pool, r->filename, name))) + if (ignore_entry(d, ap_make_full_path(r->pool, r->filename, name))) return (NULL); - p = (struct ent *) pcalloc(r->pool, sizeof(struct ent)); - p->name = pstrdup(r->pool, name); + p = (struct ent *) ap_pcalloc(r->pool, sizeof(struct ent)); + p->name = ap_pstrdup(r->pool, name); p->size = 0; p->icon = NULL; p->alt = NULL; @@ -685,7 +685,7 @@ p->ascending = (toupper(direction) == D_ASCENDING); if (autoindex_opts & FANCY_INDEXING) { - request_rec *rr = sub_req_lookup_file(name, r); + request_rec *rr = ap_sub_req_lookup_file(name, r); if (rr->finfo.st_mode != 0) { p->lm = rr->finfo.st_mtime; @@ -695,7 +695,7 @@ if (!(p->alt = find_alt(d, rr, 1))) p->alt = "DIR"; p->size = 0; - p->name = pstrcat(r->pool, name, "/", NULL); + p->name = ap_pstrcat(r->pool, name, "/", NULL); } else { p->icon = find_icon(d, rr, 0); @@ -707,18 +707,18 @@ p->desc = find_desc(d, rr); if ((!p->desc) && (autoindex_opts & SCAN_HTML_TITLES)) - p->desc = pstrdup(r->pool, find_title(rr)); + p->desc = ap_pstrdup(r->pool, find_title(rr)); - destroy_sub_req(rr); + ap_destroy_sub_req(rr); } if (keyid == K_SIZE) { - p->size_cmp = palloc(r->pool, 14); + p->size_cmp = ap_palloc(r->pool, 14); ap_snprintf(p->size_cmp, 14, "%013d", p->size); } if (keyid == K_LAST_MOD) { struct tm *ts = localtime(&p->lm); - p->lm_cmp = palloc(r->pool, 15); + p->lm_cmp = ap_palloc(r->pool, 15); strftime(p->lm_cmp, 15, "%Y%m%d%H%M%S", ts); } return (p); @@ -783,10 +783,10 @@ qvalue[4] = '\0'; reverse = ((curkey == fname) && (curdirection == D_ASCENDING)); qvalue[3] = reverse ? D_DESCENDING : D_ASCENDING; - rvputs(r, "<A HREF=\"", qvalue, "\">", anchor, "</A>", NULL); + ap_rvputs(r, "<A HREF=\"", qvalue, "\">", anchor, "</A>", NULL); } else { - rputs(anchor, r); + ap_rputs(anchor, r); } } @@ -798,18 +798,18 @@ char *name = r->uri; char *tp; int static_columns = (autoindex_opts & SUPPRESS_COLSORT); - pool *scratch = make_sub_pool(r->pool); + pool *scratch = ap_make_sub_pool(r->pool); if (name[0] == '\0') name = "/"; if (autoindex_opts & FANCY_INDEXING) { - rputs("<PRE>", r); + ap_rputs("<PRE>", r); if ((tp = find_default_icon(d, "^^BLANKICON^^"))) { - rvputs(r, "<IMG SRC=\"", escape_html(scratch, tp), + ap_rvputs(r, "<IMG SRC=\"", ap_escape_html(scratch, tp), "\" ALT=\" \"", NULL); if (d->icon_width && d->icon_height) { - rprintf + ap_rprintf ( r, " HEIGHT=\"%d\" WIDTH=\"%d\"", @@ -817,41 +817,41 @@ d->icon_width ); } - rputs("> ", r); + ap_rputs("> ", r); } emit_link(r, "Name", K_NAME, keyid, direction, static_columns); - rputs(" ", r); + ap_rputs(" ", r); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { emit_link(r, "Last modified", K_LAST_MOD, keyid, direction, static_columns); - rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_SIZE)) { emit_link(r, "Size", K_SIZE, keyid, direction, static_columns); - rputs(" ", r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_DESC)) { emit_link(r, "Description", K_DESC, keyid, direction, static_columns); } - rputs("\n<HR>\n", r); + ap_rputs("\n<HR>\n", r); } else { - rputs("<UL>", r); + ap_rputs("<UL>", r); } for (x = 0; x < n; x++) { char *anchor = NULL, *t = NULL, *t2 = NULL; - clear_pool(scratch); + ap_clear_pool(scratch); if ((!strcmp(ar[x]->name, "../")) || (!strcmp(ar[x]->name, ".."))) { - t = make_full_path(scratch, name, "../"); - getparents(t); + t = ap_make_full_path(scratch, name, "../"); + ap_getparents(t); if (t[0] == '\0') t = "/"; - anchor = pstrcat(scratch, "<A HREF=\"", - escape_html(scratch, os_escape_path(scratch, t, 0)), + anchor = ap_pstrcat(scratch, "<A HREF=\"", + ap_escape_html(scratch, ap_escape_path(scratch, t, 0)), "\">", NULL); t2 = "Parent Directory</A> "; } @@ -859,35 +859,35 @@ t = ar[x]->name; len = strlen(t); if (len > 23) { - t2 = pstrdup(scratch, t); + t2 = ap_pstrdup(scratch, t); t2[21] = '.'; t2[22] = '.'; t2[23] = '\0'; - t2 = escape_html(scratch, t2); - t2 = pstrcat(scratch, t2, "</A>", NULL); + t2 = ap_escape_html(scratch, t2); + t2 = ap_pstrcat(scratch, t2, "</A>", NULL); } else { char buff[24] = " "; - t2 = escape_html(scratch, t); + t2 = ap_escape_html(scratch, t); buff[23 - len] = '\0'; - t2 = pstrcat(scratch, t2, "</A>", buff, NULL); + t2 = ap_pstrcat(scratch, t2, "</A>", buff, NULL); } - anchor = pstrcat(scratch, "<A HREF=\"", - escape_html(scratch, os_escape_path(scratch, t, 0)), + anchor = ap_pstrcat(scratch, "<A HREF=\"", + ap_escape_html(scratch, ap_escape_path(scratch, t, 0)), "\">", NULL); } if (autoindex_opts & FANCY_INDEXING) { if (autoindex_opts & ICONS_ARE_LINKS) - rputs(anchor, r); + ap_rputs(anchor, r); if ((ar[x]->icon) || d->default_icon) { - rvputs(r, "<IMG SRC=\"", - escape_html(scratch, ar[x]->icon ? + ap_rvputs(r, "<IMG SRC=\"", + ap_escape_html(scratch, ar[x]->icon ? ar[x]->icon : d->default_icon), "\" ALT=\"[", (ar[x]->alt ? ar[x]->alt : " "), "]\"", NULL); if (d->icon_width && d->icon_height) { - rprintf + ap_rprintf ( r, " HEIGHT=\"%d\" WIDTH=\"%d\"", @@ -895,42 +895,42 @@ d->icon_width ); } - rputs(">", r); + ap_rputs(">", r); } if (autoindex_opts & ICONS_ARE_LINKS) - rputs("</A>", r); + ap_rputs("</A>", r); - rvputs(r, " ", anchor, t2, NULL); + ap_rvputs(r, " ", anchor, t2, NULL); if (!(autoindex_opts & SUPPRESS_LAST_MOD)) { if (ar[x]->lm != -1) { char time_str[MAX_STRING_LEN]; struct tm *ts = localtime(&ar[x]->lm); strftime(time_str, MAX_STRING_LEN, "%d-%b-%Y %H:%M ", ts); - rputs(time_str, r); + ap_rputs(time_str, r); } else { - rputs(" ", r); + ap_rputs(" ", r); } } if (!(autoindex_opts & SUPPRESS_SIZE)) { - send_size(ar[x]->size, r); - rputs(" ", r); + ap_send_size(ar[x]->size, r); + ap_rputs(" ", r); } if (!(autoindex_opts & SUPPRESS_DESC)) { if (ar[x]->desc) { - rputs(terminate_description(d, ar[x]->desc, autoindex_opts), r); + ap_rputs(terminate_description(d, ar[x]->desc, autoindex_opts), r); } } } else - rvputs(r, "<LI> ", anchor, " ", t2, NULL); - rputc('\n', r); + ap_rvputs(r, "<LI> ", anchor, " ", t2, NULL); + ap_rputc('\n', r); } if (autoindex_opts & FANCY_INDEXING) { - rputs("</PRE>", r); + ap_rputs("</PRE>", r); } else { - rputs("</UL>", r); + ap_rputs("</UL>", r); } } @@ -1015,7 +1015,7 @@ static int index_directory(request_rec *r, autoindex_config_rec * autoindex_conf) { - char *title_name = escape_html(r->pool, r->uri); + char *title_name = ap_escape_html(r->pool, r->uri); char *title_endp; char *name = r->filename; @@ -1030,21 +1030,21 @@ char keyid; char direction; - if (!(d = popendir(r->pool, name))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + if (!(d = ap_popendir(r->pool, name))) { + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "Can't open directory for index: %s", r->filename); return HTTP_FORBIDDEN; } r->content_type = "text/html"; - send_http_header(r); + ap_send_http_header(r); if (r->header_only) { - pclosedir(r->pool, d); + ap_pclosedir(r->pool, d); return 0; } - hard_timeout("send directory", r); + ap_hard_timeout("send directory", r); /* Spew HTML preamble */ @@ -1057,7 +1057,7 @@ || (!(insert_readme(name, tmp, title_name, NO_HRULE, FRONT_MATTER, r))) ) { emit_preamble(r, title_name); - rvputs(r, "<H1>Index of ", title_name, "</H1>\n", NULL); + ap_rvputs(r, "<H1>Index of ", title_name, "</H1>\n", NULL); } /* @@ -1080,7 +1080,7 @@ } else { keyid = *qstring; - getword(r->pool, &qstring, '='); + ap_getword(r->pool, &qstring, '='); if (qstring != '\0') { direction = *qstring; } @@ -1105,7 +1105,7 @@ } } if (num_ent > 0) { - ar = (struct ent **) palloc(r->pool, num_ent * sizeof(struct ent *)); + ar = (struct ent **) ap_palloc(r->pool, num_ent * sizeof(struct ent *)); p = head; x = 0; while (p) { @@ -1122,18 +1122,18 @@ } output_directories(ar, num_ent, autoindex_conf, r, autoindex_opts, keyid, direction); - pclosedir(r->pool, d); + ap_pclosedir(r->pool, d); if ((tmp = find_readme(autoindex_conf, r))) { if (!insert_readme(name, tmp, "", ((autoindex_opts & FANCY_INDEXING) ? HRULE : NO_HRULE), END_MATTER, r)) { - rputs(psignature("<HR>\n", r), r); + ap_rputs(ap_psignature("<HR>\n", r), r); } } - rputs("</BODY></HTML>\n", r); + ap_rputs("</BODY></HTML>\n", r); - kill_timeout(r); + ap_kill_timeout(r); return 0; } @@ -1142,9 +1142,9 @@ static int handle_autoindex(request_rec *r) { autoindex_config_rec *d = - (autoindex_config_rec *) get_module_config(r->per_dir_config, + (autoindex_config_rec *) ap_get_module_config(r->per_dir_config, &autoindex_module); - int allow_opts = allow_options(r); + int allow_opts = ap_allow_options(r); r->allowed |= (1 << M_GET); if (r->method_number != M_GET) @@ -1159,12 +1159,12 @@ */ if (r->filename[strlen(r->filename) - 1] != '/') { - r->filename = pstrcat(r->pool, r->filename, "/", NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "/", NULL); } return index_directory(r, d); } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Directory index forbidden by rule: %s", r->filename); return HTTP_FORBIDDEN; } 1.28 +17 -17 apache-1.3/src/modules/standard/mod_cern_meta.c Index: mod_cern_meta.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_cern_meta.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_cern_meta.c 1998/03/31 12:53:10 1.27 +++ mod_cern_meta.c 1998/04/11 12:00:45 1.28 @@ -173,7 +173,7 @@ static void *create_cern_meta_dir_config(pool *p, char *dummy) { cern_meta_dir_config *new = - (cern_meta_dir_config *) palloc(p, sizeof(cern_meta_dir_config)); + (cern_meta_dir_config *) ap_palloc(p, sizeof(cern_meta_dir_config)); new->metadir = NULL; new->metasuffix = NULL; @@ -187,7 +187,7 @@ cern_meta_dir_config *base = (cern_meta_dir_config *) basev; cern_meta_dir_config *add = (cern_meta_dir_config *) addv; cern_meta_dir_config *new = - (cern_meta_dir_config *) palloc(p, sizeof(cern_meta_dir_config)); + (cern_meta_dir_config *) ap_palloc(p, sizeof(cern_meta_dir_config)); new->metadir = add->metadir ? add->metadir : base->metadir; new->metasuffix = add->metasuffix ? add->metasuffix : base->metasuffix; @@ -250,7 +250,7 @@ /* if we see a bogus header don't ignore it. Shout and scream */ if (!(l = strchr(w, ':'))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "malformed header in meta file: %s", r->filename); return SERVER_ERROR; } @@ -267,15 +267,15 @@ while (endp > l && isspace(*endp)) *endp-- = '\0'; - r->content_type = pstrdup(r->pool, l); - str_tolower(r->content_type); + r->content_type = ap_pstrdup(r->pool, l); + ap_str_tolower(r->content_type); } else if (!strcasecmp(w, "Status")) { sscanf(l, "%d", &r->status); - r->status_line = pstrdup(r->pool, l); + r->status_line = ap_pstrdup(r->pool, l); } else { - table_set(r->headers_out, w, l); + ap_table_set(r->headers_out, w, l); } } return OK; @@ -292,7 +292,7 @@ int rv; request_rec *rr; - dconf = get_module_config(r->per_dir_config, &cern_meta_module); + dconf = ap_get_module_config(r->per_dir_config, &cern_meta_module); if (!dconf->metafiles) { return DECLINED; @@ -310,7 +310,7 @@ }; /* what directory is this file in? */ - scrap_book = pstrdup(r->pool, r->filename); + scrap_book = ap_pstrdup(r->pool, r->filename); /* skip leading slash, recovered in later processing */ scrap_book++; last_slash = strrchr(scrap_book, '/'); @@ -322,13 +322,13 @@ } else { /* no last slash, buh?! */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "internal error in mod_cern_meta: %s", r->filename); /* should really barf, but hey, let's be friends... */ return DECLINED; }; - metafilename = pstrcat(r->pool, "/", scrap_book, "/", + metafilename = ap_pstrcat(r->pool, "/", scrap_book, "/", dconf->metadir ? dconf->metadir : DEFAULT_METADIR, "/", real_file, dconf->metasuffix ? dconf->metasuffix : DEFAULT_METASUFFIX, @@ -339,26 +339,26 @@ * A better solution might be a "safe open" feature of pfopen to avoid * pipes, symlinks, and crap like that. */ - rr = sub_req_lookup_file(metafilename, r); + rr = ap_sub_req_lookup_file(metafilename, r); if (rr->status != HTTP_OK) { - destroy_sub_req(rr); + ap_destroy_sub_req(rr); return DECLINED; } - destroy_sub_req(rr); + ap_destroy_sub_req(rr); - f = pfopen(r->pool, metafilename, "r"); + f = ap_pfopen(r->pool, metafilename, "r"); if (f == NULL) { if (errno == ENOENT) { return DECLINED; } - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "meta file permissions deny server access: %s", metafilename); return FORBIDDEN; }; /* read the headers in */ rv = scan_meta_file(r, f); - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return rv; } 1.74 +66 -66 apache-1.3/src/modules/standard/mod_cgi.c Index: mod_cgi.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_cgi.c,v retrieving revision 1.73 retrieving revision 1.74 diff -u -r1.73 -r1.74 --- mod_cgi.c 1998/04/01 14:24:33 1.73 +++ mod_cgi.c 1998/04/11 12:00:45 1.74 @@ -88,7 +88,7 @@ static int is_scriptaliased(request_rec *r) { - char *t = table_get(r->notes, "alias-forced-type"); + char *t = ap_table_get(r->notes, "alias-forced-type"); return t && (!strcasecmp(t, "cgi-script")); } @@ -106,7 +106,7 @@ static void *create_cgi_config(pool *p, server_rec *s) { cgi_server_conf *c = - (cgi_server_conf *) pcalloc(p, sizeof(cgi_server_conf)); + (cgi_server_conf *) ap_pcalloc(p, sizeof(cgi_server_conf)); c->logname = NULL; c->logbytes = DEFAULT_LOGBYTES; @@ -126,7 +126,7 @@ { server_rec *s = cmd->server; cgi_server_conf *conf = - (cgi_server_conf *) get_module_config(s->module_config, &cgi_module); + (cgi_server_conf *) ap_get_module_config(s->module_config, &cgi_module); conf->logname = arg; return NULL; @@ -136,7 +136,7 @@ { server_rec *s = cmd->server; cgi_server_conf *conf = - (cgi_server_conf *) get_module_config(s->module_config, &cgi_module); + (cgi_server_conf *) ap_get_module_config(s->module_config, &cgi_module); conf->logbytes = atol(arg); return NULL; @@ -146,7 +146,7 @@ { server_rec *s = cmd->server; cgi_server_conf *conf = - (cgi_server_conf *) get_module_config(s->module_config, &cgi_module); + (cgi_server_conf *) ap_get_module_config(s->module_config, &cgi_module); conf->bufbytes = atoi(arg); return NULL; @@ -169,26 +169,26 @@ FILE *f; struct stat finfo; - aplog_error(APLOG_MARK, show_errno|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, show_errno|APLOG_ERR, r->server, "%s, reason: %s", error, r->filename); if (!conf->logname || - ((stat(server_root_relative(r->pool, conf->logname), &finfo) == 0) + ((stat(ap_server_root_relative(r->pool, conf->logname), &finfo) == 0) && (finfo.st_size > conf->logbytes)) || - ((f = pfopen(r->pool, server_root_relative(r->pool, conf->logname), + ((f = ap_pfopen(r->pool, ap_server_root_relative(r->pool, conf->logname), "a")) == NULL)) { return ret; } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgi-bin/printenv HTTP/1.0" */ - fprintf(f, "%%%% [%s] %s %s%s%s %s\n", get_time(), r->method, r->uri, + fprintf(f, "%%%% [%s] %s %s%s%s %s\n", ap_get_time(), r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgi-bin */ fprintf(f, "%%%% %d %s\n", ret, r->filename); fprintf(f, "%%error\n%s\n", error); - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return ret; } @@ -203,20 +203,20 @@ struct stat finfo; if (!conf->logname || - ((stat(server_root_relative(r->pool, conf->logname), &finfo) == 0) + ((stat(ap_server_root_relative(r->pool, conf->logname), &finfo) == 0) && (finfo.st_size > conf->logbytes)) || - ((f = pfopen(r->pool, server_root_relative(r->pool, conf->logname), + ((f = ap_pfopen(r->pool, ap_server_root_relative(r->pool, conf->logname), "a")) == NULL)) { /* Soak up script output */ - while (bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) continue; - while (bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) continue; return ret; } /* "%% [Wed Jun 19 10:53:21 1996] GET /cgi-bin/printenv HTTP/1.0" */ - fprintf(f, "%%%% [%s] %s %s%s%s %s\n", get_time(), r->method, r->uri, + fprintf(f, "%%%% [%s] %s %s%s%s %s\n", ap_get_time(), r->method, r->uri, r->args ? "?" : "", r->args ? r->args : "", r->protocol); /* "%% 500 /usr/local/apache/cgi-bin" */ fprintf(f, "%%%% %d %s\n", ret, r->filename); @@ -245,26 +245,26 @@ if (sbuf && *sbuf) fprintf(f, "%s\n", sbuf); - if (bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { + if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { fputs("%stdout\n", f); fputs(argsbuffer, f); - while (bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) fputs(argsbuffer, f); fputs("\n", f); } - if (bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { + if (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { fputs("%stderr\n", f); fputs(argsbuffer, f); - while (bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) fputs(argsbuffer, f); fputs("\n", f); } - bclose(script_in); - bclose(script_err); + ap_bclose(script_in); + ap_bclose(script_err); - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return ret; } @@ -306,8 +306,8 @@ r->filename, nph ? "NPH " : "", argv0); #endif - add_cgi_vars(r); - env = create_environment(r->pool, r->subprocess_env); + ap_add_cgi_vars(r); + env = ap_create_environment(r->pool, r->subprocess_env); #ifdef DEBUG_CGI fprintf(dbg, "Environment: \n"); @@ -315,17 +315,17 @@ fprintf(dbg, "'%s'\n", env[i]); #endif - chdir_file(r->filename); + ap_chdir_file(r->filename); if (!cld->debug) - error_log2stderr(r->server); + ap_error_log2stderr(r->server); /* Transumute outselves into the script. * NB only ISINDEX scripts get decoded arguments. */ - cleanup_for_exec(); + ap_cleanup_for_exec(); - child_pid = call_exec(r, argv0, env, 0); + child_pid = ap_call_exec(r, argv0, env, 0); #ifdef WIN32 return (child_pid); #else @@ -339,7 +339,7 @@ * a server to aplog_error. */ - aplog_error(APLOG_MARK, APLOG_ERR, NULL, "exec of %s failed", r->filename); + ap_log_error(APLOG_MARK, APLOG_ERR, NULL, "exec of %s failed", r->filename); exit(0); /* NOT REACHED */ return (0); @@ -355,7 +355,7 @@ int is_included = !strcmp(r->protocol, "INCLUDED"); void *sconf = r->server->module_config; cgi_server_conf *conf = - (cgi_server_conf *) get_module_config(sconf, &cgi_module); + (cgi_server_conf *) ap_get_module_config(sconf, &cgi_module); struct cgi_child_stuff cld; @@ -373,7 +373,7 @@ nph = !(strncmp(argv0, "nph-", 4)); - if (!(allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r)) + if (!(ap_allow_options(r) & OPT_EXECCGI) && !is_scriptaliased(r)) return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO, "Options ExecCGI is off in this directory"); if (nph && is_included) @@ -385,7 +385,7 @@ if (r->finfo.st_mode == 0) { struct stat statbuf; - r->filename = pstrcat(r->pool, r->filename, ".EXE", NULL); + r->filename = ap_pstrcat(r->pool, r->filename, ".EXE", NULL); if ((stat(r->filename, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode))) { return log_scripterror(r, conf, NOT_FOUND, 0, @@ -400,16 +400,16 @@ if (S_ISDIR(r->finfo.st_mode)) return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO, "attempt to invoke directory as script"); - if (!suexec_enabled) { - if (!can_exec(&r->finfo)) + if (!ap_suexec_enabled) { + if (!ap_can_exec(&r->finfo)) return log_scripterror(r, conf, FORBIDDEN, APLOG_NOERRNO, "file permissions deny server execution"); } - if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) + if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) return retval; - add_common_vars(r); + ap_add_common_vars(r); cld.argv0 = argv0; cld.r = r; cld.nph = nph; @@ -418,7 +418,7 @@ #ifdef CHARSET_EBCDIC /* XXX:@@@ Is the generated/included output ALWAYS in text/ebcdic format? */ /* Or must we check the Content-Type first? */ - bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); #endif /*CHARSET_EBCDIC*/ /* @@ -426,11 +426,11 @@ * waiting for free_proc_chain to cleanup in the middle of an * SSI request -djg */ - if (!spawn_child_err_buff(r->main ? r->main->pool : r->pool, cgi_child, + if (!ap_spawn_child_err_buff(r->main ? r->main->pool : r->pool, cgi_child, (void *) &cld, kill_after_timeout, &script_out, &script_in, &script_err)) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "couldn't spawn child process: %s", r->filename); return SERVER_ERROR; } @@ -444,22 +444,22 @@ * spurious newline). */ - if (should_client_block(r)) { + if (ap_should_client_block(r)) { void (*handler) (int); int dbsize, len_read; if (conf->logname) { - dbuf = pcalloc(r->pool, conf->bufbytes + 1); + dbuf = ap_pcalloc(r->pool, conf->bufbytes + 1); dbpos = 0; } - hard_timeout("copy script args", r); + ap_hard_timeout("copy script args", r); #ifdef SIGPIPE handler = signal(SIGPIPE, SIG_IGN); #endif while ((len_read = - get_client_block(r, argsbuffer, HUGE_STRING_LEN)) > 0) { + ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN)) > 0) { if (conf->logname) { if ((dbpos + len_read) > conf->bufbytes) { dbsize = conf->bufbytes - dbpos; @@ -470,30 +470,30 @@ memcpy(dbuf + dbpos, argsbuffer, dbsize); dbpos += dbsize; } - reset_timeout(r); - if (bwrite(script_out, argsbuffer, len_read) < len_read) { + ap_reset_timeout(r); + if (ap_bwrite(script_out, argsbuffer, len_read) < len_read) { /* silly script stopped reading, soak up remaining message */ - while (get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0) { + while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN) > 0) { /* dump it */ } break; } } - bflush(script_out); + ap_bflush(script_out); signal(SIGPIPE, handler); - kill_timeout(r); + ap_kill_timeout(r); } - bclose(script_out); + ap_bclose(script_out); /* Handle script return... */ if (script_in && !nph) { char *location, sbuf[MAX_STRING_LEN]; int ret; - if ((ret = scan_script_header_err_buff(r, script_in, sbuf))) { + if ((ret = ap_scan_script_header_err_buff(r, script_in, sbuf))) { return log_script(r, conf, ret, dbuf, sbuf, script_in, script_err); } @@ -502,34 +502,34 @@ os_checkconv(r); #endif /*CHARSET_EBCDIC*/ - location = table_get(r->headers_out, "Location"); + location = ap_table_get(r->headers_out, "Location"); if (location && location[0] == '/' && r->status == 200) { /* Soak up all the script output */ - hard_timeout("read from script", r); - while (bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { + ap_hard_timeout("read from script", r); + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_in) > 0) { continue; } - while (bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { continue; } - kill_timeout(r); + ap_kill_timeout(r); /* This redirect needs to be a GET no matter what the original * method was. */ - r->method = pstrdup(r->pool, "GET"); + r->method = ap_pstrdup(r->pool, "GET"); r->method_number = M_GET; /* We already read the message body (if any), so don't allow * the redirected request to think it has one. We can ignore * Transfer-Encoding, since we used REQUEST_CHUNKED_ERROR. */ - table_unset(r->headers_in, "Content-Length"); + ap_table_unset(r->headers_in, "Content-Length"); - internal_redirect_handler(location, r); + ap_internal_redirect_handler(location, r); return OK; } else if (location && r->status == 200) { @@ -539,22 +539,22 @@ return REDIRECT; } - send_http_header(r); + ap_send_http_header(r); if (!r->header_only) { - send_fb(script_in, r); + ap_send_fb(script_in, r); } - bclose(script_in); + ap_bclose(script_in); - soft_timeout("soaking script stderr", r); - while (bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { + ap_soft_timeout("soaking script stderr", r); + while (ap_bgets(argsbuffer, HUGE_STRING_LEN, script_err) > 0) { continue; } - kill_timeout(r); - bclose(script_err); + ap_kill_timeout(r); + ap_bclose(script_err); } if (script_in && nph) { - send_fb(script_in, r); + ap_send_fb(script_in, r); } return OK; /* NOT r->status, even if it has changed. */ 1.34 +42 -42 apache-1.3/src/modules/standard/mod_digest.c Index: mod_digest.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_digest.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mod_digest.c 1998/03/31 12:53:11 1.33 +++ mod_digest.c 1998/04/11 12:00:46 1.34 @@ -84,15 +84,15 @@ static void *create_digest_dir_config(pool *p, char *d) { - return pcalloc(p, sizeof(digest_config_rec)); + return ap_pcalloc(p, sizeof(digest_config_rec)); } static const char *set_digest_slot(cmd_parms *cmd, void *offset, char *f, char *t) { if (t && strcmp(t, "standard")) - return pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); + return ap_pstrcat(cmd->pool, "Invalid auth file type: ", t, NULL); - return set_string_slot(cmd, offset, f); + return ap_set_string_slot(cmd, offset, f); } static const command_rec digest_cmds[] = @@ -111,24 +111,24 @@ const char *rpw; char *w, *x; - if (!(f = pcfg_openfile(r->pool, auth_pwfile))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + if (!(f = ap_pcfg_openfile(r->pool, auth_pwfile))) { + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "Could not open password file: %s", auth_pwfile); return NULL; } - while (!(cfg_getline(l, MAX_STRING_LEN, f))) { + while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { if ((l[0] == '#') || (!l[0])) continue; rpw = l; - w = getword(r->pool, &rpw, ':'); - x = getword(r->pool, &rpw, ':'); + w = ap_getword(r->pool, &rpw, ':'); + x = ap_getword(r->pool, &rpw, ':'); - if (x && w && !strcmp(user, w) && !strcmp(auth_name(r), x)) { - cfg_closefile(f); - return pstrdup(r->pool, rpw); + if (x && w && !strcmp(user, w) && !strcmp(ap_auth_name(r), x)) { + ap_cfg_closefile(f); + return ap_pstrdup(r->pool, rpw); } } - cfg_closefile(f); + ap_cfg_closefile(f); return NULL; } @@ -136,32 +136,32 @@ static int get_digest_rec(request_rec *r, digest_header_rec * response) { - const char *auth_line = table_get(r->headers_in, + const char *auth_line = ap_table_get(r->headers_in, r->proxyreq ? "Proxy-Authorization" : "Authorization"); int l; int s, vk = 0, vv = 0; char *t, *key, *value; - if (!(t = auth_type(r)) || strcasecmp(t, "Digest")) + if (!(t = ap_auth_type(r)) || strcasecmp(t, "Digest")) return DECLINED; - if (!auth_name(r)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + if (!ap_auth_name(r)) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "need AuthName: %s", r->uri); return SERVER_ERROR; } if (!auth_line) { - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } - if (strcasecmp(getword(r->pool, &auth_line, ' '), "Digest")) { + if (strcasecmp(ap_getword(r->pool, &auth_line, ' '), "Digest")) { /* Client tried to authenticate using wrong auth scheme */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "client used wrong authentication scheme: %s", r->uri); - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } @@ -171,8 +171,8 @@ * there has to be at least one '=' character for either of these two * new strings to be terminated. That takes care of the need for +1. */ - key = palloc(r->pool, l); - value = palloc(r->pool, l); + key = ap_palloc(r->pool, l); + value = ap_palloc(r->pool, l); /* There's probably a better way to do this, but for the time being... */ @@ -207,15 +207,15 @@ value[vv] = '\0'; if (!strcasecmp(key, "username")) - response->username = pstrdup(r->pool, value); + response->username = ap_pstrdup(r->pool, value); else if (!strcasecmp(key, "realm")) - response->realm = pstrdup(r->pool, value); + response->realm = ap_pstrdup(r->pool, value); else if (!strcasecmp(key, "nonce")) - response->nonce = pstrdup(r->pool, value); + response->nonce = ap_pstrdup(r->pool, value); else if (!strcasecmp(key, "uri")) - response->requested_uri = pstrdup(r->pool, value); + response->requested_uri = ap_pstrdup(r->pool, value); else if (!strcasecmp(key, "response")) - response->digest = pstrdup(r->pool, value); + response->digest = ap_pstrdup(r->pool, value); vv = 0; s = D_KEY; @@ -243,12 +243,12 @@ if (!response->username || !response->realm || !response->nonce || !response->requested_uri || !response->digest) { - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } r->connection->user = response->username; - r->connection->auth_type = "Digest"; + r->connection->ap_auth_type = "Digest"; return OK; } @@ -258,9 +258,9 @@ static char *find_digest(request_rec *r, digest_header_rec * h, char *a1) { return ap_md5(r->pool, - (unsigned char *)pstrcat(r->pool, a1, ":", h->nonce, ":", + (unsigned char *)ap_pstrcat(r->pool, a1, ":", h->nonce, ":", ap_md5(r->pool, - (unsigned char *)pstrcat(r->pool, r->method, ":", + (unsigned char *)ap_pstrcat(r->pool, r->method, ":", h->requested_uri, NULL)), NULL)); } @@ -282,9 +282,9 @@ static int authenticate_digest_user(request_rec *r) { digest_config_rec *sec = - (digest_config_rec *) get_module_config(r->per_dir_config, + (digest_config_rec *) ap_get_module_config(r->per_dir_config, &digest_module); - digest_header_rec *response = pcalloc(r->pool, sizeof(digest_header_rec)); + digest_header_rec *response = ap_pcalloc(r->pool, sizeof(digest_header_rec)); conn_rec *c = r->connection; char *a1; int res; @@ -296,15 +296,15 @@ return DECLINED; if (!(a1 = get_hash(r, c->user, sec->pwfile))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s not found: %s", c->user, r->uri); - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } if (strcmp(response->digest, find_digest(r, response, a1))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "user %s: password mismatch: %s", c->user, r->uri); - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } return OK; @@ -323,10 +323,10 @@ array_header *reqs_arr; require_line *reqs; - if (!(t = auth_type(r)) || strcasecmp(t, "Digest")) + if (!(t = ap_auth_type(r)) || strcasecmp(t, "Digest")) return DECLINED; - reqs_arr = requires(r); + reqs_arr = ap_requires(r); /* If there is no "requires" directive, * then any user will do. */ @@ -342,12 +342,12 @@ method_restricted = 1; t = reqs[x].requirement; - w = getword(r->pool, &t, ' '); + w = ap_getword(r->pool, &t, ' '); if (!strcmp(w, "valid-user")) return OK; else if (!strcmp(w, "user")) { while (t[0]) { - w = getword_conf(r->pool, &t); + w = ap_getword_conf(r->pool, &t); if (!strcmp(user, w)) return OK; } @@ -359,7 +359,7 @@ if (!method_restricted) return OK; - note_digest_auth_failure(r); + ap_note_digest_auth_failure(r); return AUTH_REQUIRED; } 1.50 +20 -20 apache-1.3/src/modules/standard/mod_dir.c Index: mod_dir.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_dir.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- mod_dir.c 1998/03/31 12:53:11 1.49 +++ mod_dir.c 1998/04/11 12:00:46 1.50 @@ -81,9 +81,9 @@ dir_config_rec *d = dummy; if (!d->index_names) { - d->index_names = make_array(cmd->pool, 2, sizeof(char *)); + d->index_names = ap_make_array(cmd->pool, 2, sizeof(char *)); } - *(char **)push_array(d->index_names) = arg; + *(char **)ap_push_array(d->index_names) = arg; return NULL; } @@ -98,7 +98,7 @@ static void *create_dir_config(pool *p, char *dummy) { dir_config_rec *new = - (dir_config_rec *) pcalloc(p, sizeof(dir_config_rec)); + (dir_config_rec *) ap_pcalloc(p, sizeof(dir_config_rec)); new->index_names = NULL; return (void *) new; @@ -106,7 +106,7 @@ static void *merge_dir_configs(pool *p, void *basev, void *addv) { - dir_config_rec *new = (dir_config_rec *) pcalloc(p, sizeof(dir_config_rec)); + dir_config_rec *new = (dir_config_rec *) ap_pcalloc(p, sizeof(dir_config_rec)); dir_config_rec *base = (dir_config_rec *) basev; dir_config_rec *add = (dir_config_rec *) addv; @@ -117,7 +117,7 @@ static int handle_dir(request_rec *r) { dir_config_rec *d = - (dir_config_rec *) get_module_config(r->per_dir_config, + (dir_config_rec *) ap_get_module_config(r->per_dir_config, &dir_module); char *dummy_ptr[1]; char **names_ptr; @@ -127,14 +127,14 @@ if (r->uri[0] == '\0' || r->uri[strlen(r->uri) - 1] != '/') { char *ifile; if (r->args != NULL) - ifile = pstrcat(r->pool, escape_uri(r->pool, r->uri), + ifile = ap_pstrcat(r->pool, escape_uri(r->pool, r->uri), "/", "?", r->args, NULL); else - ifile = pstrcat(r->pool, escape_uri(r->pool, r->uri), + ifile = ap_pstrcat(r->pool, escape_uri(r->pool, r->uri), "/", NULL); - table_setn(r->headers_out, "Location", - construct_url(r->pool, ifile, r)); + ap_table_setn(r->headers_out, "Location", + ap_construct_url(r->pool, ifile, r)); return HTTP_MOVED_PERMANENTLY; } @@ -144,7 +144,7 @@ */ if (r->filename[strlen(r->filename) - 1] != '/') { - r->filename = pstrcat(r->pool, r->filename, "/", NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "/", NULL); } if (d->index_names) { @@ -159,18 +159,18 @@ for (; num_names; ++names_ptr, --num_names) { char *name_ptr = *names_ptr; - request_rec *rr = sub_req_lookup_uri(name_ptr, r); + request_rec *rr = ap_sub_req_lookup_uri(name_ptr, r); if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) { char *new_uri = escape_uri(r->pool, rr->uri); if (rr->args != NULL) - new_uri = pstrcat(r->pool, new_uri, "?", rr->args, NULL); + new_uri = ap_pstrcat(r->pool, new_uri, "?", rr->args, NULL); else if (r->args != NULL) - new_uri = pstrcat(r->pool, new_uri, "?", r->args, NULL); + new_uri = ap_pstrcat(r->pool, new_uri, "?", r->args, NULL); - destroy_sub_req(rr); - internal_redirect(new_uri, r); + ap_destroy_sub_req(rr); + ap_internal_redirect(new_uri, r); return OK; } @@ -180,12 +180,12 @@ (rr->status == HTTP_NOT_ACCEPTABLE && num_names == 1)) { error_notfound = rr->status; - r->notes = overlay_tables(r->pool, r->notes, rr->notes); - r->headers_out = overlay_tables(r->pool, r->headers_out, + r->notes = ap_overlay_tables(r->pool, r->notes, rr->notes); + r->headers_out = ap_overlay_tables(r->pool, r->headers_out, rr->headers_out); - r->err_headers_out = overlay_tables(r->pool, r->err_headers_out, + r->err_headers_out = ap_overlay_tables(r->pool, r->err_headers_out, rr->err_headers_out); - destroy_sub_req(rr); + ap_destroy_sub_req(rr); return error_notfound; } @@ -201,7 +201,7 @@ if (rr->status && rr->status != HTTP_NOT_FOUND && rr->status != HTTP_OK) error_notfound = rr->status; - destroy_sub_req(rr); + ap_destroy_sub_req(rr); } if (error_notfound) 1.23 +19 -19 apache-1.3/src/modules/standard/mod_env.c Index: mod_env.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_env.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- mod_env.c 1998/03/31 12:53:11 1.22 +++ mod_env.c 1998/04/11 12:00:46 1.23 @@ -112,8 +112,8 @@ static void *create_env_server_config(pool *p, server_rec *dummy) { env_server_config_rec *new = - (env_server_config_rec *) palloc(p, sizeof(env_server_config_rec)); - new->vars = make_table(p, 50); + (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec)); + new->vars = ap_make_table(p, 50); new->unsetenv = ""; new->vars_present = 0; return (void *) new; @@ -124,7 +124,7 @@ env_server_config_rec *base = (env_server_config_rec *) basev; env_server_config_rec *add = (env_server_config_rec *) addv; env_server_config_rec *new = - (env_server_config_rec *) palloc(p, sizeof(env_server_config_rec)); + (env_server_config_rec *) ap_palloc(p, sizeof(env_server_config_rec)); table *new_table; table_entry *elts; @@ -143,20 +143,20 @@ * } */ - new_table = copy_table(p, base->vars); + new_table = ap_copy_table(p, base->vars); arr = table_elts(add->vars); elts = (table_entry *)arr->elts; for (i = 0; i < arr->nelts; ++i) { - table_setn(new_table, elts[i].key, elts[i].val); + ap_table_setn(new_table, elts[i].key, elts[i].val); } unset = add->unsetenv; - uenv = getword_conf(p, &unset); + uenv = ap_getword_conf(p, &unset); while (uenv[0] != '\0') { - table_unset(new_table, uenv); - uenv = getword_conf(p, &unset); + ap_table_unset(new_table, uenv); + uenv = ap_getword_conf(p, &unset); } new->vars = new_table; @@ -170,17 +170,17 @@ const char *arg) { env_server_config_rec *sconf = - get_module_config(cmd->server->module_config, &env_module); + ap_get_module_config(cmd->server->module_config, &env_module); table *vars = sconf->vars; char *env_var; char *name_ptr; while (*arg) { - name_ptr = getword_conf(cmd->pool, &arg); + name_ptr = ap_getword_conf(cmd->pool, &arg); env_var = getenv(name_ptr); if (env_var != NULL) { sconf->vars_present = 1; - table_setn(vars, name_ptr, pstrdup(cmd->pool, env_var)); + ap_table_setn(vars, name_ptr, ap_pstrdup(cmd->pool, env_var)); } } return NULL; @@ -190,12 +190,12 @@ const char *arg) { env_server_config_rec *sconf = - get_module_config(cmd->server->module_config, &env_module); + ap_get_module_config(cmd->server->module_config, &env_module); table *vars = sconf->vars; char *name, *value; - name = getword_conf(cmd->pool, &arg); - value = getword_conf(cmd->pool, &arg); + name = ap_getword_conf(cmd->pool, &arg); + value = ap_getword_conf(cmd->pool, &arg); /* name is mandatory, value is optional. no value means * set the variable to an empty string @@ -207,7 +207,7 @@ } sconf->vars_present = 1; - table_setn(vars, name, value); + ap_table_setn(vars, name, value); return NULL; } @@ -216,9 +216,9 @@ char *arg) { env_server_config_rec *sconf = - get_module_config(cmd->server->module_config, &env_module); + ap_get_module_config(cmd->server->module_config, &env_module); sconf->unsetenv = sconf->unsetenv ? - pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) : + ap_pstrcat(cmd->pool, sconf->unsetenv, " ", arg, NULL) : arg; return NULL; } @@ -238,14 +238,14 @@ { table *e = r->subprocess_env; server_rec *s = r->server; - env_server_config_rec *sconf = get_module_config(s->module_config, + env_server_config_rec *sconf = ap_get_module_config(s->module_config, &env_module); table *vars = sconf->vars; if (!sconf->vars_present) return DECLINED; - r->subprocess_env = overlay_tables(r->pool, e, vars); + r->subprocess_env = ap_overlay_tables(r->pool, e, vars); return OK; } 1.27 +23 -23 apache-1.3/src/modules/standard/mod_expires.c Index: mod_expires.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_expires.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -r1.26 -r1.27 --- mod_expires.c 1998/03/31 12:53:12 1.26 +++ mod_expires.c 1998/04/11 12:00:46 1.27 @@ -216,10 +216,10 @@ static void *create_dir_expires_config(pool *p, char *dummy) { expires_dir_config *new = - (expires_dir_config *) pcalloc(p, sizeof(expires_dir_config)); + (expires_dir_config *) ap_pcalloc(p, sizeof(expires_dir_config)); new->active = ACTIVE_DONTCARE; new->expiresdefault = ""; - new->expiresbytype = make_table(p, 4); + new->expiresbytype = ap_make_table(p, 4); return (void *) new; } @@ -259,7 +259,7 @@ /* <base> */ - word = getword_conf(p, &code); + word = ap_getword_conf(p, &code); if (!strncasecmp(word, "now", 1) || !strncasecmp(word, "access", 1)) { base = 'A'; @@ -268,15 +268,15 @@ base = 'M'; } else { - return pstrcat(p, "bad expires code, unrecognised <base> '", + return ap_pstrcat(p, "bad expires code, unrecognised <base> '", word, "'", NULL); }; /* [plus] */ - word = getword_conf(p, &code); + word = ap_getword_conf(p, &code); if (!strncasecmp(word, "plus", 1)) { - word = getword_conf(p, &code); + word = ap_getword_conf(p, &code); }; /* {<num> <type>}* @@ -288,18 +288,18 @@ num = atoi(word); } else { - return pstrcat(p, "bad expires code, numeric value expected <num> '", + return ap_pstrcat(p, "bad expires code, numeric value expected <num> '", word, "'", NULL); }; /* <type> */ - word = getword_conf(p, &code); + word = ap_getword_conf(p, &code); if (word[0]) { /* do nothing */ } else { - return pstrcat(p, "bad expires code, missing <type>", NULL); + return ap_pstrcat(p, "bad expires code, missing <type>", NULL); }; factor = 0; @@ -325,7 +325,7 @@ factor = 1; } else { - return pstrcat(p, "bad expires code, unrecognised <type>", + return ap_pstrcat(p, "bad expires code, unrecognised <type>", "'", word, "'", NULL); }; @@ -333,10 +333,10 @@ /* next <num> */ - word = getword_conf(p, &code); + word = ap_getword_conf(p, &code); }; - *real_code = psprintf(p, "%c%d", base, modifier); + *real_code = ap_psprintf(p, "%c%d", base, modifier); return NULL; } @@ -346,10 +346,10 @@ char *response, *real_code; if ((response = check_code(cmd->pool, code, &real_code)) == NULL) { - table_setn(dir_config->expiresbytype, mime, real_code); + ap_table_setn(dir_config->expiresbytype, mime, real_code); return NULL; }; - return pstrcat(cmd->pool, + return ap_pstrcat(cmd->pool, "'ExpiresByType ", mime, " ", code, "': ", response, NULL); } @@ -361,7 +361,7 @@ dir_config->expiresdefault = real_code; return NULL; }; - return pstrcat(cmd->pool, + return ap_pstrcat(cmd->pool, "'ExpiresDefault ", code, "': ", response, NULL); } @@ -378,7 +378,7 @@ static void *merge_expires_dir_configs(pool *p, void *basev, void *addv) { - expires_dir_config *new = (expires_dir_config *) pcalloc(p, sizeof(expires_dir_config)); + expires_dir_config *new = (expires_dir_config *) ap_pcalloc(p, sizeof(expires_dir_config)); expires_dir_config *base = (expires_dir_config *) basev; expires_dir_config *add = (expires_dir_config *) addv; @@ -393,7 +393,7 @@ new->expiresdefault = add->expiresdefault; }; - new->expiresbytype = overlay_tables(p, add->expiresbytype, + new->expiresbytype = ap_overlay_tables(p, add->expiresbytype, base->expiresbytype); return new; } @@ -416,9 +416,9 @@ if (r->finfo.st_mode == 0) /* no file ? shame. */ return DECLINED; - conf = (expires_dir_config *) get_module_config(r->per_dir_config, &expires_module); + conf = (expires_dir_config *) ap_get_module_config(r->per_dir_config, &expires_module); if (conf == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "internal error: %s", r->filename); return SERVER_ERROR; }; @@ -440,7 +440,7 @@ if (r->content_type == NULL) code = NULL; else - code = (char *) table_get(conf->expiresbytype, r->content_type); + code = (char *) ap_table_get(conf->expiresbytype, r->content_type); if (code == NULL) { /* no expires defined for that type, is there a default? */ @@ -468,18 +468,18 @@ /* expecting the add_* routines to be case-hardened this * is just a reminder that module is beta */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "internal error: bad expires code: %s", r->filename); return SERVER_ERROR; }; expires = base + additional; ap_snprintf(age, sizeof(age), "max-age=%d", (int) expires - (int) r->request_time); - table_setn(r->headers_out, "Cache-Control", pstrdup(r->pool, age)); + ap_table_setn(r->headers_out, "Cache-Control", ap_pstrdup(r->pool, age)); tzset(); /* redundant? called implicitly by localtime, at least * under FreeBSD */ - table_setn(r->headers_out, "Expires", gm_timestr_822(r->pool, expires)); + ap_table_setn(r->headers_out, "Expires", ap_gm_timestr_822(r->pool, expires)); return OK; } 1.17 +13 -13 apache-1.3/src/modules/standard/mod_headers.c Index: mod_headers.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_headers.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- mod_headers.c 1998/03/31 12:53:12 1.16 +++ mod_headers.c 1998/04/11 12:00:46 1.17 @@ -130,9 +130,9 @@ static void *create_headers_config(pool *p, server_rec *s) { headers_conf *a = - (headers_conf *) pcalloc(p, sizeof(headers_conf)); + (headers_conf *) ap_pcalloc(p, sizeof(headers_conf)); - a->headers = make_array(p, 2, sizeof(header_entry)); + a->headers = ap_make_array(p, 2, sizeof(header_entry)); return a; } @@ -144,10 +144,10 @@ static void *merge_headers_config(pool *p, void *basev, void *overridesv) { headers_conf *a = - (headers_conf *) pcalloc(p, sizeof(headers_conf)); + (headers_conf *) ap_pcalloc(p, sizeof(headers_conf)); headers_conf *base = (headers_conf *) basev, *overrides = (headers_conf *) overridesv; - a->headers = append_arrays(p, base->headers, overrides->headers); + a->headers = ap_append_arrays(p, base->headers, overrides->headers); return a; } @@ -158,14 +158,14 @@ header_entry *new; server_rec *s = cmd->server; headers_conf *serverconf = - (headers_conf *) get_module_config(s->module_config, &headers_module); + (headers_conf *) ap_get_module_config(s->module_config, &headers_module); char *colon; if (cmd->path) { - new = (header_entry *) push_array(dirconf->headers); + new = (header_entry *) ap_push_array(dirconf->headers); } else { - new = (header_entry *) push_array(serverconf->headers); + new = (header_entry *) ap_push_array(serverconf->headers); } if (!strcasecmp(action, "set")) @@ -210,16 +210,16 @@ header_entry *hdr = &((header_entry *) (headers->elts))[i]; switch (hdr->action) { case hdr_add: - table_addn(r->headers_out, hdr->header, hdr->value); + ap_table_addn(r->headers_out, hdr->header, hdr->value); break; case hdr_append: - table_mergen(r->headers_out, hdr->header, hdr->value); + ap_table_mergen(r->headers_out, hdr->header, hdr->value); break; case hdr_set: - table_setn(r->headers_out, hdr->header, hdr->value); + ap_table_setn(r->headers_out, hdr->header, hdr->value); break; case hdr_unset: - table_unset(r->headers_out, hdr->header); + ap_table_unset(r->headers_out, hdr->header); break; } } @@ -230,10 +230,10 @@ { void *sconf = r->server->module_config; headers_conf *serverconf = - (headers_conf *) get_module_config(sconf, &headers_module); + (headers_conf *) ap_get_module_config(sconf, &headers_module); void *dconf = r->per_dir_config; headers_conf *dirconf = - (headers_conf *) get_module_config(dconf, &headers_module); + (headers_conf *) ap_get_module_config(dconf, &headers_module); do_headers_fixup(r, serverconf->headers); do_headers_fixup(r, dirconf->headers); 1.45 +46 -46 apache-1.3/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_imap.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -r1.44 -r1.45 --- mod_imap.c 1998/03/31 12:53:13 1.44 +++ mod_imap.c 1998/04/11 12:00:47 1.45 @@ -124,7 +124,7 @@ static void *create_imap_dir_config(pool *p, char *dummy) { imap_conf_rec *icr = - (imap_conf_rec *) palloc(p, sizeof(imap_conf_rec)); + (imap_conf_rec *) ap_palloc(p, sizeof(imap_conf_rec)); icr->imap_menu = NULL; icr->imap_default = NULL; @@ -135,7 +135,7 @@ static void *merge_imap_dir_configs(pool *p, void *basev, void *addv) { - imap_conf_rec *new = (imap_conf_rec *) pcalloc(p, sizeof(imap_conf_rec)); + imap_conf_rec *new = (imap_conf_rec *) ap_pcalloc(p, sizeof(imap_conf_rec)); imap_conf_rec *base = (imap_conf_rec *) basev; imap_conf_rec *add = (imap_conf_rec *) addv; @@ -150,13 +150,13 @@ static const command_rec imap_cmds[] = { - {"ImapMenu", set_string_slot, + {"ImapMenu", ap_set_string_slot, (void *) XtOffsetOf(imap_conf_rec, imap_menu), OR_INDEXES, TAKE1, "the type of menu generated: none, formatted, semiformatted, unformatted"}, - {"ImapDefault", set_string_slot, + {"ImapDefault", ap_set_string_slot, (void *) XtOffsetOf(imap_conf_rec, imap_default), OR_INDEXES, TAKE1, "the action taken if no match: error, nocontent, referer, menu, URL"}, - {"ImapBase", set_string_slot, + {"ImapBase", ap_set_string_slot, (void *) XtOffsetOf(imap_conf_rec, imap_base), OR_INDEXES, TAKE1, "the base for all URL's: map, referer, URL (or start of)"}, {NULL} @@ -359,18 +359,18 @@ char *my_base; if (!strcasecmp(value, "map") || !strcasecmp(value, "menu")) { - return construct_url(r->pool, r->uri, r); + return ap_construct_url(r->pool, r->uri, r); } if (!strcasecmp(value, "nocontent") || !strcasecmp(value, "error")) { - return pstrdup(r->pool, value); /* these are handled elsewhere, + return ap_pstrdup(r->pool, value); /* these are handled elsewhere, so just copy them */ } if (!strcasecmp(value, "referer")) { - referer = table_get(r->headers_in, "Referer"); + referer = ap_table_get(r->headers_in, "Referer"); if (referer && *referer) { - return pstrdup(r->pool, referer); + return ap_pstrdup(r->pool, referer); } else { /* XXX: This used to do *value = '\0'; ... which is totally bogus @@ -392,25 +392,25 @@ if (*string_pos_const == ':') { /* if letters and then a colon (like http:) */ /* it's an absolute URL, so use it! */ - return pstrdup(r->pool, value); + return ap_pstrdup(r->pool, value); } if (!base || !*base) { if (value && *value) { - return pstrdup(r->pool, value); /* no base: use what is given */ + return ap_pstrdup(r->pool, value); /* no base: use what is given */ } /* no base, no value: pick a simple default */ - return construct_url(r->pool, "/", r); + return ap_construct_url(r->pool, "/", r); } /* must be a relative URL to be combined with base */ if (strchr(base, '/') == NULL && (!strncmp(value, "../", 3) || !strcmp(value, ".."))) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "invalid base directive in map file: %s", r->uri); return NULL; } - my_base = pstrdup(r->pool, base); + my_base = ap_pstrdup(r->pool, base); string_pos = my_base; while (*string_pos) { if (*string_pos == '/' && *(string_pos + 1) == '/') { @@ -466,7 +466,7 @@ value */ } else if (directory) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "invalid directory name in map file: %s", r->uri); return NULL; } @@ -482,7 +482,7 @@ with '..' */ if (value && *value) { - return pstrcat(r->pool, my_base, value, NULL); + return ap_pstrcat(r->pool, my_base, value, NULL); } return my_base; } @@ -496,7 +496,7 @@ return HTTP_NO_CONTENT; /* tell the client to keep the page it has */ } if (redirect && *redirect) { - table_setn(r->headers_out, "Location", redirect); + ap_table_setn(r->headers_out, "Location", redirect); return REDIRECT; /* must be a URL, so redirect to it */ } return SERVER_ERROR; @@ -505,14 +505,14 @@ static void menu_header(request_rec *r, char *menu) { r->content_type = "text/html"; - send_http_header(r); - hard_timeout("send menu", r); /* killed in menu_footer */ + ap_send_http_header(r); + ap_hard_timeout("send menu", r); /* killed in menu_footer */ - rvputs(r, "<html><head>\n<title>Menu for ", r->uri, + ap_rvputs(r, "<html><head>\n<title>Menu for ", r->uri, "</title>\n</head><body>\n", NULL); if (!strcasecmp(menu, "formatted")) { - rvputs(r, "<h1>Menu for ", r->uri, "</h1>\n<hr>\n\n", NULL); + ap_rvputs(r, "<h1>Menu for ", r->uri, "</h1>\n<hr>\n\n", NULL); } return; @@ -521,13 +521,13 @@ static void menu_blank(request_rec *r, char *menu) { if (!strcasecmp(menu, "formatted")) { - rputs("\n", r); + ap_rputs("\n", r); } if (!strcasecmp(menu, "semiformatted")) { - rputs("<br>\n", r); + ap_rputs("<br>\n", r); } if (!strcasecmp(menu, "unformatted")) { - rputs("\n", r); + ap_rputs("\n", r); } return; } @@ -535,13 +535,13 @@ static void menu_comment(request_rec *r, char *menu, char *comment) { if (!strcasecmp(menu, "formatted")) { - rputs("\n", r); /* print just a newline if 'formatted' */ + ap_rputs("\n", r); /* print just a newline if 'formatted' */ } if (!strcasecmp(menu, "semiformatted") && *comment) { - rvputs(r, comment, "\n", NULL); + ap_rvputs(r, comment, "\n", NULL); } if (!strcasecmp(menu, "unformatted") && *comment) { - rvputs(r, comment, "\n", NULL); + ap_rvputs(r, comment, "\n", NULL); } return; /* comments are ignored in the 'formatted' form */ @@ -554,15 +554,15 @@ really href's */ } if (!strcasecmp(menu, "formatted")) { - rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, + ap_rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } if (!strcasecmp(menu, "semiformatted")) { - rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, + ap_rvputs(r, "<pre>(Default) <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } if (!strcasecmp(menu, "unformatted")) { - rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); + ap_rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); } return; } @@ -574,23 +574,23 @@ really an href */ } if (!strcasecmp(menu, "formatted")) { - rvputs(r, "<pre> <a href=\"", href, "\">", text, + ap_rvputs(r, "<pre> <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } if (!strcasecmp(menu, "semiformatted")) { - rvputs(r, "<pre> <a href=\"", href, "\">", text, + ap_rvputs(r, "<pre> <a href=\"", href, "\">", text, "</a></pre>\n", NULL); } if (!strcasecmp(menu, "unformatted")) { - rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); + ap_rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL); } return; } static void menu_footer(request_rec *r) { - rputs("\n\n</body>\n</html>\n", r); /* finish the menu */ - kill_timeout(r); + ap_rputs("\n\n</body>\n</html>\n", r); /* finish the menu */ + ap_kill_timeout(r); } static int imap_handler(request_rec *r) @@ -612,7 +612,7 @@ char *string_pos; int showmenu = 0; - imap_conf_rec *icr = get_module_config(r->per_dir_config, &imap_module); + imap_conf_rec *icr = ap_get_module_config(r->per_dir_config, &imap_module); char *imap_menu = icr->imap_menu ? icr->imap_menu : IMAP_MENU_DEFAULT; char *imap_default = icr->imap_default @@ -625,7 +625,7 @@ return DECLINED; } - imap = pcfg_openfile(r->pool, r->filename); + imap = ap_pcfg_openfile(r->pool, r->filename); if (!imap) { return NOT_FOUND; @@ -662,7 +662,7 @@ menu_header(r, imap_menu); } - while (!cfg_getline(input, sizeof(input), imap)) { + while (!ap_cfg_getline(input, sizeof(input), imap)) { if (!input[0]) { if (showmenu) { menu_blank(r, imap_menu); @@ -791,7 +791,7 @@ if (!strcasecmp(directive, "poly")) { /* poly */ if (pointinpoly(testpoint, pointarray)) { - cfg_closefile(imap); + ap_cfg_closefile(imap); redirect = imap_url(r, base, value); if (!redirect) { return HTTP_INTERNAL_SERVER_ERROR; @@ -804,7 +804,7 @@ if (!strcasecmp(directive, "circle")) { /* circle */ if (pointincircle(testpoint, pointarray)) { - cfg_closefile(imap); + ap_cfg_closefile(imap); redirect = imap_url(r, base, value); if (!redirect) { return HTTP_INTERNAL_SERVER_ERROR; @@ -817,7 +817,7 @@ if (!strcasecmp(directive, "rect")) { /* rect */ if (pointinrect(testpoint, pointarray)) { - cfg_closefile(imap); + ap_cfg_closefile(imap); redirect = imap_url(r, base, value); if (!redirect) { return HTTP_INTERNAL_SERVER_ERROR; @@ -830,7 +830,7 @@ if (!strcasecmp(directive, "point")) { /* point */ if (is_closer(testpoint, pointarray, &closest_yet)) { - closest = pstrdup(r->pool, value); + closest = ap_pstrdup(r->pool, value); } continue; @@ -839,7 +839,7 @@ } /* nothing matched, so we get another line! */ - cfg_closefile(imap); /* we are done with the map file; close it */ + ap_cfg_closefile(imap); /* we are done with the map file; close it */ if (showmenu) { menu_footer(r); /* finish the menu and we are done */ @@ -867,17 +867,17 @@ we failed. They lose! */ need_2_fields: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "map file %s, line %d syntax error: requires at " "least two fields", r->uri, imap->line_number); /* fall through */ menu_bail: - cfg_closefile(imap); + ap_cfg_closefile(imap); if (showmenu) { /* There's not much else we can do ... we've already sent the headers * to the client. */ - rputs("\n\n[an internal server error occured]\n", r); + ap_rputs("\n\n[an internal server error occured]\n", r); menu_footer(r); return OK; } 1.81 +208 -208 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- mod_include.c 1998/04/01 14:24:34 1.80 +++ mod_include.c 1998/04/11 12:00:47 1.81 @@ -122,35 +122,35 @@ char *t; time_t date = r->request_time; - table_setn(e, "DATE_LOCAL", ht_time(r->pool, date, timefmt, 0)); - table_setn(e, "DATE_GMT", ht_time(r->pool, date, timefmt, 1)); - table_setn(e, "LAST_MODIFIED", - ht_time(r->pool, r->finfo.st_mtime, timefmt, 0)); - table_setn(e, "DOCUMENT_URI", r->uri); - table_setn(e, "DOCUMENT_PATH_INFO", r->path_info); + ap_table_setn(e, "DATE_LOCAL", ap_ht_time(r->pool, date, timefmt, 0)); + ap_table_setn(e, "DATE_GMT", ap_ht_time(r->pool, date, timefmt, 1)); + ap_table_setn(e, "LAST_MODIFIED", + ap_ht_time(r->pool, r->finfo.st_mtime, timefmt, 0)); + ap_table_setn(e, "DOCUMENT_URI", r->uri); + ap_table_setn(e, "DOCUMENT_PATH_INFO", r->path_info); #ifndef WIN32 pw = getpwuid(r->finfo.st_uid); if (pw) { - table_setn(e, "USER_NAME", pstrdup(r->pool, pw->pw_name)); + ap_table_setn(e, "USER_NAME", ap_pstrdup(r->pool, pw->pw_name)); } else { - table_setn(e, "USER_NAME", psprintf(r->pool, "user#%lu", + ap_table_setn(e, "USER_NAME", ap_psprintf(r->pool, "user#%lu", (unsigned long) r->finfo.st_uid)); } #endif /* ndef WIN32 */ if ((t = strrchr(r->filename, '/'))) { - table_setn(e, "DOCUMENT_NAME", ++t); + ap_table_setn(e, "DOCUMENT_NAME", ++t); } else { - table_setn(e, "DOCUMENT_NAME", r->uri); + ap_table_setn(e, "DOCUMENT_NAME", r->uri); } if (r->args) { - char *arg_copy = pstrdup(r->pool, r->args); + char *arg_copy = ap_pstrdup(r->pool, r->args); - unescape_url(arg_copy); - table_setn(e, "QUERY_STRING_UNESCAPED", - escape_shell_cmd(r->pool, arg_copy)); + ap_unescape_url(arg_copy); + ap_table_setn(e, "QUERY_STRING_UNESCAPED", + ap_escape_shell_cmd(r->pool, arg_copy)); } } @@ -179,7 +179,7 @@ */ #define FLUSH_BUF(r) \ { \ - rwrite(outbuf, outind, r); \ + ap_rwrite(outbuf, outind, r); \ outind = 0; \ } @@ -202,7 +202,7 @@ "mod_include.\n"); \ } \ FLUSH_BUF(r); \ - pfclose(r->pool, f); \ + ap_pfclose(r->pool, f); \ return ret; \ } \ c = (char)i; \ @@ -247,7 +247,7 @@ fprintf(stderr, "encountered error in GET_CHAR macro, " \ "mod_include.\n"); \ } \ - pfclose(p, f); \ + ap_pfclose(p, f); \ return r; \ } \ c = (char)i; \ @@ -436,7 +436,7 @@ if (dodecode) { decodehtml(tag_val); } - return pstrdup(p, tag_val); + return ap_pstrdup(p, tag_val); } static int get_directive(FILE *in, char *dest, size_t len, pool *p) @@ -513,7 +513,7 @@ start_of_var_name = in; in = strchr(in, '}'); if (in == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Missing '}' on variable \"%s\"", expansion); *next = '\0'; @@ -536,7 +536,7 @@ memcpy(var, start_of_var_name, l); var[l] = '\0'; - val = table_get(r->subprocess_env, var); + val = ap_table_get(r->subprocess_env, var); if (val) { expansion = val; l = strlen(expansion); @@ -570,7 +570,7 @@ static int include_cgi(char *s, request_rec *r) { - request_rec *rr = sub_req_lookup_uri(s, r); + request_rec *rr = ap_sub_req_lookup_uri(s, r); int rr_status; if (rr->status != HTTP_OK) { @@ -599,15 +599,15 @@ /* Run it. */ - rr_status = run_sub_req(rr); + rr_status = ap_run_sub_req(rr); if (is_HTTP_REDIRECT(rr_status)) { - char *location = table_get(rr->headers_out, "Location"); - location = escape_html(rr->pool, location); - rvputs(r, "<A HREF=\"", location, "\">", location, "</A>", NULL); + char *location = ap_table_get(rr->headers_out, "Location"); + location = ap_escape_html(rr->pool, location); + ap_rvputs(r, "<A HREF=\"", location, "\">", location, "</A>", NULL); } - destroy_sub_req(rr); - chdir_file(r->filename); + ap_destroy_sub_req(rr); + ap_chdir_file(r->filename); return 0; } @@ -658,11 +658,11 @@ "in parsed file %s"; } else { - rr = sub_req_lookup_file(parsed_string, r); + rr = ap_sub_req_lookup_file(parsed_string, r); } } else { - rr = sub_req_lookup_uri(parsed_string, r); + rr = ap_sub_req_lookup_uri(parsed_string, r); } if (!error_fmt && rr->status != HTTP_OK) { @@ -689,37 +689,37 @@ } /* see the Kludge in send_parsed_file for why */ - set_module_config(rr->request_config, &includes_module, r); + ap_set_module_config(rr->request_config, &includes_module, r); #ifdef CHARSET_EBCDIC - bsetflag(rr->connection->client, B_EBCDIC2ASCII, 0); + ap_bsetflag(rr->connection->client, B_EBCDIC2ASCII, 0); #endif - if (!error_fmt && run_sub_req(rr)) { + if (!error_fmt && ap_run_sub_req(rr)) { error_fmt = "unable to include \"%s\" in parsed file %s"; } - chdir_file(r->filename); + ap_chdir_file(r->filename); if (error_fmt) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, error_fmt, tag_val, r->filename); - rputs(error, r); + ap_rputs(error, r); } /* destroy the sub request if it's not a nested include */ if (rr != NULL - && get_module_config(rr->request_config, &includes_module) + && ap_get_module_config(rr->request_config, &includes_module) != NESTED_INCLUDE_MAGIC) { - destroy_sub_req(rr); + ap_destroy_sub_req(rr); } } else if (!strcmp(tag, "done")) { return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag include in %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } } } @@ -754,33 +754,33 @@ if (r->path_info && r->path_info[0] != '\0') { request_rec *pa_req; - table_setn(env, "PATH_INFO", escape_shell_cmd(r->pool, r->path_info)); + ap_table_setn(env, "PATH_INFO", ap_escape_shell_cmd(r->pool, r->path_info)); - pa_req = sub_req_lookup_uri(escape_uri(r->pool, r->path_info), r); + pa_req = ap_sub_req_lookup_uri(escape_uri(r->pool, r->path_info), r); if (pa_req->filename) { - table_setn(env, "PATH_TRANSLATED", - pstrcat(r->pool, pa_req->filename, pa_req->path_info, + ap_table_setn(env, "PATH_TRANSLATED", + ap_pstrcat(r->pool, pa_req->filename, pa_req->path_info, NULL)); } } if (r->args) { - char *arg_copy = pstrdup(r->pool, r->args); + char *arg_copy = ap_pstrdup(r->pool, r->args); - table_setn(env, "QUERY_STRING", r->args); - unescape_url(arg_copy); - table_setn(env, "QUERY_STRING_UNESCAPED", - escape_shell_cmd(r->pool, arg_copy)); + ap_table_setn(env, "QUERY_STRING", r->args); + ap_unescape_url(arg_copy); + ap_table_setn(env, "QUERY_STRING_UNESCAPED", + ap_escape_shell_cmd(r->pool, arg_copy)); } - error_log2stderr(r->server); + ap_error_log2stderr(r->server); #ifdef DEBUG_INCLUDE_CMD fprintf(dbg, "Attempting to exec '%s'\n", s); #endif - cleanup_for_exec(); + ap_cleanup_for_exec(); /* set shellcmd flag to pass arg to SHELL_PATH */ - child_pid = call_exec(r, s, create_environment(r->pool, env), 1); + child_pid = ap_call_exec(r, s, ap_create_environment(r->pool, env), 1); #ifdef WIN32 return (child_pid); #else @@ -814,8 +814,8 @@ return -1; } - send_fd(f, r); - pfclose(r->pool, f); /* will wait for zombie when + ap_send_fd(f, r); + ap_pfclose(r->pool, f); /* will wait for zombie when * r->pool is cleared */ return 0; @@ -836,33 +836,33 @@ if (!strcmp(tag, "cmd")) { parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 1); if (include_cmd(parsed_string, r) == -1) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "execution failure for parameter \"%s\" " "to tag exec in file %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } /* just in case some stooge changed directories */ - chdir_file(r->filename); + ap_chdir_file(r->filename); } else if (!strcmp(tag, "cgi")) { parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); if (include_cgi(parsed_string, r) == -1) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "invalid CGI ref \"%s\" in %s", tag_val, file); - rputs(error, r); + ap_rputs(error, r); } /* grumble groan */ - chdir_file(r->filename); + ap_chdir_file(r->filename); } else if (!strcmp(tag, "done")) { return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag exec in %s", tag, file); - rputs(error, r); + ap_rputs(error, r); } } @@ -878,23 +878,23 @@ return 1; } if (!strcmp(tag, "var")) { - char *val = table_get(r->subprocess_env, tag_val); + char *val = ap_table_get(r->subprocess_env, tag_val); if (val) { - rputs(val, r); + ap_rputs(val, r); } else { - rputs("(none)", r); + ap_rputs("(none)", r); } } else if (!strcmp(tag, "done")) { return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag echo in %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } } } @@ -907,8 +907,8 @@ SV *sub = Nullsv; AV *av = newAV(); - if (!(allow_options(r) & OPT_INCLUDES)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + if (!(ap_allow_options(r) & OPT_INCLUDES)) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "httpd: #perl SSI disallowed by IncludesNoExec in %s", r->filename); return DECLINED; @@ -955,10 +955,10 @@ time_t date = r->request_time; parse_string(r, tag_val, tf, MAX_STRING_LEN, 0); - table_setn(env, "DATE_LOCAL", ht_time(r->pool, date, tf, 0)); - table_setn(env, "DATE_GMT", ht_time(r->pool, date, tf, 1)); - table_setn(env, "LAST_MODIFIED", - ht_time(r->pool, r->finfo.st_mtime, tf, 0)); + ap_table_setn(env, "DATE_LOCAL", ap_ht_time(r->pool, date, tf, 0)); + ap_table_setn(env, "DATE_GMT", ap_ht_time(r->pool, date, tf, 1)); + ap_table_setn(env, "LAST_MODIFIED", + ap_ht_time(r->pool, r->finfo.st_mtime, tf, 0)); } else if (!strcmp(tag, "sizefmt")) { parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); @@ -974,10 +974,10 @@ return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag config in %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } } } @@ -989,42 +989,42 @@ char *to_send; if (!strcmp(tag, "file")) { - getparents(tag_val); /* get rid of any nasties */ - to_send = make_full_path(r->pool, "./", tag_val); + ap_getparents(tag_val); /* get rid of any nasties */ + to_send = ap_make_full_path(r->pool, "./", tag_val); if (stat(to_send, finfo) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "unable to get information about \"%s\" " "in parsed file %s", to_send, r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } return 0; } else if (!strcmp(tag, "virtual")) { - request_rec *rr = sub_req_lookup_uri(tag_val, r); + request_rec *rr = ap_sub_req_lookup_uri(tag_val, r); if (rr->status == HTTP_OK && rr->finfo.st_mode != 0) { memcpy((char *) finfo, (const char *) &rr->finfo, sizeof(struct stat)); - destroy_sub_req(rr); + ap_destroy_sub_req(rr); return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unable to get information about \"%s\" " "in parsed file %s", tag_val, r->filename); - rputs(error, r); - destroy_sub_req(rr); + ap_rputs(error, r); + ap_destroy_sub_req(rr); return -1; } } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag %s in %s", tag, directive, r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } } @@ -1048,7 +1048,7 @@ parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); if (!find_file(r, "fsize", tag, parsed_string, &finfo, error)) { if (sizefmt == SIZEFMT_KMG) { - send_size(finfo.st_size, r); + ap_send_size(finfo.st_size, r); } else { int l, x; @@ -1061,9 +1061,9 @@ l = strlen(tag); /* grrr */ for (x = 0; x < l; x++) { if (x && (!((l - x) % 3))) { - rputc(',', r); + ap_rputc(',', r); } - rputc(tag[x], r); + ap_rputc(tag[x], r); } } } @@ -1088,7 +1088,7 @@ else { parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); if (!find_file(r, "flastmod", tag, parsed_string, &finfo, error)) { - rputs(ht_time(r->pool, finfo.st_mtime, tf, 0), r); + ap_rputs(ap_ht_time(r->pool, finfo.st_mtime, tf, 0), r); } } } @@ -1099,14 +1099,14 @@ regex_t *compiled; int regex_error; - compiled = pregcomp(r->pool, rexp, REG_EXTENDED | REG_NOSUB); + compiled = ap_pregcomp(r->pool, rexp, REG_EXTENDED | REG_NOSUB); if (compiled == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unable to compile pattern \"%s\"", rexp); return -1; } regex_error = regexec(compiled, string, 0, (regmatch_t *) NULL, 0); - pregfree(r->pool, compiled); + ap_pregfree(r->pool, compiled); return (!regex_error); } @@ -1265,7 +1265,7 @@ TOKEN_DONE: /* If qs is still set, I have an unmatched ' */ if (qs) { - rputs("\nUnmatched '\n", r); + ap_rputs("\nUnmatched '\n", r); next = 0; } token->value[next] = '\0'; @@ -1299,11 +1299,11 @@ return (0); } root = current = (struct parse_node *) NULL; - expr_pool = make_sub_pool(r->pool); + expr_pool = ap_make_sub_pool(r->pool); /* Create Parse Tree */ while (1) { - new = (struct parse_node *) palloc(expr_pool, + new = (struct parse_node *) ap_palloc(expr_pool, sizeof(struct parse_node)); new->parent = new->left = new->right = (struct parse_node *) NULL; new->done = 0; @@ -1314,7 +1314,7 @@ case token_string: #ifdef DEBUG_INCLUDE - rvputs(r, " Token: string (", new->token.value, ")\n", NULL); + ap_rvputs(r, " Token: string (", new->token.value, ")\n", NULL); #endif if (current == (struct parse_node *) NULL) { root = current = new; @@ -1346,10 +1346,10 @@ current = current->right = new; break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; @@ -1357,13 +1357,13 @@ case token_and: case token_or: #ifdef DEBUG_INCLUDE - rputs(" Token: and/or\n", r); + ap_rputs(" Token: and/or\n", r); #endif if (current == (struct parse_node *) NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } /* Percolate upwards */ @@ -1385,10 +1385,10 @@ case token_lbrace: break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; @@ -1409,7 +1409,7 @@ case token_not: #ifdef DEBUG_INCLUDE - rputs(" Token: not\n", r); + ap_rputs(" Token: not\n", r); #endif if (current == (struct parse_node *) NULL) { root = current = new; @@ -1430,10 +1430,10 @@ case token_lt: break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; @@ -1459,13 +1459,13 @@ case token_le: case token_lt: #ifdef DEBUG_INCLUDE - rputs(" Token: eq/ne/ge/gt/le/lt\n", r); + ap_rputs(" Token: eq/ne/ge/gt/le/lt\n", r); #endif if (current == (struct parse_node *) NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } /* Percolate upwards */ @@ -1487,10 +1487,10 @@ case token_le: case token_lt: default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; @@ -1511,7 +1511,7 @@ case token_rbrace: #ifdef DEBUG_INCLUDE - rputs(" Token: rbrace\n", r); + ap_rputs(" Token: rbrace\n", r); #endif while (current != (struct parse_node *) NULL) { if (current->token.type == token_lbrace) { @@ -1521,17 +1521,17 @@ current = current->parent; } if (current == (struct parse_node *) NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Unmatched ')' in \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; case token_lbrace: #ifdef DEBUG_INCLUDE - rputs(" Token: lbrace\n", r); + ap_rputs(" Token: lbrace\n", r); #endif if (current == (struct parse_node *) NULL) { root = current = new; @@ -1554,10 +1554,10 @@ case token_string: case token_group: default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } break; @@ -1586,7 +1586,7 @@ switch (current->token.type) { case token_string: #ifdef DEBUG_INCLUDE - rputs(" Evaluate string\n", r); + ap_rputs(" Evaluate string\n", r); #endif parse_string(r, current->token.value, buffer, sizeof(buffer), 0); ap_cpystrn(current->token.value, buffer, sizeof(current->token.value)); @@ -1598,14 +1598,14 @@ case token_and: case token_or: #ifdef DEBUG_INCLUDE - rputs(" Evaluate and/or\n", r); + ap_rputs(" Evaluate and/or\n", r); #endif if (current->left == (struct parse_node *) NULL || current->right == (struct parse_node *) NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } if (!current->left->done) { @@ -1639,9 +1639,9 @@ } } #ifdef DEBUG_INCLUDE - rvputs(r, " Left: ", current->left->value ? "1" : "0", + ap_rvputs(r, " Left: ", current->left->value ? "1" : "0", "\n", NULL); - rvputs(r, " Right: ", current->right->value ? "1" : "0", + ap_rvputs(r, " Right: ", current->right->value ? "1" : "0", "\n", NULL); #endif if (current->token.type == token_and) { @@ -1651,7 +1651,7 @@ current->value = current->left->value || current->right->value; } #ifdef DEBUG_INCLUDE - rvputs(r, " Returning ", current->value ? "1" : "0", + ap_rvputs(r, " Returning ", current->value ? "1" : "0", "\n", NULL); #endif current->done = 1; @@ -1661,16 +1661,16 @@ case token_eq: case token_ne: #ifdef DEBUG_INCLUDE - rputs(" Evaluate eq/ne\n", r); + ap_rputs(" Evaluate eq/ne\n", r); #endif if ((current->left == (struct parse_node *) NULL) || (current->right == (struct parse_node *) NULL) || (current->left->token.type != token_string) || (current->right->token.type != token_string)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } parse_string(r, current->left->token.value, @@ -1688,14 +1688,14 @@ current->right->token.value[len - 1] = '\0'; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid rexp \"%s\" in file %s", current->right->token.value, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } #ifdef DEBUG_INCLUDE - rvputs(r, " Re Compare (", current->left->token.value, + ap_rvputs(r, " Re Compare (", current->left->token.value, ") with /", ¤t->right->token.value[1], "/\n", NULL); #endif current->value = @@ -1704,7 +1704,7 @@ } else { #ifdef DEBUG_INCLUDE - rvputs(r, " Compare (", current->left->token.value, + ap_rvputs(r, " Compare (", current->left->token.value, ") with (", current->right->token.value, ")\n", NULL); #endif current->value = @@ -1715,7 +1715,7 @@ current->value = !current->value; } #ifdef DEBUG_INCLUDE - rvputs(r, " Returning ", current->value ? "1" : "0", + ap_rvputs(r, " Returning ", current->value ? "1" : "0", "\n", NULL); #endif current->done = 1; @@ -1726,16 +1726,16 @@ case token_le: case token_lt: #ifdef DEBUG_INCLUDE - rputs(" Evaluate ge/gt/le/lt\n", r); + ap_rputs(" Evaluate ge/gt/le/lt\n", r); #endif if ((current->left == (struct parse_node *) NULL) || (current->right == (struct parse_node *) NULL) || (current->left->token.type != token_string) || (current->right->token.type != token_string)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid expression \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } parse_string(r, current->left->token.value, @@ -1747,7 +1747,7 @@ ap_cpystrn(current->right->token.value, buffer, sizeof(current->right->token.value)); #ifdef DEBUG_INCLUDE - rvputs(r, " Compare (", current->left->token.value, + ap_rvputs(r, " Compare (", current->left->token.value, ") with (", current->right->token.value, ")\n", NULL); #endif current->value = @@ -1769,7 +1769,7 @@ current->value = 0; /* Don't return -1 if unknown token */ } #ifdef DEBUG_INCLUDE - rvputs(r, " Returning ", current->value ? "1" : "0", + ap_rvputs(r, " Returning ", current->value ? "1" : "0", "\n", NULL); #endif current->done = 1; @@ -1788,7 +1788,7 @@ current->value = 0; } #ifdef DEBUG_INCLUDE - rvputs(r, " Evaluate !: ", current->value ? "1" : "0", + ap_rvputs(r, " Evaluate !: ", current->value ? "1" : "0", "\n", NULL); #endif current->done = 1; @@ -1807,7 +1807,7 @@ current->value = 1; } #ifdef DEBUG_INCLUDE - rvputs(r, " Evaluate (): ", current->value ? "1" : "0", + ap_rvputs(r, " Evaluate (): ", current->value ? "1" : "0", "\n", NULL); #endif current->done = 1; @@ -1815,30 +1815,30 @@ break; case token_lbrace: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Unmatched '(' in \"%s\" in file %s", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; case token_rbrace: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Unmatched ')' in \"%s\" in file %s\n", expr, r->filename); - rputs(error, r); + ap_rputs(error, r); goto RETURN; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "bad token type"); - rputs(error, r); + ap_rputs(error, r); goto RETURN; } } retval = (root == (struct parse_node *) NULL) ? 0 : root->value; RETURN: - destroy_pool(expr_pool); + ap_destroy_pool(expr_pool); return (retval); } @@ -1857,15 +1857,15 @@ } else if (!strcmp(tag, "done")) { if (expr == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "missing expr in if statement: %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return 1; } *printing = *conditional_status = parse_expr(r, expr, error); #ifdef DEBUG_INCLUDE - rvputs(r, "**** if conditional_status=\"", + ap_rvputs(r, "**** if conditional_status=\"", *conditional_status ? "1" : "0", "\"\n", NULL); #endif return 0; @@ -1873,14 +1873,14 @@ else if (!strcmp(tag, "expr")) { expr = tag_val; #ifdef DEBUG_INCLUDE - rvputs(r, "**** if expr=\"", expr, "\"\n", NULL); + ap_rvputs(r, "**** if expr=\"", expr, "\"\n", NULL); #endif } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag if in %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } } } @@ -1900,7 +1900,7 @@ } else if (!strcmp(tag, "done")) { #ifdef DEBUG_INCLUDE - rvputs(r, "**** elif conditional_status=\"", + ap_rvputs(r, "**** elif conditional_status=\"", *conditional_status ? "1" : "0", "\"\n", NULL); #endif if (*conditional_status) { @@ -1908,15 +1908,15 @@ return (0); } if (expr == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "missing expr in elif statement: %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return 1; } *printing = *conditional_status = parse_expr(r, expr, error); #ifdef DEBUG_INCLUDE - rvputs(r, "**** elif conditional_status=\"", + ap_rvputs(r, "**** elif conditional_status=\"", *conditional_status ? "1" : "0", "\"\n", NULL); #endif return 0; @@ -1924,14 +1924,14 @@ else if (!strcmp(tag, "expr")) { expr = tag_val; #ifdef DEBUG_INCLUDE - rvputs(r, "**** if expr=\"", expr, "\"\n", NULL); + ap_rvputs(r, "**** if expr=\"", expr, "\"\n", NULL); #endif } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "unknown parameter \"%s\" to tag if in %s", tag, r->filename); - rputs(error, r); + ap_rputs(error, r); } } } @@ -1946,7 +1946,7 @@ } else if (!strcmp(tag, "done")) { #ifdef DEBUG_INCLUDE - rvputs(r, "**** else conditional_status=\"", + ap_rvputs(r, "**** else conditional_status=\"", *conditional_status ? "1" : "0", "\"\n", NULL); #endif *printing = !(*conditional_status); @@ -1954,11 +1954,11 @@ return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "else directive does not take tags in %s", r->filename); if (*printing) { - rputs(error, r); + ap_rputs(error, r); } return -1; } @@ -1974,7 +1974,7 @@ } else if (!strcmp(tag, "done")) { #ifdef DEBUG_INCLUDE - rvputs(r, "**** endif conditional_status=\"", + ap_rvputs(r, "**** endif conditional_status=\"", *conditional_status ? "1" : "0", "\"\n", NULL); #endif *printing = 1; @@ -1982,10 +1982,10 @@ return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "endif directive does not take tags in %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } } @@ -2010,19 +2010,19 @@ } else if (!strcmp(tag, "value")) { if (var == (char *) NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "variable must precede value in set directive in %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } parse_string(r, tag_val, parsed_string, sizeof(parsed_string), 0); - table_setn(r->subprocess_env, var, pstrdup(r->pool, parsed_string)); + ap_table_setn(r->subprocess_env, var, ap_pstrdup(r->pool, parsed_string)); } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Invalid tag for set directive in %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } } @@ -2041,15 +2041,15 @@ } else if (!strcmp(tag, "done")) { for (i = 0; i < arr->nelts; ++i) { - rvputs(r, elts[i].key, "=", elts[i].val, "\n", NULL); + ap_rvputs(r, elts[i].key, "=", elts[i].val, "\n", NULL); } return 0; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "printenv directive does not take tags in %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return -1; } } @@ -2064,7 +2064,7 @@ { char directive[MAX_STRING_LEN], error[MAX_STRING_LEN]; char timefmt[MAX_STRING_LEN]; - int noexec = allow_options(r) & OPT_INCNOEXEC; + int noexec = ap_allow_options(r) & OPT_INCNOEXEC; int ret, sizefmt; int if_nesting; int printing; @@ -2078,23 +2078,23 @@ printing = conditional_status = 1; if_nesting = 0; - chdir_file(r->filename); + ap_chdir_file(r->filename); if (r->args) { /* add QUERY stuff to env cause it ain't yet */ - char *arg_copy = pstrdup(r->pool, r->args); + char *arg_copy = ap_pstrdup(r->pool, r->args); - table_setn(r->subprocess_env, "QUERY_STRING", r->args); - unescape_url(arg_copy); - table_setn(r->subprocess_env, "QUERY_STRING_UNESCAPED", - escape_shell_cmd(r->pool, arg_copy)); + ap_table_setn(r->subprocess_env, "QUERY_STRING", r->args); + ap_unescape_url(arg_copy); + ap_table_setn(r->subprocess_env, "QUERY_STRING_UNESCAPED", + ap_escape_shell_cmd(r->pool, arg_copy)); } while (1) { if (!find_string(f, STARTING_SEQUENCE, r, printing)) { if (get_directive(f, directive, sizeof(directive), r->pool)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "mod_include: error reading directive in %s", r->filename); - rputs(error, r); + ap_rputs(error, r); return; } if (!strcmp(directive, "if")) { @@ -2137,11 +2137,11 @@ } if (!strcmp(directive, "exec")) { if (noexec) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "httpd: exec used but not allowed in %s", r->filename); if (printing) { - rputs(error, r); + ap_rputs(error, r); } ret = find_string(f, ENDING_SEQUENCE, r, 0); } @@ -2176,17 +2176,17 @@ } #endif else { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "httpd: unknown directive \"%s\" " "in parsed doc %s", directive, r->filename); if (printing) { - rputs(error, r); + ap_rputs(error, r); } ret = find_string(f, ENDING_SEQUENCE, r, 0); } if (ret) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "httpd: premature EOF in parsed file %s", r->filename); return; @@ -2217,7 +2217,7 @@ static void *create_includes_dir_config(pool *p, char *dummy) { - enum xbithack *result = (enum xbithack *) palloc(p, sizeof(enum xbithack)); + enum xbithack *result = (enum xbithack *) ap_palloc(p, sizeof(enum xbithack)); *result = DEFAULT_XBITHACK; return result; } @@ -2246,11 +2246,11 @@ { FILE *f; enum xbithack *state = - (enum xbithack *) get_module_config(r->per_dir_config, &includes_module); + (enum xbithack *) ap_get_module_config(r->per_dir_config, &includes_module); int errstatus; request_rec *parent; - if (!(allow_options(r) & OPT_INCLUDES)) { + if (!(ap_allow_options(r) & OPT_INCLUDES)) { return DECLINED; } r->allowed |= (1 << M_GET); @@ -2258,16 +2258,16 @@ return DECLINED; } if (r->finfo.st_mode == 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "File does not exist: %s", (r->path_info - ? pstrcat(r->pool, r->filename, r->path_info, NULL) + ? ap_pstrcat(r->pool, r->filename, r->path_info, NULL) : r->filename)); return HTTP_NOT_FOUND; } - if (!(f = pfopen(r->pool, r->filename, "r"))) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + if (!(f = ap_pfopen(r->pool, r->filename, "r"))) { + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "file permissions deny server access: %s", r->filename); return HTTP_FORBIDDEN; } @@ -2278,21 +2278,21 @@ && (r->finfo.st_mode & S_IXGRP) #endif ) { - update_mtime(r, r->finfo.st_mtime); - set_last_modified(r); + ap_update_mtime(r, r->finfo.st_mtime); + ap_set_last_modified(r); } - if ((errstatus = meets_conditions(r)) != OK) { + if ((errstatus = ap_meets_conditions(r)) != OK) { return errstatus; } - send_http_header(r); + ap_send_http_header(r); if (r->header_only) { - pfclose(r->pool, f); + ap_pfclose(r->pool, f); return OK; } - if ((parent = get_module_config(r->request_config, &includes_module))) { + if ((parent = ap_get_module_config(r->request_config, &includes_module))) { /* Kludge --- for nested includes, we want to keep the subprocess * environment of the base document (for compatibility); that means * torquing our own last_modified date as well so that the @@ -2302,14 +2302,14 @@ * destroyed, that's dealt with in handle_include(). */ r->subprocess_env = parent->subprocess_env; - pool_join(parent->pool, r->pool); + ap_pool_join(parent->pool, r->pool); r->finfo.st_mtime = parent->finfo.st_mtime; } else { /* we're not a nested include, so we create an initial * environment */ - add_common_vars(r); - add_cgi_vars(r); + ap_add_common_vars(r); + ap_add_cgi_vars(r); add_include_vars(r, DEFAULT_TIME_FORMAT); } /* XXX: this is bogus, at some point we're going to do a subrequest, @@ -2317,22 +2317,22 @@ * expect to be signal-ready to SIGALRM. There is no clean way to * fix this, except to put alarm support into BUFF. -djg */ - hard_timeout("send SSI", r); + ap_hard_timeout("send SSI", r); #ifdef CHARSET_EBCDIC /* XXX:@@@ Is the generated/included output ALWAYS in text/ebcdic format? */ - bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, 1); #endif send_parsed_content(f, r); if (parent) { /* signify that the sub request should not be killed */ - set_module_config(r->request_config, &includes_module, + ap_set_module_config(r->request_config, &includes_module, NESTED_INCLUDE_MAGIC); } - kill_timeout(r); + ap_kill_timeout(r); return OK; } @@ -2354,7 +2354,7 @@ return DECLINED; } - state = (enum xbithack *) get_module_config(r->per_dir_config, + state = (enum xbithack *) ap_get_module_config(r->per_dir_config, &includes_module); if (*state == xbithack_off) { 1.40 +135 -135 apache-1.3/src/modules/standard/mod_info.c Index: mod_info.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_info.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- mod_info.c 1998/03/31 12:53:14 1.39 +++ mod_info.c 1998/04/11 12:00:48 1.40 @@ -107,19 +107,19 @@ static void *create_info_config(pool *p, server_rec *s) { - info_svr_conf *conf = (info_svr_conf *) pcalloc(p, sizeof(info_svr_conf)); + info_svr_conf *conf = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf)); - conf->more_info = make_array(p, 20, sizeof(info_entry)); + conf->more_info = ap_make_array(p, 20, sizeof(info_entry)); return conf; } static void *merge_info_config(pool *p, void *basev, void *overridesv) { - info_svr_conf *new = (info_svr_conf *) pcalloc(p, sizeof(info_svr_conf)); + info_svr_conf *new = (info_svr_conf *) ap_pcalloc(p, sizeof(info_svr_conf)); info_svr_conf *base = (info_svr_conf *) basev; info_svr_conf *overrides = (info_svr_conf *) overridesv; - new->more_info = append_arrays(p, overrides->more_info, base->more_info); + new->more_info = ap_append_arrays(p, overrides->more_info, base->more_info); return new; } @@ -169,20 +169,20 @@ info_cfg_lines *new, *ret, *prev; const char *t; - fp = pcfg_openfile(p, filename); + fp = ap_pcfg_openfile(p, filename); if (!fp) { - aplog_error(APLOG_MARK, APLOG_WARNING, r->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, r->server, "mod_info: couldn't open config file %s", filename); return NULL; } ret = NULL; prev = NULL; - while (!cfg_getline(s, MAX_STRING_LEN, fp)) { + while (!ap_cfg_getline(s, MAX_STRING_LEN, fp)) { if (*s == '#') { continue; /* skip comments */ } - new = palloc(p, sizeof(struct info_cfg_lines)); + new = ap_palloc(p, sizeof(struct info_cfg_lines)); new->next = NULL; if (!ret) { ret = new; @@ -191,16 +191,16 @@ prev->next = new; } t = s; - new->cmd = getword_conf(p, &t); + new->cmd = ap_getword_conf(p, &t); if (*t) { - new->line = pstrdup(p, t); + new->line = ap_pstrdup(p, t); } else { new->line = NULL; } prev = new; } - cfg_closefile(fp); + ap_cfg_closefile(fp); return (ret); } @@ -235,16 +235,16 @@ if (block_start) { if ((nest == 1 && block_start == li_st) || (nest == 2 && block_start == li_se)) { - rputs("<dd><tt>", r); + ap_rputs("<dd><tt>", r); if (nest == 2) { - rputs(" ", r); + ap_rputs(" ", r); } - rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r); - rputs(" ", r); + ap_rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r); + ap_rputs(" ", r); if (li->line) { - rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r); + ap_rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r); } - rputs("</tt>\n", r); + ap_rputs("</tt>\n", r); nest--; if (!nest) { block_start = NULL; @@ -278,9 +278,9 @@ if (cmd->name) { if (!strcasecmp(cmd->name, li->cmd)) { if (!lab) { - rputs("<dt><strong>", r); - rputs(label, r); - rputs("</strong>\n", r); + ap_rputs("<dt><strong>", r); + ap_rputs(label, r); + ap_rputs("</strong>\n", r); lab = 1; } if (((nest && block_start == NULL) || @@ -292,39 +292,39 @@ strncasecmp(li->cmd, "</location", 10) && strncasecmp(li->cmd, "</directory", 11) && strncasecmp(li->cmd, "</files", 7))) { - rputs("<dd><tt>", r); - rputs(mod_info_html_cmd_string(li_st->cmd, buf, sizeof(buf)), r); - rputs(" ", r); + ap_rputs("<dd><tt>", r); + ap_rputs(mod_info_html_cmd_string(li_st->cmd, buf, sizeof(buf)), r); + ap_rputs(" ", r); if (li_st->line) { - rputs(mod_info_html_cmd_string(li_st->line, buf, sizeof(buf)), r); + ap_rputs(mod_info_html_cmd_string(li_st->line, buf, sizeof(buf)), r); } - rputs("</tt>\n", r); + ap_rputs("</tt>\n", r); block_start = li_st; if (li_se) { - rputs("<dd><tt> ", r); - rputs(mod_info_html_cmd_string(li_se->cmd, buf, sizeof(buf)), r); - rputs(" ", r); + ap_rputs("<dd><tt> ", r); + ap_rputs(mod_info_html_cmd_string(li_se->cmd, buf, sizeof(buf)), r); + ap_rputs(" ", r); if (li_se->line) { - rputs(mod_info_html_cmd_string(li_se->line, buf, sizeof(buf)), r); + ap_rputs(mod_info_html_cmd_string(li_se->line, buf, sizeof(buf)), r); } - rputs("</tt>\n", r); + ap_rputs("</tt>\n", r); block_start = li_se; } } - rputs("<dd><tt>", r); + ap_rputs("<dd><tt>", r); if (nest) { - rputs(" ", r); + ap_rputs(" ", r); } if (nest == 2) { - rputs(" ", r); + ap_rputs(" ", r); } - rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r); + ap_rputs(mod_info_html_cmd_string(li->cmd, buf, sizeof(buf)), r); if (li->line) { - rputs(" <i>", r); - rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r); - rputs("</i>", r); + ap_rputs(" <i>", r); + ap_rputs(mod_info_html_cmd_string(li->line, buf, sizeof(buf)), r); + ap_rputs("</i>", r); } - rputs("</tt>", r); + ap_rputs("</tt>", r); } } else @@ -338,7 +338,7 @@ static char *find_more_info(server_rec *s, const char *module_name) { int i; - info_svr_conf *conf = (info_svr_conf *) get_module_config(s->module_config, + info_svr_conf *conf = (info_svr_conf *) ap_get_module_config(s->module_config, &info_module); info_entry *entry = (info_entry *) conf->more_info->elts; @@ -372,236 +372,236 @@ return DECLINED; r->content_type = "text/html"; - send_http_header(r); + ap_send_http_header(r); if (r->header_only) { return 0; } - hard_timeout("send server info", r); + ap_hard_timeout("send server info", r); - rputs("<html><head><title>Server Information</title></head>\n", r); - rputs("<body><h1 align=center>Apache Server Information</h1>\n", r); + ap_rputs("<html><head><title>Server Information</title></head>\n", r); + ap_rputs("<body><h1 align=center>Apache Server Information</h1>\n", r); if (!r->args || strcasecmp(r->args, "list")) { - cfname = server_root_relative(r->pool, server_confname); + cfname = ap_server_root_relative(r->pool, ap_server_confname); mod_info_cfg_httpd = mod_info_load_config(r->pool, cfname, r); - cfname = server_root_relative(r->pool, serv->srm_confname); + cfname = ap_server_root_relative(r->pool, serv->srm_confname); mod_info_cfg_srm = mod_info_load_config(r->pool, cfname, r); - cfname = server_root_relative(r->pool, serv->access_confname); + cfname = ap_server_root_relative(r->pool, serv->access_confname); mod_info_cfg_access = mod_info_load_config(r->pool, cfname, r); if (!r->args) { - rputs("<tt><a href=\"#server\">Server Settings</a>, ", r); + ap_rputs("<tt><a href=\"#server\">Server Settings</a>, ", r); for (modp = top_module; modp; modp = modp->next) { - rprintf(r, "<a href=\"#%s\">%s</a>", modp->name, modp->name); + ap_rprintf(r, "<a href=\"#%s\">%s</a>", modp->name, modp->name); if (modp->next) { - rputs(", ", r); + ap_rputs(", ", r); } } - rputs("</tt><hr>", r); + ap_rputs("</tt><hr>", r); } if (!r->args || !strcasecmp(r->args, "server")) { - rprintf(r, "<a name=\"server\"><strong>Server Version:</strong> " + ap_rprintf(r, "<a name=\"server\"><strong>Server Version:</strong> " "<font size=+1><tt>%s</tt></a></font><br>\n", - apapi_get_server_version()); - rprintf(r, "<strong>Server Built:</strong> " + ap_get_server_version()); + ap_rprintf(r, "<strong>Server Built:</strong> " "<font size=+1><tt>%s</tt></a></font><br>\n", - apapi_get_server_built()); - rprintf(r, "<strong>API Version:</strong> " + ap_get_server_built()); + ap_rprintf(r, "<strong>API Version:</strong> " "<tt>%d</tt><br>\n", MODULE_MAGIC_NUMBER); - rprintf(r, "<strong>Run Mode:</strong> <tt>%s</tt><br>\n", - (standalone ? "standalone" : "inetd")); - rprintf(r, "<strong>User/Group:</strong> " + ap_rprintf(r, "<strong>Run Mode:</strong> <tt>%s</tt><br>\n", + (ap_standalone ? "standalone" : "inetd")); + ap_rprintf(r, "<strong>User/Group:</strong> " "<tt>%s(%d)/%d</tt><br>\n", - user_name, (int) user_id, (int) group_id); - rprintf(r, "<strong>Hostname/port:</strong> " + ap_user_name, (int) ap_user_id, (int) ap_group_id); + ap_rprintf(r, "<strong>Hostname/port:</strong> " "<tt>%s:%u</tt><br>\n", serv->server_hostname, serv->port); - rprintf(r, "<strong>Daemons:</strong> " + ap_rprintf(r, "<strong>Daemons:</strong> " "<tt>start: %d " "min idle: %d " "max idle: %d " "max: %d</tt><br>\n", - daemons_to_start, daemons_min_free, - daemons_max_free, daemons_limit); - rprintf(r, "<strong>Max Requests:</strong> " + ap_daemons_to_start, ap_daemons_min_free, + ap_daemons_max_free, ap_daemons_limit); + ap_rprintf(r, "<strong>Max Requests:</strong> " "<tt>per child: %d " "keep alive: %s " "max per connection: %d</tt><br>\n", - max_requests_per_child, + ap_max_requests_per_child, (serv->keep_alive ? "on" : "off"), serv->keep_alive_max); - rprintf(r, "<strong>Threads:</strong> " + ap_rprintf(r, "<strong>Threads:</strong> " "<tt>per child: %d </tt><br>\n", - threads_per_child); - rprintf(r, "<strong>Excess requests:</strong> " + ap_threads_per_child); + ap_rprintf(r, "<strong>Excess requests:</strong> " "<tt>per child: %d </tt><br>\n", - excess_requests_per_child); - rprintf(r, "<strong>Timeouts:</strong> " + ap_excess_requests_per_child); + ap_rprintf(r, "<strong>Timeouts:</strong> " "<tt>connection: %d " "keep-alive: %d</tt><br>", serv->timeout, serv->keep_alive_timeout); - rprintf(r, "<strong>Server Root:</strong> " - "<tt>%s</tt><br>\n", server_root); - rprintf(r, "<strong>Config File:</strong> " - "<tt>%s</tt><br>\n", server_confname); - rprintf(r, "<strong>PID File:</strong> " - "<tt>%s</tt><br>\n", pid_fname); - rprintf(r, "<strong>Scoreboard File:</strong> " - "<tt>%s</tt><br>\n", scoreboard_fname); + ap_rprintf(r, "<strong>Server Root:</strong> " + "<tt>%s</tt><br>\n", ap_server_root); + ap_rprintf(r, "<strong>Config File:</strong> " + "<tt>%s</tt><br>\n", ap_server_confname); + ap_rprintf(r, "<strong>PID File:</strong> " + "<tt>%s</tt><br>\n", ap_pid_fname); + ap_rprintf(r, "<strong>Scoreboard File:</strong> " + "<tt>%s</tt><br>\n", ap_scoreboard_fname); } - rputs("<hr><dl>", r); + ap_rputs("<hr><dl>", r); for (modp = top_module; modp; modp = modp->next) { if (!r->args || !strcasecmp(modp->name, r->args)) { - rprintf(r, "<dt><a name=\"%s\"><strong>Module Name:</strong> " + ap_rprintf(r, "<dt><a name=\"%s\"><strong>Module Name:</strong> " "<font size=+1><tt>%s</tt></a></font>\n", modp->name, modp->name); - rputs("<dt><strong>Content handlers:</strong>", r); + ap_rputs("<dt><strong>Content handlers:</strong>", r); hand = modp->handlers; if (hand) { while (hand) { if (hand->content_type) { - rprintf(r, " <tt>%s</tt>\n", hand->content_type); + ap_rprintf(r, " <tt>%s</tt>\n", hand->content_type); } else { break; } hand++; if (hand && hand->content_type) { - rputs(",", r); + ap_rputs(",", r); } } } else { - rputs("<tt> <EM>none</EM></tt>", r); + ap_rputs("<tt> <EM>none</EM></tt>", r); } - rputs("<dt><strong>Configuration Phase Participation:</strong> \n", + ap_rputs("<dt><strong>Configuration Phase Participation:</strong> \n", r); if (modp->child_init) { - rputs("<tt>Child Init</tt>", r); + ap_rputs("<tt>Child Init</tt>", r); comma = 1; } if (modp->create_dir_config) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Create Directory Config</tt>", r); + ap_rputs("<tt>Create Directory Config</tt>", r); comma = 1; } if (modp->merge_dir_config) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Merge Directory Configs</tt>", r); + ap_rputs("<tt>Merge Directory Configs</tt>", r); comma = 1; } if (modp->create_server_config) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Create Server Config</tt>", r); + ap_rputs("<tt>Create Server Config</tt>", r); comma = 1; } if (modp->merge_server_config) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Merge Server Configs</tt>", r); + ap_rputs("<tt>Merge Server Configs</tt>", r); comma = 1; } if (modp->child_exit) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Child Exit</tt>", r); + ap_rputs("<tt>Child Exit</tt>", r); comma = 1; } if (!comma) - rputs("<tt> <EM>none</EM></tt>", r); + ap_rputs("<tt> <EM>none</EM></tt>", r); comma = 0; - rputs("<dt><strong>Request Phase Participation:</strong> \n", + ap_rputs("<dt><strong>Request Phase Participation:</strong> \n", r); if (modp->post_read_request) { - rputs("<tt>Post-Read Request</tt>", r); + ap_rputs("<tt>Post-Read Request</tt>", r); comma = 1; } if (modp->header_parser) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Header Parse</tt>", r); + ap_rputs("<tt>Header Parse</tt>", r); comma = 1; } if (modp->translate_handler) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Translate Path</tt>", r); + ap_rputs("<tt>Translate Path</tt>", r); comma = 1; } if (modp->access_checker) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Check Access</tt>", r); + ap_rputs("<tt>Check Access</tt>", r); comma = 1; } - if (modp->check_user_id) { + if (modp->ap_check_user_id) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Verify User ID</tt>", r); + ap_rputs("<tt>Verify User ID</tt>", r); comma = 1; } if (modp->auth_checker) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Verify User Access</tt>", r); + ap_rputs("<tt>Verify User Access</tt>", r); comma = 1; } if (modp->type_checker) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Check Type</tt>", r); + ap_rputs("<tt>Check Type</tt>", r); comma = 1; } if (modp->fixer_upper) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Fixups</tt>", r); + ap_rputs("<tt>Fixups</tt>", r); comma = 1; } if (modp->logger) { if (comma) { - rputs(", ", r); + ap_rputs(", ", r); } - rputs("<tt>Logging</tt>", r); + ap_rputs("<tt>Logging</tt>", r); comma = 1; } if (!comma) - rputs("<tt> <EM>none</EM></tt>", r); + ap_rputs("<tt> <EM>none</EM></tt>", r); comma = 0; - rputs("<dt><strong>Module Directives:</strong> ", r); + ap_rputs("<dt><strong>Module Directives:</strong> ", r); cmd = modp->cmds; if (cmd) { while (cmd) { if (cmd->name) { - rprintf(r, "<dd><tt>%s - <i>", + ap_rprintf(r, "<dd><tt>%s - <i>", mod_info_html_cmd_string(cmd->name, buf, sizeof(buf))); if (cmd->errmsg) { - rputs(cmd->errmsg, r); + ap_rputs(cmd->errmsg, r); } - rputs("</i></tt>\n", r); + ap_rputs("</i></tt>\n", r); } else { break; } cmd++; } - rputs("<dt><strong>Current Configuration:</strong>\n", r); + ap_rputs("<dt><strong>Current Configuration:</strong>\n", r); mod_info_module_cmds(r, mod_info_cfg_httpd, modp->cmds, "httpd.conf"); mod_info_module_cmds(r, mod_info_cfg_srm, modp->cmds, @@ -610,37 +610,37 @@ "access.conf"); } else { - rputs("<tt> none</tt>\n", r); + ap_rputs("<tt> none</tt>\n", r); } more_info = find_more_info(serv, modp->name); if (more_info) { - rputs("<dt><strong>Additional Information:</strong>\n<dd>", + ap_rputs("<dt><strong>Additional Information:</strong>\n<dd>", r); - rputs(more_info, r); + ap_rputs(more_info, r); } - rputs("<dt><hr>\n", r); + ap_rputs("<dt><hr>\n", r); if (r->args) { break; } } } if (!modp && r->args && strcasecmp(r->args, "server")) { - rputs("<b>No such module</b>\n", r); + ap_rputs("<b>No such module</b>\n", r); } } else { for (modp = top_module; modp; modp = modp->next) { - rputs(modp->name, r); + ap_rputs(modp->name, r); if (modp->next) { - rputs("<br>", r); + ap_rputs("<br>", r); } } } - rputs("</dl>\n", r); - rputs(psignature("",r), r); - rputs("</body></html>\n", r); + ap_rputs("</dl>\n", r); + ap_rputs(ap_psignature("",r), r); + ap_rputs("</body></html>\n", r); /* Done, turn off timeout, close file and return */ - kill_timeout(r); + ap_kill_timeout(r); return 0; } @@ -648,9 +648,9 @@ char *info) { server_rec *s = cmd->server; - info_svr_conf *conf = (info_svr_conf *) get_module_config(s->module_config, + info_svr_conf *conf = (info_svr_conf *) ap_get_module_config(s->module_config, &info_module); - info_entry *new = push_array(conf->more_info); + info_entry *new = ap_push_array(conf->more_info); new->name = name; new->info = info; 1.23 +8 -8 apache-1.3/src/modules/standard/mod_log_agent.c Index: mod_log_agent.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_agent.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- mod_log_agent.c 1998/03/31 12:53:15 1.22 +++ mod_log_agent.c 1998/04/11 12:00:48 1.23 @@ -77,7 +77,7 @@ static void *make_agent_log_state(pool *p, server_rec *s) { agent_log_state *cls = - (agent_log_state *) palloc(p, sizeof(agent_log_state)); + (agent_log_state *) ap_palloc(p, sizeof(agent_log_state)); cls->fname = ""; cls->agent_fd = -1; @@ -87,7 +87,7 @@ static const char *set_agent_log(cmd_parms *parms, void *dummy, char *arg) { - agent_log_state *cls = get_module_config(parms->server->module_config, + agent_log_state *cls = ap_get_module_config(parms->server->module_config, &agent_log_module); cls->fname = arg; @@ -109,7 +109,7 @@ */ int child_pid = 1; - cleanup_for_exec(); + ap_cleanup_for_exec(); signal(SIGHUP, SIG_IGN); #if defined(WIN32) child_pid = spawnl(SHELL_PATH, SHELL_PATH, "/c", (char *) cmd, NULL); @@ -127,10 +127,10 @@ static void open_agent_log(server_rec *s, pool *p) { - agent_log_state *cls = get_module_config(s->module_config, + agent_log_state *cls = ap_get_module_config(s->module_config, &agent_log_module); - char *fname = server_root_relative(p, cls->fname); + char *fname = ap_server_root_relative(p, cls->fname); if (cls->agent_fd > 0) return; /* virtual log shared w/main server */ @@ -148,7 +148,7 @@ cls->agent_fd = fileno(dummy); } else if (*cls->fname != '\0') { - if ((cls->agent_fd = popenf(p, fname, xfer_flags, xfer_mode)) < 0) { + if ((cls->agent_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) { perror("open"); fprintf(stderr, "httpd: could not open agent log file %s.\n", fname); exit(1); @@ -164,7 +164,7 @@ static int agent_log_transaction(request_rec *orig) { - agent_log_state *cls = get_module_config(orig->server->module_config, + agent_log_state *cls = ap_get_module_config(orig->server->module_config, &agent_log_module); char str[HUGE_STRING_LEN]; @@ -179,7 +179,7 @@ if (*cls->fname == '\0') /* Don't log agent */ return DECLINED; - agent = table_get(orig->headers_in, "User-Agent"); + agent = ap_table_get(orig->headers_in, "User-Agent"); if (agent != NULL) { ap_snprintf(str, sizeof(str), "%s\n", agent); write(cls->agent_fd, str, strlen(str)); 1.53 +47 -47 apache-1.3/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- mod_log_config.c 1998/03/31 12:53:15 1.52 +++ mod_log_config.c 1998/04/11 12:00:48 1.53 @@ -255,7 +255,7 @@ static char *format_integer(pool *p, int i) { - return psprintf(p, "%d", i); + return ap_psprintf(p, "%d", i); } static char *pfmt(pool *p, int i) @@ -275,7 +275,7 @@ static char *log_remote_host(request_rec *r, char *a) { - return (char *) get_remote_host(r->connection, r->per_dir_config, + return (char *) ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME); } @@ -286,7 +286,7 @@ static char *log_remote_logname(request_rec *r, char *a) { - return (char *) get_remote_logname(r); + return (char *) ap_get_remote_logname(r); } static char *log_remote_user(request_rec *r, char *a) @@ -309,8 +309,8 @@ * (note the truncation before the protocol string for HTTP/0.9 requests) * (note also that r->the_request contains the unmodified request) */ - return (r->parsed_uri.password) ? pstrcat(r->pool, r->method, " ", - unparse_uri_components(r->pool, &r->parsed_uri, 0), + return (r->parsed_uri.password) ? ap_pstrcat(r->pool, r->method, " ", + ap_unparse_uri_components(r->pool, &r->parsed_uri, 0), r->assbackwards ? NULL : " ", r->protocol, NULL) : r->the_request; } @@ -335,35 +335,35 @@ } else { long int bs; - bgetopt(r->connection->client, BO_BYTECT, &bs); - return psprintf(r->pool, "%ld", bs); + ap_bgetopt(r->connection->client, BO_BYTECT, &bs); + return ap_psprintf(r->pool, "%ld", bs); } } static char *log_header_in(request_rec *r, char *a) { - return table_get(r->headers_in, a); + return ap_table_get(r->headers_in, a); } static char *log_header_out(request_rec *r, char *a) { - char *cp = table_get(r->headers_out, a); + char *cp = ap_table_get(r->headers_out, a); if (!strcasecmp(a, "Content-type") && r->content_type) { cp = r->content_type; } if (cp) { return cp; } - return table_get(r->err_headers_out, a); + return ap_table_get(r->err_headers_out, a); } static char *log_note(request_rec *r, char *a) { - return table_get(r->notes, a); + return ap_table_get(r->notes, a); } static char *log_env_var(request_rec *r, char *a) { - return table_get(r->subprocess_env, a); + return ap_table_get(r->subprocess_env, a); } static char *log_request_time(request_rec *r, char *a) @@ -372,7 +372,7 @@ struct tm *t; char tstr[MAX_STRING_LEN]; - t = get_gmtoff(&timz); + t = ap_get_gmtoff(&timz); if (a && *a) { /* Custom format */ strftime(tstr, MAX_STRING_LEN, a, t); @@ -389,12 +389,12 @@ "%c%.2d%.2d]", sign, timz / 60, timz % 60); } - return pstrdup(r->pool, tstr); + return ap_pstrdup(r->pool, tstr); } static char *log_request_duration(request_rec *r, char *a) { - return psprintf(r->pool, "%ld", time(NULL) - r->request_time); + return ap_psprintf(r->pool, "%ld", time(NULL) - r->request_time); } /* These next two routines use the canonical name:port so that log @@ -402,17 +402,17 @@ */ static char *log_virtual_host(request_rec *r, char *a) { - return pstrdup(r->pool, r->server->server_hostname); + return ap_pstrdup(r->pool, r->server->server_hostname); } static char *log_server_port(request_rec *r, char *a) { - return psprintf(r->pool, "%u", r->server->port); + return ap_psprintf(r->pool, "%u", r->server->port); } static char *log_child_pid(request_rec *r, char *a) { - return psprintf(r->pool, "%ld", (long) getpid()); + return ap_psprintf(r->pool, "%ld", (long) getpid()); } /***************************************************************** @@ -500,7 +500,7 @@ static char *log_format_substring(pool *p, const char *start, const char *end) { - char *res = palloc(p, end - start + 1); + char *res = ap_palloc(p, end - start + 1); strncpy(res, start, end - start); res[end - start] = '\0'; @@ -564,7 +564,7 @@ case '{': ++s; - it->arg = getword(p, &s, '}'); + it->arg = ap_getword(p, &s, '}'); break; case '0': @@ -582,9 +582,9 @@ i = i * 10 + (*s) - '0'; } if (!it->conditions) { - it->conditions = make_array(p, 4, sizeof(int)); + it->conditions = ap_make_array(p, 4, sizeof(int)); } - *(int *) push_array(it->conditions) = i; + *(int *) ap_push_array(it->conditions) = i; break; default: @@ -594,7 +594,7 @@ dummy[0] = s[-1]; dummy[1] = '\0'; - return pstrcat(p, "Unrecognized LogFormat directive %", + return ap_pstrcat(p, "Unrecognized LogFormat directive %", dummy, NULL); } it->func = l->func; @@ -611,18 +611,18 @@ static array_header *parse_log_string(pool *p, const char *s, const char **err) { - array_header *a = make_array(p, 30, sizeof(log_format_item)); + array_header *a = ap_make_array(p, 30, sizeof(log_format_item)); char *res; while (*s) { - if ((res = parse_log_item(p, (log_format_item *) push_array(a), &s))) { + if ((res = parse_log_item(p, (log_format_item *) ap_push_array(a), &s))) { *err = res; return NULL; } } s = "\n"; - parse_log_item(p, (log_format_item *) push_array(a), &s); + parse_log_item(p, (log_format_item *) ap_push_array(a), &s); return a; } @@ -689,8 +689,8 @@ format = cls->format ? cls->format : default_format; - strs = palloc(r->pool, sizeof(char *) * (format->nelts)); - strl = palloc(r->pool, sizeof(int) * (format->nelts)); + strs = ap_palloc(r->pool, sizeof(char *) * (format->nelts)); + strl = ap_palloc(r->pool, sizeof(int) * (format->nelts)); items = (log_format_item *) format->elts; orig = r; @@ -714,7 +714,7 @@ flush_log(cls); } if (len >= LOG_BUFSIZE) { - str = palloc(r->pool, len + 1); + str = ap_palloc(r->pool, len + 1); for (i = 0, s = str; i < format->nelts; ++i) { memcpy(s, strs[i], strl[i]); s += strl[i]; @@ -729,7 +729,7 @@ cls->outcnt += len; } #else - str = palloc(r->pool, len + 1); + str = ap_palloc(r->pool, len + 1); for (i = 0, s = str; i < format->nelts; ++i) { memcpy(s, strs[i], strl[i]); @@ -744,7 +744,7 @@ static int multi_log_transaction(request_rec *r) { - multi_log_state *mls = get_module_config(r->server->module_config, + multi_log_state *mls = ap_get_module_config(r->server->module_config, &config_log_module); config_log_state *clsarray; int i; @@ -776,13 +776,13 @@ static void *make_config_log_state(pool *p, server_rec *s) { - multi_log_state *mls = (multi_log_state *) palloc(p, sizeof(multi_log_state)); + multi_log_state *mls = (multi_log_state *) ap_palloc(p, sizeof(multi_log_state)); - mls->config_logs = make_array(p, 1, sizeof(config_log_state)); + mls->config_logs = ap_make_array(p, 1, sizeof(config_log_state)); mls->default_format = NULL; mls->server_config_logs = NULL; - mls->formats = make_table(p, 4); - table_setn(mls->formats, "CLF", DEFAULT_LOG_FORMAT); + mls->formats = ap_make_table(p, 4); + ap_table_setn(mls->formats, "CLF", DEFAULT_LOG_FORMAT); return mls; } @@ -802,7 +802,7 @@ if (!add->default_format) { add->default_format = base->default_format; } - add->formats = overlay_tables(p, base->formats, add->formats); + add->formats = ap_overlay_tables(p, base->formats, add->formats); return add; } @@ -815,7 +815,7 @@ { const char *err_string = NULL; char *format; - multi_log_state *mls = get_module_config(cmd->server->module_config, + multi_log_state *mls = ap_get_module_config(cmd->server->module_config, &config_log_module); /* @@ -826,14 +826,14 @@ if (name != NULL) { parse_log_string(cmd->pool, fmt, &err_string); if (err_string == NULL) { - table_setn(mls->formats, name, fmt); + ap_table_setn(mls->formats, name, fmt); } } else { /* * See if we were given a name rather than a format string. */ - format = table_get(mls->formats, fmt); + format = ap_table_get(mls->formats, fmt); if (format == NULL) { format = fmt; } @@ -846,18 +846,18 @@ char *fmt) { const char *err_string = NULL; - multi_log_state *mls = get_module_config(cmd->server->module_config, + multi_log_state *mls = ap_get_module_config(cmd->server->module_config, &config_log_module); config_log_state *cls; char *format; - cls = (config_log_state *) push_array(mls->config_logs); + cls = (config_log_state *) ap_push_array(mls->config_logs); cls->fname = fn; if (!fmt) { cls->format = NULL; } else { - format = table_get(mls->formats, fmt); + format = ap_table_get(mls->formats, fmt); format = (format != NULL) ? format : fmt; cls->format = parse_log_string(cmd->pool, format, &err_string); } @@ -904,15 +904,15 @@ if (*cls->fname == '|') { piped_log *pl; - pl = open_piped_log(p, cls->fname + 1); + pl = ap_open_piped_log(p, cls->fname + 1); if (pl == NULL) { exit(1); } cls->log_fd = piped_log_write_fd(pl); } else { - char *fname = server_root_relative(p, cls->fname); - if ((cls->log_fd = popenf(p, fname, xfer_flags, xfer_mode)) < 0) { + char *fname = ap_server_root_relative(p, cls->fname); + if ((cls->log_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) { perror("open"); fprintf(stderr, "httpd: could not open transfer log file %s.\n", fname); @@ -929,7 +929,7 @@ static config_log_state *open_multi_logs(server_rec *s, pool *p) { int i; - multi_log_state *mls = get_module_config(s->module_config, + multi_log_state *mls = ap_get_module_config(s->module_config, &config_log_module); config_log_state *clsarray; const char *dummy; @@ -982,7 +982,7 @@ int i; for (; s; s = s->next) { - mls = get_module_config(s->module_config, &config_log_module); + mls = ap_get_module_config(s->module_config, &config_log_module); log_list = NULL; if (mls->config_logs->nelts) { log_list = mls->config_logs; 1.24 +12 -12 apache-1.3/src/modules/standard/mod_log_referer.c Index: mod_log_referer.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_referer.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- mod_log_referer.c 1998/03/31 12:53:16 1.23 +++ mod_log_referer.c 1998/04/11 12:00:48 1.24 @@ -79,17 +79,17 @@ static void *make_referer_log_state(pool *p, server_rec *s) { referer_log_state *cls = - (referer_log_state *) palloc(p, sizeof(referer_log_state)); + (referer_log_state *) ap_palloc(p, sizeof(referer_log_state)); cls->fname = ""; cls->referer_fd = -1; - cls->referer_ignore_list = make_array(p, 1, sizeof(char *)); + cls->referer_ignore_list = ap_make_array(p, 1, sizeof(char *)); return (void *) cls; } static const char *set_referer_log(cmd_parms *parms, void *dummy, char *arg) { - referer_log_state *cls = get_module_config(parms->server->module_config, + referer_log_state *cls = ap_get_module_config(parms->server->module_config, &referer_log_module); cls->fname = arg; @@ -99,10 +99,10 @@ static const char *add_referer_ignore(cmd_parms *parms, void *dummy, char *arg) { char **addme; - referer_log_state *cls = get_module_config(parms->server->module_config, + referer_log_state *cls = ap_get_module_config(parms->server->module_config, &referer_log_module); - addme = push_array(cls->referer_ignore_list); + addme = ap_push_array(cls->referer_ignore_list); *addme = arg; return NULL; } @@ -124,7 +124,7 @@ */ int child_pid = 1; - cleanup_for_exec(); + ap_cleanup_for_exec(); signal(SIGHUP, SIG_IGN); #if defined(WIN32) /* For OS/2 we need to use a '/' */ @@ -143,10 +143,10 @@ static void open_referer_log(server_rec *s, pool *p) { - referer_log_state *cls = get_module_config(s->module_config, + referer_log_state *cls = ap_get_module_config(s->module_config, &referer_log_module); - char *fname = server_root_relative(p, cls->fname); + char *fname = ap_server_root_relative(p, cls->fname); if (cls->referer_fd > 0) return; /* virtual log shared w/main server */ @@ -164,7 +164,7 @@ cls->referer_fd = fileno(dummy); } else if (*cls->fname != '\0') { - if ((cls->referer_fd = popenf(p, fname, xfer_flags, xfer_mode)) < 0) { + if ((cls->referer_fd = ap_popenf(p, fname, xfer_flags, xfer_mode)) < 0) { perror("open"); fprintf(stderr, "httpd: could not open referer log file %s.\n", fname); exit(1); @@ -181,7 +181,7 @@ static int referer_log_transaction(request_rec *orig) { char **ptrptr, **ptrptr2; - referer_log_state *cls = get_module_config(orig->server->module_config, + referer_log_state *cls = ap_get_module_config(orig->server->module_config, &referer_log_module); char *str; @@ -196,7 +196,7 @@ if (*cls->fname == '\0') /* Don't log referer */ return DECLINED; - referer = table_get(orig->headers_in, "Referer"); + referer = ap_table_get(orig->headers_in, "Referer"); if (referer != NULL) { @@ -219,7 +219,7 @@ } - str = pstrcat(orig->pool, referer, " -> ", r->uri, "\n", NULL); + str = ap_pstrcat(orig->pool, referer, " -> ", r->uri, "\n", NULL); write(cls->referer_fd, str, strlen(str)); } 1.39 +41 -41 apache-1.3/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -r1.38 -r1.39 --- mod_mime.c 1998/03/31 12:53:16 1.38 +++ mod_mime.c 1998/04/11 12:00:49 1.39 @@ -82,12 +82,12 @@ static void *create_mime_dir_config(pool *p, char *dummy) { mime_dir_config *new = - (mime_dir_config *) palloc(p, sizeof(mime_dir_config)); + (mime_dir_config *) ap_palloc(p, sizeof(mime_dir_config)); - new->forced_types = make_table(p, 4); - new->encoding_types = make_table(p, 4); - new->language_types = make_table(p, 4); - new->handlers = make_table(p, 4); + new->forced_types = ap_make_table(p, 4); + new->encoding_types = ap_make_table(p, 4); + new->language_types = ap_make_table(p, 4); + new->handlers = ap_make_table(p, 4); new->type = NULL; new->handler = NULL; @@ -100,15 +100,15 @@ mime_dir_config *base = (mime_dir_config *) basev; mime_dir_config *add = (mime_dir_config *) addv; mime_dir_config *new = - (mime_dir_config *) palloc(p, sizeof(mime_dir_config)); + (mime_dir_config *) ap_palloc(p, sizeof(mime_dir_config)); - new->forced_types = overlay_tables(p, add->forced_types, + new->forced_types = ap_overlay_tables(p, add->forced_types, base->forced_types); - new->encoding_types = overlay_tables(p, add->encoding_types, + new->encoding_types = ap_overlay_tables(p, add->encoding_types, base->encoding_types); - new->language_types = overlay_tables(p, add->language_types, + new->language_types = ap_overlay_tables(p, add->language_types, base->language_types); - new->handlers = overlay_tables(p, add->handlers, + new->handlers = ap_overlay_tables(p, add->handlers, base->handlers); new->type = add->type ? add->type : base->type; @@ -122,8 +122,8 @@ { if (*ext == '.') ++ext; - str_tolower(ct); - table_setn(m->forced_types, ext, ct); + ap_str_tolower(ct); + ap_table_setn(m->forced_types, ext, ct); return NULL; } @@ -132,8 +132,8 @@ { if (*ext == '.') ++ext; - str_tolower(enc); - table_setn(m->encoding_types, ext, enc); + ap_str_tolower(enc); + ap_table_setn(m->encoding_types, ext, enc); return NULL; } @@ -142,8 +142,8 @@ { if (*ext == '.') ++ext; - str_tolower(lang); - table_setn(m->language_types, ext, lang); + ap_str_tolower(lang); + ap_table_setn(m->language_types, ext, lang); return NULL; } @@ -152,8 +152,8 @@ { if (*ext == '.') ++ext; - str_tolower(hdlr); - table_setn(m->handlers, ext, hdlr); + ap_str_tolower(hdlr); + ap_table_setn(m->handlers, ext, hdlr); return NULL; } @@ -163,7 +163,7 @@ static const char *set_types_config(cmd_parms *cmd, void *dummy, char *arg) { - set_module_config(cmd->server->module_config, &mime_module, arg); + ap_set_module_config(cmd->server->module_config, &mime_module, arg); return NULL; } @@ -177,10 +177,10 @@ "a language (e.g., fr), followed by one or more file extensions"}, {"AddHandler", add_handler, NULL, OR_FILEINFO, ITERATE2, "a handler name followed by one or more file extensions"}, - {"ForceType", set_string_slot_lower, + {"ForceType", ap_set_string_slot_lower, (void *)XtOffsetOf(mime_dir_config, type), OR_FILEINFO, TAKE1, "a media type"}, - {"SetHandler", set_string_slot_lower, + {"SetHandler", ap_set_string_slot_lower, (void *)XtOffsetOf(mime_dir_config, handler), OR_FILEINFO, TAKE1, "a handler name"}, {"TypesConfig", set_types_config, NULL, RSRC_CONF, TAKE1, @@ -207,14 +207,14 @@ configfile_t *f; char l[MAX_STRING_LEN]; int x; - char *types_confname = get_module_config(s->module_config, &mime_module); + char *types_confname = ap_get_module_config(s->module_config, &mime_module); if (!types_confname) types_confname = TYPES_CONFIG_FILE; - types_confname = server_root_relative(p, types_confname); + types_confname = ap_server_root_relative(p, types_confname); - if (!(f = pcfg_openfile(p, types_confname))) { + if (!(f = ap_pcfg_openfile(p, types_confname))) { perror("fopen"); fprintf(stderr, "httpd: could not open mime types file %s\n", types_confname); @@ -222,29 +222,29 @@ } for (x = 0; x < MIME_HASHSIZE; x++) - hash_buckets[x] = make_table(p, 10); + hash_buckets[x] = ap_make_table(p, 10); - while (!(cfg_getline(l, MAX_STRING_LEN, f))) { + while (!(ap_cfg_getline(l, MAX_STRING_LEN, f))) { const char *ll = l, *ct; if (l[0] == '#') continue; - ct = getword_conf(p, &ll); + ct = ap_getword_conf(p, &ll); while (ll[0]) { - char *ext = getword_conf(p, &ll); - str_tolower(ext); /* ??? */ - table_setn(hash_buckets[hash(ext[0])], ext, ct); + char *ext = ap_getword_conf(p, &ll); + ap_str_tolower(ext); /* ??? */ + ap_table_setn(hash_buckets[hash(ext[0])], ext, ct); } } - cfg_closefile(f); + ap_cfg_closefile(f); } static int find_ct(request_rec *r) { const char *fn = strrchr(r->filename, '/'); mime_dir_config *conf = - (mime_dir_config *) get_module_config(r->per_dir_config, &mime_module); + (mime_dir_config *) ap_get_module_config(r->per_dir_config, &mime_module); char *ext, *type, *orighandler = r->handler; if (S_ISDIR(r->finfo.st_mode)) { @@ -261,40 +261,40 @@ fn = r->filename; /* Parse filename extensions, which can be in any order */ - while ((ext = getword(r->pool, &fn, '.')) && *ext) { + while ((ext = ap_getword(r->pool, &fn, '.')) && *ext) { int found = 0; /* Check for Content-Type */ - if ((type = table_get(conf->forced_types, ext)) - || (type = table_get(hash_buckets[hash(*ext)], ext))) { + if ((type = ap_table_get(conf->forced_types, ext)) + || (type = ap_table_get(hash_buckets[hash(*ext)], ext))) { r->content_type = type; found = 1; } /* Check for Content-Language */ - if ((type = table_get(conf->language_types, ext))) { + if ((type = ap_table_get(conf->language_types, ext))) { char **new; r->content_language = type; /* back compat. only */ if (!r->content_languages) - r->content_languages = make_array(r->pool, 2, sizeof(char *)); - new = (char **) push_array(r->content_languages); + r->content_languages = ap_make_array(r->pool, 2, sizeof(char *)); + new = (char **) ap_push_array(r->content_languages); *new = type; found = 1; } /* Check for Content-Encoding */ - if ((type = table_get(conf->encoding_types, ext))) { + if ((type = ap_table_get(conf->encoding_types, ext))) { if (!r->content_encoding) r->content_encoding = type; else - r->content_encoding = pstrcat(r->pool, r->content_encoding, + r->content_encoding = ap_pstrcat(r->pool, r->content_encoding, ", ", type, NULL); found = 1; } /* Check for a special handler, but not for proxy request */ - if ((type = table_get(conf->handlers, ext)) && !r->proxyreq) { + if ((type = ap_table_get(conf->handlers, ext)) && !r->proxyreq) { r->handler = type; found = 1; } 1.30 +87 -87 apache-1.3/src/modules/standard/mod_mime_magic.c Index: mod_mime_magic.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_mime_magic.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- mod_mime_magic.c 1998/03/31 12:53:17 1.29 +++ mod_mime_magic.c 1998/04/11 12:00:49 1.30 @@ -501,7 +501,7 @@ static void *create_magic_server_config(pool *p, server_rec *d) { /* allocate the config - use pcalloc because it needs to be zeroed */ - return pcalloc(p, sizeof(magic_server_config_rec)); + return ap_pcalloc(p, sizeof(magic_server_config_rec)); } static void *merge_magic_server_config(pool *p, void *basev, void *addv) @@ -509,7 +509,7 @@ magic_server_config_rec *base = (magic_server_config_rec *) basev; magic_server_config_rec *add = (magic_server_config_rec *) addv; magic_server_config_rec *new = (magic_server_config_rec *) - palloc(p, sizeof(magic_server_config_rec)); + ap_palloc(p, sizeof(magic_server_config_rec)); new->magicfile = add->magicfile ? add->magicfile : base->magicfile; new->magic = NULL; @@ -520,7 +520,7 @@ static const char *set_magicfile(cmd_parms *cmd, char *d, char *arg) { magic_server_config_rec *conf = (magic_server_config_rec *) - get_module_config(cmd->server->module_config, + ap_get_module_config(cmd->server->module_config, &mime_magic_module); if (!conf) { @@ -557,11 +557,11 @@ /* allocate a per-request structure and put it in the request record */ static magic_req_rec *magic_set_config(request_rec *r) { - magic_req_rec *req_dat = (magic_req_rec *) palloc(r->pool, + magic_req_rec *req_dat = (magic_req_rec *) ap_palloc(r->pool, sizeof(magic_req_rec)); req_dat->head = req_dat->tail = (magic_rsl *) NULL; - set_module_config(r->request_config, &mime_magic_module, req_dat); + ap_set_module_config(r->request_config, &mime_magic_module, req_dat); return req_dat; } @@ -570,12 +570,12 @@ static int magic_rsl_add(request_rec *r, char *str) { magic_req_rec *req_dat = (magic_req_rec *) - get_module_config(r->request_config, &mime_magic_module); + ap_get_module_config(r->request_config, &mime_magic_module); magic_rsl *rsl; /* make sure we have a list to put it in */ if (!req_dat) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": request config should not be NULL"); if (!(req_dat = magic_set_config(r))) { /* failure */ @@ -584,7 +584,7 @@ } /* allocate the list entry */ - rsl = (magic_rsl *) palloc(r->pool, sizeof(magic_rsl)); + rsl = (magic_rsl *) ap_palloc(r->pool, sizeof(magic_rsl)); /* fill it */ rsl->str = str; @@ -645,10 +645,10 @@ res_pos; /* position in result string */ magic_rsl *frag; /* list-traversal pointer */ magic_req_rec *req_dat = (magic_req_rec *) - get_module_config(r->request_config, &mime_magic_module); + ap_get_module_config(r->request_config, &mime_magic_module); /* allocate the result string */ - result = (char *) palloc(r->pool, len + 1); + result = (char *) ap_palloc(r->pool, len + 1); /* loop through and collect the string */ res_pos = 0; @@ -677,7 +677,7 @@ /* clean up and return */ result[res_pos] = 0; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": rsl_strdup() %d chars: %s", res_pos - 1, result); #endif return result; @@ -704,7 +704,7 @@ rsl_states state; magic_req_rec *req_dat = (magic_req_rec *) - get_module_config(r->request_config, &mime_magic_module); + ap_get_module_config(r->request_config, &mime_magic_module); /* check if we have a result */ if (!req_dat || !req_dat->head) { @@ -749,7 +749,7 @@ else { /* should not be possible */ /* abandon malfunctioning module */ - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": bad state %d (ws)", state); return DECLINED; } @@ -793,7 +793,7 @@ else { /* should not be possible */ /* abandon malfunctioning module */ - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": bad state %d (ns)", state); return DECLINED; } @@ -816,14 +816,14 @@ r->content_type = rsl_strdup(r, type_frag, type_pos, type_len); /* XXX: this could be done at config time I'm sure... but I'm * confused by all this magic_rsl stuff. -djg */ - str_tolower(r->content_type); + ap_str_tolower(r->content_type); } if (state == rsl_encoding) { r->content_encoding = rsl_strdup(r, encoding_frag, encoding_pos, encoding_len); /* XXX: this could be done at config time I'm sure... but I'm * confused by all this magic_rsl stuff. -djg */ - str_tolower(r->content_encoding); + ap_str_tolower(r->content_encoding); } /* detect memory allocation errors */ @@ -862,9 +862,9 @@ return result; } - if ((fd = popenf(r->pool, r->filename, O_RDONLY, 0)) < 0) { + if ((fd = ap_popenf(r->pool, r->filename, O_RDONLY, 0)) < 0) { /* We can't open it, but we were able to stat it. */ - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, MODNAME ": can't read `%s'", r->filename); /* let some other handler decide what the problem is */ return DECLINED; @@ -874,7 +874,7 @@ * try looking at the first HOWMANY bytes */ if ((nbytes = read(fd, (char *) buf, sizeof(buf) - 1)) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, MODNAME ": read failed: %s", r->filename); return HTTP_INTERNAL_SERVER_ERROR; } @@ -886,7 +886,7 @@ tryit(r, buf, nbytes); } - (void) pclosef(r->pool, fd); + (void) ap_pclosef(r->pool, fd); (void) magic_rsl_putchar(r, '\n'); return OK; @@ -939,12 +939,12 @@ char *fname; magic_server_config_rec *conf = (magic_server_config_rec *) - get_module_config(s->module_config, &mime_magic_module); + ap_get_module_config(s->module_config, &mime_magic_module); - fname = server_root_relative(p, conf->magicfile); - f = pfopen(p, fname, "r"); + fname = ap_server_root_relative(p, conf->magicfile); + f = ap_pfopen(p, fname, "r"); if (f == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, s, + ap_log_error(APLOG_MARK, APLOG_ERR, s, MODNAME ": can't read magic file %s", fname); return -1; } @@ -986,31 +986,31 @@ ++errs; } - (void) pfclose(p, f); + (void) ap_pfclose(p, f); #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice conf=%x file=%s m=%s m->next=%s last=%s", conf, conf->magicfile ? conf->magicfile : "NULL", conf->magic ? "set" : "NULL", (conf->magic && conf->magic->next) ? "set" : "NULL", conf->last ? "set" : "NULL"); - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice read %d lines, %d rules, %d errors", lineno, rule, errs); #endif #if MIME_MAGIC_DEBUG prevm = 0; - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice test"); for (m = conf->magic; m; m = m->next) { if (isprint((((unsigned long) m) >> 24) & 255) && isprint((((unsigned long) m) >> 16) & 255) && isprint((((unsigned long) m) >> 8) & 255) && isprint(((unsigned long) m) & 255)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice: POINTER CLOBBERED! " "m=\"%c%c%c%c\" line=%d", (((unsigned long) m) >> 24) & 255, @@ -1057,7 +1057,7 @@ case STRING: break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, s, MODNAME ": can't happen: m->type=%d", m->type); return -1; } @@ -1072,10 +1072,10 @@ struct magic *m; char *t, *s; magic_server_config_rec *conf = (magic_server_config_rec *) - get_module_config(serv->module_config, &mime_magic_module); + ap_get_module_config(serv->module_config, &mime_magic_module); /* allocate magic structure entry */ - m = (struct magic *) pcalloc(p, sizeof(struct magic)); + m = (struct magic *) ap_pcalloc(p, sizeof(struct magic)); /* append to linked list */ m->next = NULL; @@ -1105,7 +1105,7 @@ /* get offset, then skip over it */ m->offset = (int) strtol(l, &t, 0); if (l == t) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, MODNAME ": offset %s invalid", l); } l = t; @@ -1128,7 +1128,7 @@ m->in.type = BYTE; break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, MODNAME ": indirect offset type %c invalid", *l); break; } @@ -1145,7 +1145,7 @@ else t = l; if (*t++ != ')') { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, MODNAME ": missing ')' in indirect offset"); } l = t; @@ -1219,7 +1219,7 @@ l += NLEDATE; } else { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, MODNAME ": type %s invalid", l); return -1; } @@ -1283,7 +1283,7 @@ m->desc[sizeof(m->desc) - 1] = '\0'; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, serv, MODNAME ": parse line=%d m=%x next=%x cont=%d desc=%s", lineno, m, m->next, m->cont_level, m->desc); #endif /* MIME_MAGIC_DEBUG */ @@ -1326,7 +1326,7 @@ if (isspace((unsigned char) c)) break; if (p >= pmax) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, MODNAME ": string too long: %s", origs); break; } @@ -1479,7 +1479,7 @@ /* We used stat(), the only possible reason for this is that the * symlink is broken. */ - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": broken symlink (%s)", fn); return HTTP_INTERNAL_SERVER_ERROR; #endif @@ -1493,7 +1493,7 @@ case S_IFREG: break; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": invalid mode 0%o.", (unsigned int)r->finfo.st_mode); return HTTP_INTERNAL_SERVER_ERROR; } @@ -1556,11 +1556,11 @@ int need_separator = 0; union VALUETYPE p; magic_server_config_rec *conf = (magic_server_config_rec *) - get_module_config(r->server->module_config, &mime_magic_module); + ap_get_module_config(r->server->module_config, &mime_magic_module); struct magic *m; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s", conf, conf->magicfile ? conf->magicfile : "NULL", @@ -1575,7 +1575,7 @@ isprint((((unsigned long) m) >> 16) & 255) && isprint((((unsigned long) m) >> 8) & 255) && isprint(((unsigned long) m) & 255)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": match: POINTER CLOBBERED! " "m=\"%c%c%c%c\"", (((unsigned long) m) >> 24) & 255, @@ -1590,7 +1590,7 @@ for (m = conf->magic; m; m = m->next) { #if MIME_MAGIC_DEBUG rule_counter++; - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": line=%d desc=%s", m->lineno, m->desc); #endif @@ -1610,7 +1610,7 @@ while (m_cont && (m_cont->cont_level != 0)) { #if MIME_MAGIC_DEBUG rule_counter++; - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s", m_cont->lineno, m_cont, m_cont->next, m_cont->cont_level, @@ -1629,7 +1629,7 @@ /* if we get here, the main entry rule was a match */ /* this will be the last run through the loop */ #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": rule matched, line=%d type=%d %s", m->lineno, m->type, (m->type == STRING) ? m->value.s : ""); @@ -1653,7 +1653,7 @@ m = m->next; while (m && (m->cont_level != 0)) { #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": match line=%d cont=%d type=%d %s", m->lineno, m->cont_level, m->type, (m->type == STRING) ? m->value.s : ""); @@ -1697,13 +1697,13 @@ m = m->next; } #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": matched after %d rules", rule_counter); #endif return 1; /* all through */ } #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": failed after %d rules", rule_counter); #endif return 0; /* no match at all */ @@ -1750,7 +1750,7 @@ (void) magic_rsl_printf(r, m->desc, pp); return; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": invalid m->type (%d) in mprint().", m->type); return; @@ -1796,7 +1796,7 @@ ((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0])); return 1; default: - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": invalid type %d in mconvert().", m->type); return 0; } @@ -1848,7 +1848,7 @@ int matched; if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": BOINK"); return 1; } @@ -1893,7 +1893,7 @@ break; default: /* bogosity, pretend that it just wasn't a match */ - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": invalid type %d in mcheck().", m->type); return 0; } @@ -1903,7 +1903,7 @@ switch (m->reln) { case 'x': #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%lu == *any* = 1", v); #endif matched = 1; @@ -1912,7 +1912,7 @@ case '!': matched = v != l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%lu != %lu = %d", v, l, matched); #endif break; @@ -1920,7 +1920,7 @@ case '=': matched = v == l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%lu == %lu = %d", v, l, matched); #endif break; @@ -1929,14 +1929,14 @@ if (m->flag & UNSIGNED) { matched = v > l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%lu > %lu = %d", v, l, matched); #endif } else { matched = (long) v > (long) l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%ld > %ld = %d", v, l, matched); #endif } @@ -1946,14 +1946,14 @@ if (m->flag & UNSIGNED) { matched = v < l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%lu < %lu = %d", v, l, matched); #endif } else { matched = (long) v < (long) l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "%ld < %ld = %d", v, l, matched); #endif } @@ -1962,7 +1962,7 @@ case '&': matched = (v & l) == l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "((%lx & %lx) == %lx) = %d", v, l, l, matched); #endif break; @@ -1970,7 +1970,7 @@ case '^': matched = (v & l) != l; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, "((%lx & %lx) != %lx) = %d", v, l, l, matched); #endif break; @@ -1978,7 +1978,7 @@ default: /* bogosity, pretend it didn't match */ matched = 0; - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r->server, MODNAME ": mcheck: can't happen: invalid relation %d.", m->reln); break; @@ -2159,7 +2159,7 @@ return (child_pid); #else execvp(compr[parm->method].argv[0], compr[parm->method].argv); - aplog_error(APLOG_MARK, APLOG_ERR, parm->r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, parm->r->server, MODNAME ": could not execute `%s'.", compr[parm->method].argv[0]); return -1; @@ -2182,30 +2182,30 @@ * there are cases (i.e. generating directory indicies with mod_autoindex) * where we would end up with LOTS of zombies. */ - sub_pool = make_sub_pool(r->pool); + sub_pool = ap_make_sub_pool(r->pool); if (!spawn_child(sub_pool, uncompress_child, &parm, kill_always, &fin, &fout)) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, MODNAME ": couldn't spawn uncompress process: %s", r->uri); return -1; } if (write(fileno(fin), old, n) != n) { - destroy_pool(sub_pool); - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_destroy_pool(sub_pool); + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, MODNAME ": write failed."); return -1; } - pfclose(sub_pool, fin); - *newch = (unsigned char *) palloc(r->pool, n); + ap_pfclose(sub_pool, fin); + *newch = (unsigned char *) ap_palloc(r->pool, n); if ((n = read(fileno(fout), *newch, n)) <= 0) { - destroy_pool(sub_pool); - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_destroy_pool(sub_pool); + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, MODNAME ": read failed %s", r->filename); return -1; } - destroy_pool(sub_pool); + ap_destroy_pool(sub_pool); return n; } @@ -2308,7 +2308,7 @@ request_rec *sub; #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": revision_suffix checking %s", r->filename); #endif /* MIME_MAGIC_DEBUG */ @@ -2325,32 +2325,32 @@ /* perform sub-request for the file name without the suffix */ result = 0; - sub_filename = pstrndup(r->pool, r->filename, suffix_pos); + sub_filename = ap_pstrndup(r->pool, r->filename, suffix_pos); #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": subrequest lookup for %s", sub_filename); #endif /* MIME_MAGIC_DEBUG */ - sub = sub_req_lookup_file(sub_filename, r); + sub = ap_sub_req_lookup_file(sub_filename, r); /* extract content type/encoding/language from sub-request */ if (sub->content_type) { - r->content_type = pstrdup(r->pool, sub->content_type); + r->content_type = ap_pstrdup(r->pool, sub->content_type); #if MIME_MAGIC_DEBUG - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": subrequest %s got %s", sub_filename, r->content_type); #endif /* MIME_MAGIC_DEBUG */ if (sub->content_encoding) r->content_encoding = - pstrdup(r->pool, sub->content_encoding); + ap_pstrdup(r->pool, sub->content_encoding); if (sub->content_language) r->content_language = - pstrdup(r->pool, sub->content_language); + ap_pstrdup(r->pool, sub->content_language); result = 1; } /* clean up */ - destroy_sub_req(sub); + ap_destroy_sub_req(sub); return result; } @@ -2369,9 +2369,9 @@ struct magic *m, *prevm; #endif /* MIME_MAGIC_DEBUG */ - main_conf = get_module_config(main_server->module_config, &mime_magic_module); + main_conf = ap_get_module_config(main_server->module_config, &mime_magic_module); for (s = main_server; s; s = s->next) { - conf = get_module_config(s->module_config, &mime_magic_module); + conf = ap_get_module_config(s->module_config, &mime_magic_module); if (conf->magicfile == NULL && s != main_server) { /* inherits from the parent */ *conf = *main_conf; @@ -2382,14 +2382,14 @@ return; #if MIME_MAGIC_DEBUG prevm = 0; - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": magic_init 1 test"); for (m = conf->magic; m; m = m->next) { if (isprint((((unsigned long) m) >> 24) & 255) && isprint((((unsigned long) m) >> 16) & 255) && isprint((((unsigned long) m) >> 8) & 255) && isprint(((unsigned long) m) & 255)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": magic_init 1: POINTER CLOBBERED! " "m=\"%c%c%c%c\" line=%d", (((unsigned long) m) >> 24) & 255, @@ -2425,7 +2425,7 @@ return DECLINED; } - conf = get_module_config(r->server->module_config, &mime_magic_module); + conf = ap_get_module_config(r->server->module_config, &mime_magic_module); if (!conf || !conf->magic) { return DECLINED; } 1.77 +91 -91 apache-1.3/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- mod_negotiation.c 1998/03/31 12:53:18 1.76 +++ mod_negotiation.c 1998/04/11 12:00:49 1.77 @@ -94,16 +94,16 @@ char *t = ""; for (i = 0; i < arr->nelts; i++) { - t = pstrcat(p, t, (i ? sep : ""), ((char **) arr->elts)[i], NULL); + t = ap_pstrcat(p, t, (i ? sep : ""), ((char **) arr->elts)[i], NULL); } return t; } static void *create_neg_dir_config(pool *p, char *dummy) { - neg_dir_config *new = (neg_dir_config *) palloc(p, sizeof(neg_dir_config)); + neg_dir_config *new = (neg_dir_config *) ap_palloc(p, sizeof(neg_dir_config)); - new->language_priority = make_array(p, 4, sizeof(char *)); + new->language_priority = ap_make_array(p, 4, sizeof(char *)); return new; } @@ -111,10 +111,10 @@ { neg_dir_config *base = (neg_dir_config *) basev; neg_dir_config *add = (neg_dir_config *) addv; - neg_dir_config *new = (neg_dir_config *) palloc(p, sizeof(neg_dir_config)); + neg_dir_config *new = (neg_dir_config *) ap_palloc(p, sizeof(neg_dir_config)); /* give priority to the config in the subdirectory */ - new->language_priority = append_arrays(p, add->language_priority, + new->language_priority = ap_append_arrays(p, add->language_priority, base->language_priority); return new; } @@ -122,7 +122,7 @@ static const char *set_language_priority(cmd_parms *cmd, void *n, char *lang) { array_header *arr = ((neg_dir_config *) n)->language_priority; - char **langp = (char **) push_array(arr); + char **langp = (char **) ap_push_array(arr); *langp = lang; return NULL; @@ -133,13 +133,13 @@ { void *server_conf = cmd->server->module_config; - set_module_config(server_conf, &negotiation_module, "Cache"); + ap_set_module_config(server_conf, &negotiation_module, "Cache"); return NULL; } static int do_cache_negotiated_docs(server_rec *s) { - return (get_module_config(s->module_config, &negotiation_module) != NULL); + return (ap_get_module_config(s->module_config, &negotiation_module) != NULL); } static const command_rec negotiation_cmds[] = @@ -315,8 +315,8 @@ * in the CERN server code? I must be missing something). */ - result->type_name = get_token(p, &accept_line, 0); - str_tolower(result->type_name); /* You want case-insensitive, + result->type_name = ap_get_token(p, &accept_line, 0); + ap_str_tolower(result->type_name); /* You want case-insensitive, * you'll *get* case-insensitive. */ @@ -342,7 +342,7 @@ char *end; ++accept_line; - parm = get_token(p, &accept_line, 1); + parm = ap_get_token(p, &accept_line, 1); /* Look for 'var = value' --- and make sure the var is in lcase. */ @@ -371,7 +371,7 @@ if (*end) { *end = '\0'; /* strip ending quote or return */ } - str_tolower(cp); + ap_str_tolower(cp); if (parm[0] == 'q' && (parm[1] == '\0' || (parm[1] == 's' && parm[2] == '\0'))) { @@ -411,14 +411,14 @@ static array_header *do_header_line(pool *p, char *accept_line) { - array_header *accept_recs = make_array(p, 40, sizeof(accept_rec)); + array_header *accept_recs = ap_make_array(p, 40, sizeof(accept_rec)); if (!accept_line) { return accept_recs; } while (*accept_line) { - accept_rec *new = (accept_rec *) push_array(accept_recs); + accept_rec *new = (accept_rec *) ap_push_array(accept_recs); accept_line = get_entry(p, new, accept_line); } @@ -431,16 +431,16 @@ static array_header *do_languages_line(pool *p, char **lang_line) { - array_header *lang_recs = make_array(p, 2, sizeof(char *)); + array_header *lang_recs = ap_make_array(p, 2, sizeof(char *)); if (!lang_line) { return lang_recs; } while (**lang_line) { - char **new = (char **) push_array(lang_recs); - *new = get_token(p, lang_line, 0); - str_tolower(*new); + char **new = (char **) ap_push_array(lang_recs); + *new = ap_get_token(p, lang_line, 0); + ap_str_tolower(*new); if (**lang_line == ',' || **lang_line == ';') { ++(*lang_line); } @@ -456,7 +456,7 @@ static negotiation_state *parse_accept_headers(request_rec *r) { - negotiation_state *new = (negotiation_state *) pcalloc(r->pool, + negotiation_state *new = (negotiation_state *) ap_pcalloc(r->pool, sizeof(negotiation_state)); accept_rec *elts; table *hdrs = r->headers_in; @@ -465,24 +465,24 @@ new->pool = r->pool; new->r = r; - new->dir_name = make_dirstr_parent(r->pool, r->filename); + new->dir_name = ap_make_dirstr_parent(r->pool, r->filename); - new->accepts = do_header_line(r->pool, table_get(hdrs, "Accept")); + new->accepts = do_header_line(r->pool, ap_table_get(hdrs, "Accept")); - hdr = table_get(hdrs, "Accept-encoding"); + hdr = ap_table_get(hdrs, "Accept-encoding"); if (hdr) { new->have_accept_header = 1; } new->accept_encodings = do_header_line(r->pool, hdr); new->accept_langs = do_header_line(r->pool, - table_get(hdrs, "Accept-language")); + ap_table_get(hdrs, "Accept-language")); new->accept_charsets = do_header_line(r->pool, - table_get(hdrs, "Accept-charset")); - new->avail_vars = make_array(r->pool, 40, sizeof(var_rec)); + ap_table_get(hdrs, "Accept-charset")); + new->avail_vars = ap_make_array(r->pool, 40, sizeof(var_rec)); #ifdef TCN_02 - if (table_get(r->headers_in, "Negotiate")) { + if (ap_table_get(r->headers_in, "Negotiate")) { /* Negotiate: header tells us UA does transparent negotiation * We have to decide whether we want to ... for now, yes, * we do */ @@ -534,7 +534,7 @@ static void maybe_add_default_encodings(negotiation_state *neg, int prefer_scripts) { - accept_rec *new_accept = (accept_rec *) push_array(neg->accepts); + accept_rec *new_accept = (accept_rec *) ap_push_array(neg->accepts); new_accept->type_name = CGI_MAGIC_TYPE; new_accept->quality = prefer_scripts ? 1e-20f : 1e20f; @@ -545,7 +545,7 @@ return; } - new_accept = (accept_rec *) push_array(neg->accepts); + new_accept = (accept_rec *) ap_push_array(neg->accepts); new_accept->type_name = "*/*"; new_accept->quality = 1.0f; @@ -681,7 +681,7 @@ } if (!*cp) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Syntax error in type map --- no ':': %s", r->filename); return NULL; } @@ -691,7 +691,7 @@ } while (*cp && isspace(*cp)); if (!*cp) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Syntax error in type map --- no header body: %s", r->filename); return NULL; @@ -714,9 +714,9 @@ if (rr->status != HTTP_OK) { return rr->status; } - map = pfopen(neg->pool, rr->filename, "r"); + map = ap_pfopen(neg->pool, rr->filename, "r"); if (map == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "cannot access type map file: %s", rr->filename); return HTTP_FORBIDDEN; } @@ -736,7 +736,7 @@ strip_paren_comments(body); if (!strncmp(buffer, "uri:", 4)) { - mime_info.file_name = get_token(neg->pool, &body, 0); + mime_info.file_name = ap_get_token(neg->pool, &body, 0); } else if (!strncmp(buffer, "content-type:", 13)) { struct accept_rec accept_info; @@ -752,15 +752,15 @@ &body); } else if (!strncmp(buffer, "content-encoding:", 17)) { - mime_info.content_encoding = get_token(neg->pool, &body, 0); + mime_info.content_encoding = ap_get_token(neg->pool, &body, 0); } else if (!strncmp(buffer, "description:", 12)) { - mime_info.description = get_token(neg->pool, &body, 0); + mime_info.description = ap_get_token(neg->pool, &body, 0); } } else { if (mime_info.type_quality > 0 && *mime_info.file_name) { - void *new_var = push_array(neg->avail_vars); + void *new_var = ap_push_array(neg->avail_vars); memcpy(new_var, (void *) &mime_info, sizeof(var_rec)); } @@ -769,7 +769,7 @@ } } while (hstate != header_eof); - pfclose(neg->pool, map); + ap_pfclose(neg->pool, map); return OK; } @@ -803,10 +803,10 @@ ++filp; prefix_len = strlen(filp); - dirp = popendir(neg->pool, neg->dir_name); + dirp = ap_popendir(neg->pool, neg->dir_name); if (dirp == NULL) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "cannot read directory for multi: %s", neg->dir_name); return HTTP_FORBIDDEN; } @@ -828,7 +828,7 @@ * which we'll be slapping default_type on later). */ - sub_req = sub_req_lookup_file(dir_entry->d_name, r); + sub_req = ap_sub_req_lookup_file(dir_entry->d_name, r); /* If it has a handler, we'll pretend it's a CGI script, * since that's a good indication of the sort of thing it @@ -839,7 +839,7 @@ } if (sub_req->status != HTTP_OK || !sub_req->content_type) { - destroy_sub_req(sub_req); + ap_destroy_sub_req(sub_req); continue; } @@ -852,7 +852,7 @@ ((sub_req->handler) && !strcmp(sub_req->handler, "type-map"))) { - pclosedir(neg->pool, dirp); + ap_pclosedir(neg->pool, dirp); neg->avail_vars->nelts = 0; return read_type_map(neg, sub_req); } @@ -861,7 +861,7 @@ */ mime_info.sub_req = sub_req; - mime_info.file_name = pstrdup(neg->pool, dir_entry->d_name); + mime_info.file_name = ap_pstrdup(neg->pool, dir_entry->d_name); if (sub_req->content_encoding) { mime_info.content_encoding = sub_req->content_encoding; } @@ -872,7 +872,7 @@ get_entry(neg->pool, &accept_info, sub_req->content_type); set_mime_fields(&mime_info, &accept_info); - new_var = push_array(neg->avail_vars); + new_var = ap_push_array(neg->avail_vars); memcpy(new_var, (void *) &mime_info, sizeof(var_rec)); neg->count_multiviews_variants++; @@ -880,7 +880,7 @@ clean_var_rec(&mime_info); } - pclosedir(neg->pool, dirp); + ap_pclosedir(neg->pool, dirp); return OK; } @@ -1137,7 +1137,7 @@ char *firstlang; if (naccept == 0) { - conf = (neg_dir_config *) get_module_config(neg->r->per_dir_config, + conf = (neg_dir_config *) ap_get_module_config(neg->r->per_dir_config, &negotiation_module); } @@ -1291,7 +1291,7 @@ struct stat statb; if (variant->bytes == 0) { - char *fullname = make_full_path(neg->pool, neg->dir_name, + char *fullname = ap_make_full_path(neg->pool, neg->dir_name, variant->file_name); if (stat(fullname, &statb) >= 0) { @@ -1845,10 +1845,10 @@ } } - rec = pstrcat(r->pool, "{\"", variant->file_name, "\" ", qstr, NULL); + rec = ap_pstrcat(r->pool, "{\"", variant->file_name, "\" ", qstr, NULL); if (variant->type_name) { if (*variant->type_name) { - rec = pstrcat(r->pool, rec, " {type ", + rec = ap_pstrcat(r->pool, rec, " {type ", variant->type_name, "}", NULL); } if (!sample_type) { @@ -1861,7 +1861,7 @@ if (variant->content_languages && variant->content_languages->nelts) { char *langs = merge_string_array(r->pool, variant->content_languages, ","); - rec = pstrcat(r->pool, rec, " {language ", langs, "}", NULL); + rec = ap_pstrcat(r->pool, rec, " {language ", langs, "}", NULL); if (!sample_language) { sample_language = langs; } @@ -1879,7 +1879,7 @@ } if (variant->content_charset) { if (*variant->content_charset) { - rec = pstrcat(r->pool, rec, " {charset ", + rec = ap_pstrcat(r->pool, rec, " {charset ", variant->content_charset, "}", NULL); } if (!sample_charset) { @@ -1891,30 +1891,30 @@ } if ((len = find_content_length(neg, variant)) != 0) { ap_snprintf(lenstr, sizeof(lenstr), "%ld", len); - rec = pstrcat(r->pool, rec, " {length ", lenstr, "}", NULL); + rec = ap_pstrcat(r->pool, rec, " {length ", lenstr, "}", NULL); } - rec = pstrcat(r->pool, rec, "}", NULL); + rec = ap_pstrcat(r->pool, rec, "}", NULL); if (na_result != na_not_applied) { - table_mergen(hdrs, "Alternates", rec); + ap_table_mergen(hdrs, "Alternates", rec); } } if (na_result != na_not_applied) { - table_mergen(hdrs, "Vary", "negotiate"); + ap_table_mergen(hdrs, "Vary", "negotiate"); } if (vary_by_type) { - table_mergen(hdrs, "Vary", "accept"); + ap_table_mergen(hdrs, "Vary", "accept"); } if (vary_by_language) { - table_mergen(hdrs, "Vary", "accept-language"); + ap_table_mergen(hdrs, "Vary", "accept-language"); } if (vary_by_charset) { - table_mergen(hdrs, "Vary", "accept-charset"); + ap_table_mergen(hdrs, "Vary", "accept-charset"); } if (vary_by_encoding && na_result == na_not_applied) { - table_mergen(hdrs, "Vary", "accept-encoding"); + ap_table_mergen(hdrs, "Vary", "accept-encoding"); } } @@ -1930,7 +1930,7 @@ int i; char *t; - t = pstrdup(r->pool, "Available variants:\n<ul>\n"); + t = ap_pstrdup(r->pool, "Available variants:\n<ul>\n"); for (i = 0; i < neg->avail_vars->nelts; ++i) { var_rec *variant = &((var_rec *) neg->avail_vars->elts)[i]; char *filename = variant->file_name ? variant->file_name : ""; @@ -1940,23 +1940,23 @@ /* The format isn't very neat, and it would be nice to make * the tags human readable (eg replace 'language en' with * 'English'). */ - t = pstrcat(r->pool, t, "<li><a href=\"", filename, "\">", + t = ap_pstrcat(r->pool, t, "<li><a href=\"", filename, "\">", filename, "</a> ", description, NULL); if (variant->type_name && *variant->type_name) { - t = pstrcat(r->pool, t, ", type ", variant->type_name, NULL); + t = ap_pstrcat(r->pool, t, ", type ", variant->type_name, NULL); } if (languages && languages->nelts) { - t = pstrcat(r->pool, t, ", language ", + t = ap_pstrcat(r->pool, t, ", language ", merge_string_array(r->pool, languages, ", "), NULL); } if (variant->content_charset && *variant->content_charset) { - t = pstrcat(r->pool, t, ", charset ", variant->content_charset, + t = ap_pstrcat(r->pool, t, ", charset ", variant->content_charset, NULL); } - t = pstrcat(r->pool, t, "\n", NULL); + t = ap_pstrcat(r->pool, t, "\n", NULL); } - t = pstrcat(r->pool, t, "</ul>\n", NULL); + t = ap_pstrcat(r->pool, t, "</ul>\n", NULL); return t; } @@ -1964,10 +1964,10 @@ static void store_variant_list(request_rec *r, negotiation_state *neg) { if (r->main == NULL) { - table_setn(r->notes, "variant-list", make_variant_list(r, neg)); + ap_table_setn(r->notes, "variant-list", make_variant_list(r, neg)); } else { - table_setn(r->main->notes, "variant-list", + ap_table_setn(r->main->notes, "variant-list", make_variant_list(r->main, neg)); } } @@ -1986,10 +1986,10 @@ if (!variant->sub_req) { int status; - sub_req = sub_req_lookup_file(variant->file_name, r); + sub_req = ap_sub_req_lookup_file(variant->file_name, r); status = sub_req->status; if (status != HTTP_OK && status != HTTP_MULTIPLE_CHOICES) { - destroy_sub_req(sub_req); + ap_destroy_sub_req(sub_req); return status; } variant->sub_req = sub_req; @@ -2007,16 +2007,16 @@ */ if ((sub_req->status == HTTP_MULTIPLE_CHOICES) || - (table_get(sub_req->err_headers_out, "Alternates")) || - (table_get(sub_req->err_headers_out, "Content-Location"))) { + (ap_table_get(sub_req->err_headers_out, "Alternates")) || + (ap_table_get(sub_req->err_headers_out, "Content-Location"))) { return VARIANT_ALSO_VARIES; } - if ((sub_vary = table_get(sub_req->err_headers_out, "Vary")) != NULL) { - table_setn(r->err_headers_out, "Variant-Vary", sub_vary); + if ((sub_vary = ap_table_get(sub_req->err_headers_out, "Vary")) != NULL) { + ap_table_setn(r->err_headers_out, "Variant-Vary", sub_vary); } - table_setn(r->err_headers_out, "Content-Location", - pstrdup(r->pool, variant->file_name)); + ap_table_setn(r->err_headers_out, "Content-Location", + ap_pstrdup(r->pool, variant->file_name)); set_neg_headers(r, neg, na_choice); /* add Alternates and Vary */ /* to do: add Expires */ @@ -2058,7 +2058,7 @@ } if (!best) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "no acceptable variant: %s", r->filename); set_neg_headers(r, neg, na_result); @@ -2085,11 +2085,11 @@ } if (r->path_info && *r->path_info) { - r->uri[find_path_info(r->uri, r->path_info)] = '\0'; + r->uri[ap_find_path_info(r->uri, r->path_info)] = '\0'; } - udir = make_dirstr_parent(r->pool, r->uri); + udir = ap_make_dirstr_parent(r->pool, r->uri); udir = escape_uri(r->pool, udir); - internal_redirect(pstrcat(r->pool, udir, best->file_name, r->path_info, + ap_internal_redirect(ap_pstrcat(r->pool, udir, best->file_name, r->path_info, NULL), r); return OK; } @@ -2103,7 +2103,7 @@ int j; int na_result; /* result of network algorithm */ - if (r->finfo.st_mode != 0 || !(allow_options(r) & OPT_MULTI)) { + if (r->finfo.st_mode != 0 || !(ap_allow_options(r) & OPT_MULTI)) { return DECLINED; } @@ -2116,7 +2116,7 @@ for (j = 0; j < neg->avail_vars->nelts; ++j) { var_rec *variant = &avail_recs[j]; if (variant->sub_req) { - destroy_sub_req(variant->sub_req); + ap_destroy_sub_req(variant->sub_req); } } return res; @@ -2145,7 +2145,7 @@ } if (!best) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "no acceptable variant: %s", r->filename); set_neg_headers(r, neg, na_result); @@ -2165,10 +2165,10 @@ * a sub_req structure yet. Get one now. */ - sub_req = sub_req_lookup_file(best->file_name, r); + sub_req = ap_sub_req_lookup_file(best->file_name, r); if (sub_req->status != HTTP_OK) { res = sub_req->status; - destroy_sub_req(sub_req); + ap_destroy_sub_req(sub_req); goto return_from_multi; } } @@ -2197,7 +2197,7 @@ * some values in this request will be allocated in r->pool, and others in * sub_req->pool. */ - pool_join(r->pool, sub_req->pool); + ap_pool_join(r->pool, sub_req->pool); r->filename = sub_req->filename; r->handler = sub_req->handler; r->content_type = sub_req->content_type; @@ -2209,18 +2209,18 @@ r->finfo = sub_req->finfo; r->per_dir_config = sub_req->per_dir_config; /* copy output headers from subrequest, but leave negotiation headers */ - r->notes = overlay_tables(r->pool, sub_req->notes, r->notes); - r->headers_out = overlay_tables(r->pool, sub_req->headers_out, + r->notes = ap_overlay_tables(r->pool, sub_req->notes, r->notes); + r->headers_out = ap_overlay_tables(r->pool, sub_req->headers_out, r->headers_out); - r->err_headers_out = overlay_tables(r->pool, sub_req->err_headers_out, + r->err_headers_out = ap_overlay_tables(r->pool, sub_req->err_headers_out, r->err_headers_out); - r->subprocess_env = overlay_tables(r->pool, sub_req->subprocess_env, + r->subprocess_env = ap_overlay_tables(r->pool, sub_req->subprocess_env, r->subprocess_env); avail_recs = (var_rec *) neg->avail_vars->elts; for (j = 0; j < neg->avail_vars->nelts; ++j) { var_rec *variant = &avail_recs[j]; if (variant != best && variant->sub_req) { - destroy_sub_req(variant->sub_req); + ap_destroy_sub_req(variant->sub_req); } } return OK; 1.101 +185 -185 apache-1.3/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -r1.100 -r1.101 --- mod_rewrite.c 1998/04/08 06:40:24 1.100 +++ mod_rewrite.c 1998/04/11 12:00:50 1.101 @@ -231,7 +231,7 @@ { rewrite_server_conf *a; - a = (rewrite_server_conf *)pcalloc(p, sizeof(rewrite_server_conf)); + a = (rewrite_server_conf *)ap_pcalloc(p, sizeof(rewrite_server_conf)); a->state = ENGINE_DISABLED; a->options = OPTION_NONE; @@ -240,9 +240,9 @@ a->rewriteloglevel = 0; a->rewritelockfile = NULL; a->rewritelockfp = -1; - a->rewritemaps = make_array(p, 2, sizeof(rewritemap_entry)); - a->rewriteconds = make_array(p, 2, sizeof(rewritecond_entry)); - a->rewriterules = make_array(p, 2, sizeof(rewriterule_entry)); + a->rewritemaps = ap_make_array(p, 2, sizeof(rewritemap_entry)); + a->rewriteconds = ap_make_array(p, 2, sizeof(rewritecond_entry)); + a->rewriterules = ap_make_array(p, 2, sizeof(rewriterule_entry)); a->server = s; return (void *)a; @@ -252,7 +252,7 @@ { rewrite_server_conf *a, *base, *overrides; - a = (rewrite_server_conf *)pcalloc(p, sizeof(rewrite_server_conf)); + a = (rewrite_server_conf *)ap_pcalloc(p, sizeof(rewrite_server_conf)); base = (rewrite_server_conf *)basev; overrides = (rewrite_server_conf *)overridesv; @@ -275,11 +275,11 @@ overrides->rewritelockfile : base->rewritelockfile; a->rewritelockfp = overrides->rewritelockfp != -1 ? overrides->rewritelockfp : base->rewritelockfp; - a->rewritemaps = append_arrays(p, overrides->rewritemaps, + a->rewritemaps = ap_append_arrays(p, overrides->rewritemaps, base->rewritemaps); - a->rewriteconds = append_arrays(p, overrides->rewriteconds, + a->rewriteconds = ap_append_arrays(p, overrides->rewriteconds, base->rewriteconds); - a->rewriterules = append_arrays(p, overrides->rewriterules, + a->rewriterules = ap_append_arrays(p, overrides->rewriterules, base->rewriterules); } else { @@ -311,22 +311,22 @@ { rewrite_perdir_conf *a; - a = (rewrite_perdir_conf *)pcalloc(p, sizeof(rewrite_perdir_conf)); + a = (rewrite_perdir_conf *)ap_pcalloc(p, sizeof(rewrite_perdir_conf)); a->state = ENGINE_DISABLED; a->options = OPTION_NONE; a->baseurl = NULL; - a->rewriteconds = make_array(p, 2, sizeof(rewritecond_entry)); - a->rewriterules = make_array(p, 2, sizeof(rewriterule_entry)); + a->rewriteconds = ap_make_array(p, 2, sizeof(rewritecond_entry)); + a->rewriterules = ap_make_array(p, 2, sizeof(rewriterule_entry)); if (path == NULL) a->directory = NULL; else { /* make sure it has a trailing slash */ if (path[strlen(path)-1] == '/') - a->directory = pstrdup(p, path); + a->directory = ap_pstrdup(p, path); else - a->directory = pstrcat(p, path, "/", NULL); + a->directory = ap_pstrcat(p, path, "/", NULL); } return (void *)a; @@ -336,7 +336,7 @@ { rewrite_perdir_conf *a, *base, *overrides; - a = (rewrite_perdir_conf *)pcalloc(p, sizeof(rewrite_perdir_conf)); + a = (rewrite_perdir_conf *)ap_pcalloc(p, sizeof(rewrite_perdir_conf)); base = (rewrite_perdir_conf *)basev; overrides = (rewrite_perdir_conf *)overridesv; @@ -346,9 +346,9 @@ a->baseurl = overrides->baseurl; if (a->options & OPTION_INHERIT) { - a->rewriteconds = append_arrays(p, overrides->rewriteconds, + a->rewriteconds = ap_append_arrays(p, overrides->rewriteconds, base->rewriteconds); - a->rewriterules = append_arrays(p, overrides->rewriterules, + a->rewriterules = ap_append_arrays(p, overrides->rewriterules, base->rewriterules); } else { @@ -372,7 +372,7 @@ rewrite_server_conf *sconf; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); if (cmd->path == NULL) /* is server command */ sconf->state = (flag ? ENGINE_ENABLED : ENGINE_DISABLED); @@ -389,7 +389,7 @@ const char *err; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); if (cmd->path == NULL) /* is server command */ err = cmd_rewriteoptions_setoption(cmd->pool, @@ -407,7 +407,7 @@ if (strcasecmp(name, "inherit") == 0) *options |= OPTION_INHERIT; else - return pstrcat(p, "RewriteOptions: unknown option '", + return ap_pstrcat(p, "RewriteOptions: unknown option '", name, "'\n", NULL); return NULL; } @@ -417,7 +417,7 @@ rewrite_server_conf *sconf; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); sconf->rewritelogfile = a1; @@ -429,7 +429,7 @@ rewrite_server_conf *sconf; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); sconf->rewriteloglevel = atoi(a1); @@ -444,9 +444,9 @@ struct stat st; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); - new = push_array(sconf->rewritemaps); + new = ap_push_array(sconf->rewritemaps); new->name = a1; new->func = NULL; @@ -464,9 +464,9 @@ #ifndef NO_DBM_REWRITEMAP new->type = MAPTYPE_DBM; new->datafile = a2+4; - new->checkfile = pstrcat(cmd->pool, a2+4, NDBM_FILE_SUFFIX, NULL); + new->checkfile = ap_pstrcat(cmd->pool, a2+4, NDBM_FILE_SUFFIX, NULL); #else - return pstrdup(cmd->pool, "RewriteMap: cannot use NDBM mapfile, " + return ap_pstrdup(cmd->pool, "RewriteMap: cannot use NDBM mapfile, " "because no NDBM support is compiled in"); #endif } @@ -484,7 +484,7 @@ else if (strcmp(a2+4, "toupper") == 0) new->func = rewrite_mapfunc_toupper; else if (sconf->state == ENGINE_ENABLED) - return pstrcat(cmd->pool, "RewriteMap: internal map not found:", + return ap_pstrcat(cmd->pool, "RewriteMap: internal map not found:", a2+4, NULL); } else { @@ -497,7 +497,7 @@ if (new->checkfile && (sconf->state == ENGINE_ENABLED) && (stat(new->checkfile, &st) == -1)) - return pstrcat(cmd->pool, "RewriteMap: map file or program not found:", + return ap_pstrcat(cmd->pool, "RewriteMap: map file or program not found:", new->checkfile, NULL); return NULL; @@ -508,7 +508,7 @@ rewrite_server_conf *sconf; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); sconf->rewritelockfile = a1; @@ -544,21 +544,21 @@ int rc; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); /* make a new entry in the internal temporary rewrite rule list */ if (cmd->path == NULL) /* is server command */ - new = push_array(sconf->rewriteconds); + new = ap_push_array(sconf->rewriteconds); else /* is per-directory command */ - new = push_array(dconf->rewriteconds); + new = ap_push_array(dconf->rewriteconds); /* parse the argument line ourself */ if (parseargline(str, &a1, &a2, &a3)) - return pstrcat(cmd->pool, "RewriteCond: bad argument line '", str, + return ap_pstrcat(cmd->pool, "RewriteCond: bad argument line '", str, "'\n", NULL); /* arg1: the input string */ - new->input = pstrdup(cmd->pool, a1); + new->input = ap_pstrdup(cmd->pool, a1); /* arg3: optional flags field (this have to be first parsed, because we need to @@ -581,16 +581,16 @@ we can compile the pattern for case-insensitive matching, under the old V8 library we have to do it self via a hack */ if (new->flags & CONDFLAG_NOCASE) - rc = ((regexp = pregcomp(cmd->pool, cp, REG_EXTENDED|REG_ICASE)) + rc = ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED|REG_ICASE)) == NULL); else - rc = ((regexp = pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL); + rc = ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL); if (rc) - return pstrcat(cmd->pool, + return ap_pstrcat(cmd->pool, "RewriteCond: cannot compile regular expression '", a2, "'\n", NULL); - new->pattern = pstrdup(cmd->pool, cp); + new->pattern = ap_pstrdup(cmd->pool, cp); new->regexp = regexp; return NULL; @@ -656,7 +656,7 @@ cfg->flags |= CONDFLAG_ORNEXT; } else { - return pstrcat(p, "RewriteCond: unknown flag '", key, "'\n", NULL); + return ap_pstrcat(p, "RewriteCond: unknown flag '", key, "'\n", NULL); } return NULL; } @@ -674,17 +674,17 @@ const char *err; sconf = (rewrite_server_conf *) - get_module_config(cmd->server->module_config, &rewrite_module); + ap_get_module_config(cmd->server->module_config, &rewrite_module); /* make a new entry in the internal rewrite rule list */ if (cmd->path == NULL) /* is server command */ - new = push_array(sconf->rewriterules); + new = ap_push_array(sconf->rewriterules); else /* is per-directory command */ - new = push_array(dconf->rewriterules); + new = ap_push_array(dconf->rewriterules); /* parse the argument line ourself */ if (parseargline(str, &a1, &a2, &a3)) - return pstrcat(cmd->pool, "RewriteRule: bad argument line '", str, + return ap_pstrcat(cmd->pool, "RewriteRule: bad argument line '", str, "'\n", NULL); /* arg1: the pattern @@ -696,18 +696,18 @@ new->flags |= RULEFLAG_NOTMATCH; cp++; } - if ((regexp = pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL) - return pstrcat(cmd->pool, + if ((regexp = ap_pregcomp(cmd->pool, cp, REG_EXTENDED)) == NULL) + return ap_pstrcat(cmd->pool, "RewriteRule: cannot compile regular expression '", a1, "'\n", NULL); - new->pattern = pstrdup(cmd->pool, cp); + new->pattern = ap_pstrdup(cmd->pool, cp); new->regexp = regexp; /* arg2: the output string * replace the $<N> by \<n> which is needed by the currently * used Regular Expression library */ - new->output = pstrdup(cmd->pool, a2); + new->output = ap_pstrdup(cmd->pool, a2); /* arg3: optional flags field */ new->forced_mimetype = NULL; @@ -725,12 +725,12 @@ */ if (cmd->path == NULL) { /* is server command */ new->rewriteconds = sconf->rewriteconds; - sconf->rewriteconds = make_array(cmd->pool, 2, + sconf->rewriteconds = ap_make_array(cmd->pool, 2, sizeof(rewritecond_entry)); } else { /* is per-directory command */ new->rewriteconds = dconf->rewriteconds; - dconf->rewriteconds = make_array(cmd->pool, 2, + dconf->rewriteconds = ap_make_array(cmd->pool, 2, sizeof(rewritecond_entry)); } @@ -823,15 +823,15 @@ } else if ( strcasecmp(key, "type") == 0 || strcasecmp(key, "T") == 0 ) { - cfg->forced_mimetype = pstrdup(p, val); - str_tolower(cfg->forced_mimetype); + cfg->forced_mimetype = ap_pstrdup(p, val); + ap_str_tolower(cfg->forced_mimetype); } else if ( strcasecmp(key, "env") == 0 || strcasecmp(key, "E") == 0 ) { for (i = 0; (cfg->env[i] != NULL) && (i < MAX_ENV_FLAGS); i++) ; if (i < MAX_ENV_FLAGS) { - cfg->env[i] = pstrdup(p, val); + cfg->env[i] = ap_pstrdup(p, val); cfg->env[i+1] = NULL; } else @@ -866,7 +866,7 @@ cfg->flags |= RULEFLAG_QSAPPEND; } else { - return pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL); + return ap_pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL); } return NULL; } @@ -883,15 +883,15 @@ static void init_module(server_rec *s, pool *p) { /* check if proxy module is available */ - proxy_available = (find_linked_module("mod_proxy.c") != NULL); + proxy_available = (ap_find_linked_module("mod_proxy.c") != NULL); /* precompile a static pattern for the txt mapfile parsing */ - lookup_map_txtfile_regexp = pregcomp(p, MAPFILE_PATTERN, REG_EXTENDED); + lookup_map_txtfile_regexp = ap_pregcomp(p, MAPFILE_PATTERN, REG_EXTENDED); /* create the rewriting lockfile in the parent */ rewritelock_create(s, p); - register_cleanup(p, (void *)s, rewritelock_remove, null_cleanup); + ap_register_cleanup(p, (void *)s, rewritelock_remove, ap_null_cleanup); /* step through the servers and * - open each rewriting logfile @@ -955,7 +955,7 @@ * retrieve the config structures */ sconf = r->server->module_config; - conf = (rewrite_server_conf *)get_module_config(sconf, &rewrite_module); + conf = (rewrite_server_conf *)ap_get_module_config(sconf, &rewrite_module); /* * only do something under runtime if the engine is really enabled, @@ -981,16 +981,16 @@ */ if (r->main == NULL) { - var = pstrcat(r->pool, "REDIRECT_", ENVVAR_SCRIPT_URL, NULL); - var = table_get(r->subprocess_env, var); + var = ap_pstrcat(r->pool, "REDIRECT_", ENVVAR_SCRIPT_URL, NULL); + var = ap_table_get(r->subprocess_env, var); if (var == NULL) - table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, r->uri); + ap_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, r->uri); else - table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, var); + ap_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, var); } else { - var = table_get(r->main->subprocess_env, ENVVAR_SCRIPT_URL); - table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, var); + var = ap_table_get(r->main->subprocess_env, ENVVAR_SCRIPT_URL); + ap_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URL, var); } /* @@ -1005,18 +1005,18 @@ ap_snprintf(buf, sizeof(buf), ":%u", r->server->port); thisport = buf; } - thisurl = table_get(r->subprocess_env, ENVVAR_SCRIPT_URL); + thisurl = ap_table_get(r->subprocess_env, ENVVAR_SCRIPT_URL); /* set the variable */ - var = pstrcat(r->pool, http_method(r), "://", thisserver, thisport, + var = ap_pstrcat(r->pool, http_method(r), "://", thisserver, thisport, thisurl, NULL); - table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var); + ap_table_setn(r->subprocess_env, ENVVAR_SCRIPT_URI, var); /* if filename was not initially set, * we start with the requested URI */ if (r->filename == NULL) { - r->filename = pstrdup(r->pool, r->uri); + r->filename = ap_pstrdup(r->pool, r->uri); rewritelog(r, 2, "init rewrite engine with requested uri %s", r->filename); } @@ -1034,7 +1034,7 @@ * we can actually use it! */ if (!proxy_available) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "attempt to make remote request from mod_rewrite " "without proxy enabled: %s", r->filename); return FORBIDDEN; @@ -1044,10 +1044,10 @@ * PATH_INFO parts get incorporated */ if (r->path_info != NULL) - r->filename = pstrcat(r->pool, r->filename, r->path_info, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, r->path_info, NULL); if (r->args != NULL && r->uri == r->unparsed_uri /* see proxy_http:proxy_http_canon() */) - r->filename = pstrcat(r->pool, r->filename, "?", r->args, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "?", r->args, NULL); /* now make sure the request gets handled by the proxy handler */ r->proxyreq = 1; @@ -1079,12 +1079,12 @@ rewritelog(r, 1, "escaping %s for redirect", r->filename); cp2 = escape_uri(r->pool, cp); *cp = '\0'; - r->filename = pstrcat(r->pool, r->filename, cp2, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, cp2, NULL); } /* append the QUERY_STRING part */ if (r->args != NULL) - r->filename = pstrcat(r->pool, r->filename, "?", r->args, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "?", r->args, NULL); /* determine HTTP redirect response code */ if (is_HTTP_REDIRECT(r->status)) { @@ -1095,7 +1095,7 @@ n = REDIRECT; /* now do the redirection */ - table_setn(r->headers_out, "Location", r->filename); + ap_table_setn(r->headers_out, "Location", r->filename); rewritelog(r, 1, "redirect to %s [REDIRECT/%d]", r->filename, n); return n; } @@ -1119,7 +1119,7 @@ * r->uri! The difference here is: We do not try to * add the document root */ - r->uri = pstrdup(r->pool, r->filename+12); + r->uri = ap_pstrdup(r->pool, r->filename+12); return DECLINED; } else { @@ -1157,7 +1157,7 @@ */ n = prefix_stat(r->filename, &finfo); if (n == 0) { - if ((cp = document_root(r)) != NULL) { + if ((cp = ap_document_root(r)) != NULL) { l = ap_cpystrn(docroot, cp, sizeof(docroot)) - docroot; /* always NOT have a trailing slash */ @@ -1167,10 +1167,10 @@ if (r->server->path && !strncmp(r->filename, r->server->path, r->server->pathlen)) - r->filename = pstrcat(r->pool, docroot, + r->filename = ap_pstrcat(r->pool, docroot, (r->filename + r->server->pathlen), NULL); else - r->filename = pstrcat(r->pool, docroot, r->filename, + r->filename = ap_pstrcat(r->pool, docroot, r->filename, NULL); rewritelog(r, 2, "prefixed with document_root to %s", r->filename); @@ -1201,7 +1201,7 @@ char *t; /* now check if we have to force a MIME-type */ - t = table_get(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR); + t = ap_table_get(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR); if (t == NULL) return DECLINED; else { @@ -1233,7 +1233,7 @@ char *ofilename; dconf = (rewrite_perdir_conf *) - get_module_config(r->per_dir_config, &rewrite_module); + ap_get_module_config(r->per_dir_config, &rewrite_module); /* if there is no per-dir config we return immediately */ if (dconf == NULL) @@ -1252,9 +1252,9 @@ * only do something under runtime if the engine is really enabled, * for this directory, else return immediately! */ - if (!(allow_options(r) & (OPT_SYM_LINKS | OPT_SYM_OWNER))) { + if (!(ap_allow_options(r) & (OPT_SYM_LINKS | OPT_SYM_OWNER))) { /* FollowSymLinks is mandatory! */ - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Options FollowSymLinks or SymLinksIfOwnerMatch is off " "which implies that RewriteRule directive is forbidden: " "%s", r->filename); @@ -1291,7 +1291,7 @@ */ if (r->args != NULL && r->uri == r->unparsed_uri /* see proxy_http:proxy_http_canon() */) - r->filename = pstrcat(r->pool, r->filename, "?", r->args, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "?", r->args, NULL); /* now make sure the request gets handled by the proxy handler */ r->proxyreq = 1; @@ -1329,7 +1329,7 @@ dconf->baseurl); if (strcmp(cp2, cp) != 0) { *cp = '\0'; - r->filename = pstrcat(r->pool, r->filename, cp2, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, cp2, NULL); } } } @@ -1349,12 +1349,12 @@ dconf->directory, r->filename); cp2 = escape_uri(r->pool, cp); *cp = '\0'; - r->filename = pstrcat(r->pool, r->filename, cp2, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, cp2, NULL); } /* append the QUERY_STRING part */ if (r->args != NULL) - r->filename = pstrcat(r->pool, r->filename, "?", r->args, NULL); + r->filename = ap_pstrcat(r->pool, r->filename, "?", r->args, NULL); /* determine HTTP redirect response code */ if (is_HTTP_REDIRECT(r->status)) { @@ -1365,7 +1365,7 @@ n = REDIRECT; /* now do the redirection */ - table_setn(r->headers_out, "Location", r->filename); + ap_table_setn(r->headers_out, "Location", r->filename); rewritelog(r, 1, "[per-dir %s] redirect to %s [REDIRECT/%d]", dconf->directory, r->filename, n); return n; @@ -1389,7 +1389,7 @@ */ if (strlen(r->filename) > 12 && strncmp(r->filename, "passthrough:", 12) == 0) { - r->filename = pstrdup(r->pool, r->filename+12); + r->filename = ap_pstrdup(r->pool, r->filename+12); } /* the filename has to start with a slash! */ @@ -1430,8 +1430,8 @@ * for this webserver and only try to remove the * document_root if it is prefix */ - if ((cp = document_root(r)) != NULL) { - prefix = pstrdup(r->pool, cp); + if ((cp = ap_document_root(r)) != NULL) { + prefix = ap_pstrdup(r->pool, cp); /* always NOT have a trailing slash */ l = strlen(prefix); if (prefix[l-1] == '/') { @@ -1442,7 +1442,7 @@ rewritelog(r, 2, "[per-dir %s] strip document_root prefix: %s -> %s", dconf->directory, r->filename, r->filename+l); - r->filename = pstrdup(r->pool, r->filename+l); + r->filename = ap_pstrdup(r->pool, r->filename+l); } } } @@ -1451,7 +1451,7 @@ rewritelog(r, 1, "[per-dir %s] internal redirect with %s [INTERNAL REDIRECT]", dconf->directory, r->filename); - r->filename = pstrcat(r->pool, "redirect:", r->filename, NULL); + r->filename = ap_pstrcat(r->pool, "redirect:", r->filename, NULL); r->handler = "redirect-handler"; return OK; } @@ -1479,7 +1479,7 @@ return DECLINED; /* now do the internal redirect */ - internal_redirect(pstrcat(r->pool, r->filename+9, + ap_internal_redirect(ap_pstrcat(r->pool, r->filename+9, r->args ? "?" : NULL, r->args, NULL), r); /* and return gracefully */ @@ -1549,7 +1549,7 @@ if (p->flags & RULEFLAG_PASSTHROUGH) { rewritelog(r, 2, "forcing '%s' to get passed through " "to next API URI-to-filename handler", r->filename); - r->filename = pstrcat(r->pool, "passthrough:", + r->filename = ap_pstrcat(r->pool, "passthrough:", r->filename, NULL); changed = 1; break; @@ -1561,7 +1561,7 @@ */ if (p->flags & RULEFLAG_FORBIDDEN) { rewritelog(r, 2, "forcing '%s' to be forbidden", r->filename); - r->filename = pstrcat(r->pool, "forbidden:", + r->filename = ap_pstrcat(r->pool, "forbidden:", r->filename, NULL); changed = 1; break; @@ -1573,7 +1573,7 @@ */ if (p->flags & RULEFLAG_GONE) { rewritelog(r, 2, "forcing '%s' to be gone", r->filename); - r->filename = pstrcat(r->pool, "gone:", r->filename, NULL); + r->filename = ap_pstrcat(r->pool, "gone:", r->filename, NULL); changed = 1; break; } @@ -1658,7 +1658,7 @@ if (perdir != NULL && r->path_info != NULL && r->path_info[0] != '\0') { rewritelog(r, 3, "[per-dir %s] add path-info postfix: %s -> %s%s", perdir, uri, uri, r->path_info); - uri = pstrcat(r->pool, uri, r->path_info, NULL); + uri = ap_pstrcat(r->pool, uri, r->path_info, NULL); } /* @@ -1697,14 +1697,14 @@ * Else create the RewriteRule `regsubinfo' structure which * holds the substitution information. */ - briRR = (backrefinfo *)palloc(r->pool, sizeof(backrefinfo)); + briRR = (backrefinfo *)ap_palloc(r->pool, sizeof(backrefinfo)); if (!rc && (p->flags & RULEFLAG_NOTMATCH)) { /* empty info on negative patterns */ briRR->source = ""; briRR->nsub = 0; } else { - briRR->source = pstrdup(r->pool, uri); + briRR->source = ap_pstrdup(r->pool, uri); briRR->nsub = regexp->re_nsub; memcpy((void *)(briRR->regmatch), (void *)(regmatch), sizeof(regmatch)); @@ -1715,7 +1715,7 @@ * empty backrefinfo, i.e. not subst parts * (this one is adjusted inside apply_rewrite_cond() later!!) */ - briRC = (backrefinfo *)pcalloc(r->pool, sizeof(backrefinfo)); + briRC = (backrefinfo *)ap_pcalloc(r->pool, sizeof(backrefinfo)); briRC->source = ""; briRC->nsub = 0; @@ -1839,7 +1839,7 @@ * Replace r->filename with the new URI string and split out * an on-the-fly generated QUERY_STRING part into r->args */ - r->filename = pstrdup(r->pool, newuri); + r->filename = ap_pstrdup(r->pool, newuri); splitout_queryargs(r, p->flags & RULEFLAG_QSAPPEND); /* @@ -1857,7 +1857,7 @@ || (i > 6 && strncasecmp(r->filename, "ftp://", 6) == 0)))) { rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s", perdir, r->filename, perdir, r->filename); - r->filename = pstrcat(r->pool, perdir, r->filename, NULL); + r->filename = ap_pstrcat(r->pool, perdir, r->filename, NULL); } /* @@ -1875,7 +1875,7 @@ else rewritelog(r, 2, "[per-dir %s] forcing proxy-throughput with %s", perdir, r->filename); - r->filename = pstrcat(r->pool, "proxy:", r->filename, NULL); + r->filename = ap_pstrcat(r->pool, "proxy:", r->filename, NULL); return 1; } @@ -1941,7 +1941,7 @@ if (prefixstrip && r->filename[0] != '/') { rewritelog(r, 3, "[per-dir %s] add per-dir prefix: %s -> %s%s", perdir, r->filename, perdir, r->filename); - r->filename = pstrcat(r->pool, perdir, r->filename, NULL); + r->filename = ap_pstrcat(r->pool, perdir, r->filename, NULL); } /* @@ -1951,7 +1951,7 @@ * MIME API-hook function. */ if (p->forced_mimetype != NULL) { - table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR, + ap_table_setn(r->notes, REWRITE_FORCED_MIMETYPE_NOTEVAR, p->forced_mimetype); if (perdir == NULL) rewritelog(r, 2, "remember %s to have MIME-type '%s'", @@ -2031,7 +2031,7 @@ && strcmp(r->main->uri, r->uri) != 0) ) ) { /* run a URI-based subrequest */ - rsub = sub_req_lookup_uri(input, r); + rsub = ap_sub_req_lookup_uri(input, r); /* URI exists for any result up to 3xx, redirects allowed */ if (rsub->status < 400) @@ -2042,7 +2042,7 @@ "path=%s -> status=%d", input, rsub->status); /* cleanup by destroying the subrequest */ - destroy_sub_req(rsub); + ap_destroy_sub_req(rsub); } } else if (strcmp(p->pattern, "-F") == 0) { @@ -2057,7 +2057,7 @@ /* process a file-based subrequest: * this differs from -U in that no path translation is done. */ - rsub = sub_req_lookup_file(input, r); + rsub = ap_sub_req_lookup_file(input, r); /* file exists for any result up to 2xx, no redirects */ if (rsub->status < 300 && @@ -2071,7 +2071,7 @@ input, rsub->filename, rsub->status); /* cleanup by destroying the subrequest */ - destroy_sub_req(rsub); + ap_destroy_sub_req(rsub); } } else if (strlen(p->pattern) > 1 && *(p->pattern) == '>') { @@ -2094,7 +2094,7 @@ /* if it isn't a negated pattern and really matched we update the passed-through regex subst info structure */ if (rc && !(p->flags & CONDFLAG_NOTMATCH)) { - briRC->source = pstrdup(r->pool, input); + briRC->source = ap_pstrdup(r->pool, input); briRC->nsub = p->regexp->re_nsub; memcpy((void *)(briRC->regmatch), (void *)(regmatch), sizeof(regmatch)); @@ -2136,12 +2136,12 @@ q = strchr(r->filename, '?'); if (q != NULL) { - olduri = pstrdup(r->pool, r->filename); + olduri = ap_pstrdup(r->pool, r->filename); *q++ = '\0'; if (qsappend) - r->args = pstrcat(r->pool, q, "&", r->args, NULL); + r->args = ap_pstrcat(r->pool, q, "&", r->args, NULL); else - r->args = pstrdup(r->pool, q); + r->args = ap_pstrdup(r->pool, q); if (strlen(r->args) == 0) { r->args = NULL; rewritelog(r, 3, "split uri=%s -> uri=%s, args=<none>", olduri, @@ -2186,7 +2186,7 @@ #endif /* there was really a rewrite to a remote path */ - olduri = pstrdup(r->pool, r->filename); /* save for logging */ + olduri = ap_pstrdup(r->pool, r->filename); /* save for logging */ /* cut the hostname and port out of the URI */ ap_cpystrn(buf, r->filename+strlen(http_method(r))+3, sizeof(buf)); @@ -2228,9 +2228,9 @@ } /* now check whether we could reduce it to a local path... */ - if (matches_request_vhost(r, host, port)) { + if (ap_matches_request_vhost(r, host, port)) { /* this is our host, so only the URL remains */ - r->filename = pstrdup(r->pool, url); + r->filename = ap_pstrdup(r->pool, url); rewritelog(r, 3, "reduce %s -> %s", olduri, r->filename); } } @@ -2262,11 +2262,11 @@ ap_snprintf(port, sizeof(port), ":%u", r->server->port); if (r->filename[0] == '/') - r->filename = psprintf(r->pool, "%s://%s%s%s", + r->filename = ap_psprintf(r->pool, "%s://%s%s%s", http_method(r), r->server->server_hostname, port, r->filename); else - r->filename = psprintf(r->pool, "%s://%s%s/%s", + r->filename = ap_psprintf(r->pool, "%s://%s%s/%s", http_method(r), r->server->server_hostname, port, r->filename); } @@ -2299,7 +2299,7 @@ } /* now apply the pregsub() function */ - ap_cpystrn(buf, pregsub(p, buf, bri->source, + ap_cpystrn(buf, ap_pregsub(p, buf, bri->source, bri->nsub+1, bri->regmatch), nbuf); if (c != '$') { @@ -2341,11 +2341,11 @@ /* ~user/anything... has to be expanded */ if (pw->pw_dir[strlen(pw->pw_dir)-1] == '/') pw->pw_dir[strlen(pw->pw_dir)-1] = '\0'; - newuri = pstrcat(r->pool, pw->pw_dir, uri+i, NULL); + newuri = ap_pstrcat(r->pool, pw->pw_dir, uri+i, NULL); } else { /* only ~user has to be expanded */ - newuri = pstrdup(r->pool, pw->pw_dir); + newuri = ap_pstrdup(r->pool, pw->pw_dir); } } } @@ -2423,7 +2423,7 @@ if (cpT != NULL) { n = strlen(cpT); if (cpO + n >= newuri + sizeof(newuri)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "insufficient space in expand_map_lookups, " "aborting"); return; @@ -2434,7 +2434,7 @@ else { n = strlen(defaultvalue); if (cpO + n >= newuri + sizeof(newuri)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "insufficient space in expand_map_lookups, " "aborting"); return; @@ -2449,7 +2449,7 @@ cpT = cpI+strlen(cpI); n = cpT-cpI; if (cpO + n >= newuri + sizeof(newuri)) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "insufficient space in expand_map_lookups, " "aborting"); return; @@ -2490,7 +2490,7 @@ /* get map configuration */ sconf = r->server->module_config; - conf = (rewrite_server_conf *)get_module_config(sconf, &rewrite_module); + conf = (rewrite_server_conf *)ap_get_module_config(sconf, &rewrite_module); rewritemaps = conf->rewritemaps; entries = (rewritemap_entry *)rewritemaps->elts; @@ -2499,7 +2499,7 @@ if (strcmp(s->name, name) == 0) { if (s->type == MAPTYPE_TXT) { if (stat(s->checkfile, &st) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "mod_rewrite: can't access text RewriteMap " "file %s", s->checkfile); rewritelog(r, 1, @@ -2534,7 +2534,7 @@ else if (s->type == MAPTYPE_DBM) { #ifndef NO_DBM_REWRITEMAP if (stat(s->checkfile, &st) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "mod_rewrite: can't access DBM RewriteMap " "file %s", s->checkfile); rewritelog(r, 1, @@ -2594,7 +2594,7 @@ } else if (s->type == MAPTYPE_RND) { if (stat(s->checkfile, &st) == -1) { - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "mod_rewrite: can't access text RewriteMap " "file %s", s->checkfile); rewritelog(r, 1, @@ -2644,7 +2644,7 @@ char *curkey; char *curval; - if ((fp = pfopen(r->pool, file, "r")) == NULL) + if ((fp = ap_pfopen(r->pool, file, "r")) == NULL) return NULL; ap_cpystrn(output, MAPFILE_OUTPUT, sizeof(output)); @@ -2654,7 +2654,7 @@ if (regexec(lookup_map_txtfile_regexp, line, lookup_map_txtfile_regexp->re_nsub+1, lookup_map_txtfile_regmatch, 0) == 0) { - ap_cpystrn(result, pregsub(r->pool, output, line, + ap_cpystrn(result, ap_pregsub(r->pool, output, line, lookup_map_txtfile_regexp->re_nsub+1, lookup_map_txtfile_regmatch), sizeof(result)); /* substitute in output */ @@ -2664,12 +2664,12 @@ curval = cpT+1; if (strcmp(curkey, key) == 0) { - value = pstrdup(r->pool, curval); + value = ap_pstrdup(r->pool, curval); break; } } } - pfclose(r->pool, fp); + ap_pfclose(r->pool, fp); return value; } @@ -2690,7 +2690,7 @@ if (dbmval.dptr != NULL) { memcpy(buf, dbmval.dptr, dbmval.dsize); buf[dbmval.dsize] = '\0'; - value = pstrdup(r->pool, buf); + value = ap_pstrdup(r->pool, buf); } dbm_close(dbmfp); } @@ -2734,7 +2734,7 @@ if (strcasecmp(buf, "NULL") == 0) return NULL; else - return pstrdup(r->pool, buf); + return ap_pstrdup(r->pool, buf); } static char *lookup_map_internal(request_rec *r, @@ -2750,7 +2750,7 @@ { char *value, *cp; - for (cp = value = pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) + for (cp = value = ap_pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) *cp = toupper(*cp); return value; } @@ -2759,7 +2759,7 @@ { char *value, *cp; - for (cp = value = pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) + for (cp = value = ap_pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) *cp = tolower(*cp); return value; } @@ -2812,7 +2812,7 @@ if (value[i] == '|') n++; } - buf = pstrdup(r->pool, &value[i]); + buf = ap_pstrdup(r->pool, &value[i]); for (i = 0; buf[i] != '\0' && buf[i] != '|'; i++) ; buf[i] = '\0'; @@ -2841,7 +2841,7 @@ mode_t rewritelog_mode = ( S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH ); #endif - conf = get_module_config(s->module_config, &rewrite_module); + conf = ap_get_module_config(s->module_config, &rewrite_module); if (conf->rewritelogfile == NULL) return; @@ -2850,7 +2850,7 @@ if (conf->rewritelogfp > 0) return; /* virtual log shared w/ main server */ - fname = server_root_relative(p, conf->rewritelogfile); + fname = ap_server_root_relative(p, conf->rewritelogfile); if (*conf->rewritelogfile == '|') { if (!spawn_child(p, rewritelog_child, (void *)(conf->rewritelogfile+1), @@ -2864,7 +2864,7 @@ conf->rewritelogfp = fileno(fp); } else if (*conf->rewritelogfile != '\0') { - if ((conf->rewritelogfp = popenf(p, fname, rewritelog_flags, + if ((conf->rewritelogfp = ap_popenf(p, fname, rewritelog_flags, rewritelog_mode)) < 0) { perror("open"); fprintf(stderr, @@ -2881,7 +2881,7 @@ { int child_pid = 1; - cleanup_for_exec(); + ap_cleanup_for_exec(); #ifdef SIGHUP signal(SIGHUP, SIG_IGN); #endif @@ -2913,7 +2913,7 @@ const char *rhost; va_start(ap, text); - conf = get_module_config(r->server->module_config, &rewrite_module); + conf = ap_get_module_config(r->server->module_config, &rewrite_module); conn = r->connection; if (conf->rewritelogfp < 0) @@ -2936,11 +2936,11 @@ ruser = "\"\""; } - rhost = get_remote_host(conn, r->server->module_config, REMOTE_NOLOOKUP); + rhost = ap_get_remote_host(conn, r->server->module_config, REMOTE_NOLOOKUP); if (rhost == NULL) rhost = "UNKNOWN-HOST"; - str1 = pstrcat(r->pool, rhost, " ", + str1 = ap_pstrcat(r->pool, rhost, " ", (conn->remote_logname != NULL ? conn->remote_logname : "-"), " ", ruser, NULL); @@ -2979,7 +2979,7 @@ char tstr[80]; char sign; - t = get_gmtoff(&timz); + t = ap_get_gmtoff(&timz); sign = (timz < 0 ? '-' : '+'); if(timz < 0) timz = -timz; @@ -2987,7 +2987,7 @@ strftime(tstr, 80, "[%d/%b/%Y:%H:%M:%S ", t); ap_snprintf(tstr + strlen(tstr), 80-strlen(tstr), "%c%.2d%.2d]", sign, timz/60, timz%60); - return pstrdup(r->pool, tstr); + return ap_pstrdup(r->pool, tstr); } @@ -3011,7 +3011,7 @@ { rewrite_server_conf *conf; - conf = get_module_config(s->module_config, &rewrite_module); + conf = ap_get_module_config(s->module_config, &rewrite_module); /* only operate if a lockfile is used */ if (conf->rewritelockfile == NULL @@ -3019,11 +3019,11 @@ return; /* fixup the path, especially for rewritelock_remove() */ - conf->rewritelockfile = server_root_relative(p, conf->rewritelockfile); + conf->rewritelockfile = ap_server_root_relative(p, conf->rewritelockfile); /* create the lockfile */ unlink(conf->rewritelockfile); - if ((conf->rewritelockfp = popenf(p, conf->rewritelockfile, + if ((conf->rewritelockfp = ap_popenf(p, conf->rewritelockfile, O_WRONLY|O_CREAT, REWRITELOCK_MODE)) < 0) { perror("open"); @@ -3038,7 +3038,7 @@ { rewrite_server_conf *conf; - conf = get_module_config(s->module_config, &rewrite_module); + conf = ap_get_module_config(s->module_config, &rewrite_module); /* only operate if a lockfile is used */ if (conf->rewritelockfile == NULL @@ -3046,7 +3046,7 @@ return; /* open the lockfile (once per child) to get a unique fd */ - if ((conf->rewritelockfp = popenf(p, conf->rewritelockfile, + if ((conf->rewritelockfp = ap_popenf(p, conf->rewritelockfile, O_WRONLY, REWRITELOCK_MODE)) < 0) { perror("open"); @@ -3064,7 +3064,7 @@ /* the data is really the server_rec */ s = (server_rec *)data; - conf = get_module_config(s->module_config, &rewrite_module); + conf = ap_get_module_config(s->module_config, &rewrite_module); /* only operate if a lockfile is used */ if (conf->rewritelockfile == NULL @@ -3079,7 +3079,7 @@ { rewrite_server_conf *conf; - conf = get_module_config(r->server->module_config, &rewrite_module); + conf = ap_get_module_config(r->server->module_config, &rewrite_module); if (conf->rewritelockfp != -1) fd_lock(conf->rewritelockfp); @@ -3090,7 +3090,7 @@ { rewrite_server_conf *conf; - conf = get_module_config(r->server->module_config, &rewrite_module); + conf = ap_get_module_config(r->server->module_config, &rewrite_module); if (conf->rewritelockfp != -1) fd_unlock(conf->rewritelockfp); @@ -3117,7 +3117,7 @@ int i; int rc; - conf = get_module_config(s->module_config, &rewrite_module); + conf = ap_get_module_config(s->module_config, &rewrite_module); /* If the engine isn't turned on, * don't even try to do anything. @@ -3157,7 +3157,7 @@ { int child_pid = 1; - cleanup_for_exec(); + ap_cleanup_for_exec(); #ifdef SIGHUP signal(SIGHUP, SIG_IGN); #endif @@ -3229,7 +3229,7 @@ outp = ap_cpystrn(outp, cp, endp - outp); break; } - return expanded ? pstrdup(r->pool, output) : str; + return expanded ? ap_pstrdup(r->pool, output) : str; } static char *lookup_variable(request_rec *r, char *var) @@ -3279,14 +3279,14 @@ result = r->connection->remote_ip; } else if (strcasecmp(var, "REMOTE_HOST") == 0) { - result = (char *)get_remote_host(r->connection, + result = (char *)ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME); } else if (strcasecmp(var, "REMOTE_USER") == 0) { result = r->connection->user; } else if (strcasecmp(var, "REMOTE_IDENT") == 0) { - result = (char *)get_remote_logname(r); + result = (char *)ap_get_remote_logname(r); } /* request stuff */ @@ -3310,7 +3310,7 @@ result = r->args; } else if (strcasecmp(var, "AUTH_TYPE") == 0) { - result = r->connection->auth_type; + result = r->connection->ap_auth_type; } else if (strcasecmp(var, "IS_SUBREQ") == 0) { /* non-standard */ result = (r->main != NULL ? "true" : "false"); @@ -3318,23 +3318,23 @@ /* internal server stuff */ else if (strcasecmp(var, "DOCUMENT_ROOT") == 0) { - result = document_root(r); + result = ap_document_root(r); } else if (strcasecmp(var, "SERVER_ADMIN") == 0) { result = r->server->server_admin; } else if (strcasecmp(var, "SERVER_NAME") == 0) { - result = get_server_name(r); + result = ap_get_server_name(r); } else if (strcasecmp(var, "SERVER_PORT") == 0) { - ap_snprintf(resultbuf, sizeof(resultbuf), "%u", get_server_port(r)); + ap_snprintf(resultbuf, sizeof(resultbuf), "%u", ap_get_server_port(r)); result = resultbuf; } else if (strcasecmp(var, "SERVER_PROTOCOL") == 0) { result = r->protocol; } else if (strcasecmp(var, "SERVER_SOFTWARE") == 0) { - result = apapi_get_server_version(); + result = ap_get_server_version(); } else if (strcasecmp(var, "API_VERSION") == 0) { /* non-standard */ ap_snprintf(resultbuf, sizeof(resultbuf), "%d", MODULE_MAGIC_NUMBER); @@ -3386,10 +3386,10 @@ /* all other env-variables from the parent Apache process */ else if (strlen(var) > 4 && strncasecmp(var, "ENV:", 4) == 0) { /* first try the internal Apache notes structure */ - result = table_get(r->notes, var+4); + result = ap_table_get(r->notes, var+4); /* second try the internal Apache env structure */ if (result == NULL) - result = table_get(r->subprocess_env, var+4); + result = ap_table_get(r->subprocess_env, var+4); /* third try the external OS env */ if (result == NULL) result = getenv(var+4); @@ -3410,9 +3410,9 @@ /* now recursively lookup the variable in the sub_req */ \ result = lookup_variable(rsub, var+5); \ /* copy it up to our scope before we destroy sub_req's pool */ \ - result = pstrdup(r->pool, result); \ + result = ap_pstrdup(r->pool, result); \ /* cleanup by destroying the subrequest */ \ - destroy_sub_req(rsub); \ + ap_destroy_sub_req(rsub); \ /* log it */ \ rewritelog(r, 5, "lookahead: path=%s var=%s -> val=%s", \ r->filename, var+5, result); \ @@ -3422,11 +3422,11 @@ /* look-ahead for parameter through URI-based sub-request */ else if (strlen(var) > 5 && strncasecmp(var, "LA-U:", 5) == 0) { - LOOKAHEAD(sub_req_lookup_uri) + LOOKAHEAD(ap_sub_req_lookup_uri) } /* look-ahead for parameter through file-based sub-request */ else if (strlen(var) > 5 && strncasecmp(var, "LA-F:", 5) == 0) { - LOOKAHEAD(sub_req_lookup_file) + LOOKAHEAD(ap_sub_req_lookup_file) } #ifndef WIN32 @@ -3467,9 +3467,9 @@ #endif /* ndef WIN32 */ if (result == NULL) - return pstrdup(r->pool, ""); + return ap_pstrdup(r->pool, ""); else - return pstrdup(r->pool, result); + return ap_pstrdup(r->pool, result); } static char *lookup_header(request_rec *r, const char *name) @@ -3505,9 +3505,9 @@ { cache *c; - c = (cache *)palloc(p, sizeof(cache)); - c->pool = make_sub_pool(p); - c->lists = make_array(c->pool, 2, sizeof(cachelist)); + c = (cache *)ap_palloc(p, sizeof(cache)); + c->pool = ap_make_sub_pool(p); + c->lists = ap_make_array(c->pool, 2, sizeof(cachelist)); return c; } @@ -3539,7 +3539,7 @@ if (t > ce->time) return NULL; } - return pstrdup(c->pool, ce->value); + return ap_pstrdup(c->pool, ce->value); } static void store_cache_string(cache *c, char *res, cacheentry *ce) @@ -3560,7 +3560,7 @@ e = &(((cacheentry *)l->entries->elts)[j]); if (strcmp(e->key, ce->key) == 0) { e->time = ce->time; - e->value = pstrdup(c->pool, ce->value); + e->value = ap_pstrdup(c->pool, ce->value); return; } } @@ -3569,19 +3569,19 @@ /* create a needed new list */ if (!found_list) { - l = push_array(c->lists); - l->resource = pstrdup(c->pool, res); - l->entries = make_array(c->pool, 2, sizeof(cacheentry)); + l = ap_push_array(c->lists); + l->resource = ap_pstrdup(c->pool, res); + l->entries = ap_make_array(c->pool, 2, sizeof(cacheentry)); } /* create the new entry */ for (i = 0; i < c->lists->nelts; i++) { l = &(((cachelist *)c->lists->elts)[i]); if (strcmp(l->resource, res) == 0) { - e = push_array(l->entries); + e = ap_push_array(l->entries); e->time = ce->time; - e->key = pstrdup(c->pool, ce->key); - e->value = pstrdup(c->pool, ce->value); + e->key = ap_pstrdup(c->pool, ce->key); + e->value = ap_pstrdup(c->pool, ce->value); return; } } @@ -3642,7 +3642,7 @@ /* now compare the prefix */ if (strncmp(input, matchbuf, l) == 0) { rewritelog(r, 5, "strip matching prefix: %s -> %s", output, output+l); - output = pstrdup(r->pool, output+l); + output = ap_pstrdup(r->pool, output+l); /* and now add the base-URL as replacement prefix */ l = ap_cpystrn(substbuf, subst, sizeof(substbuf)) - substbuf; @@ -3654,12 +3654,12 @@ if (output[0] == '/') { rewritelog(r, 4, "add subst prefix: %s -> %s%s", output, substbuf, output+1); - output = pstrcat(r->pool, substbuf, output+1, NULL); + output = ap_pstrcat(r->pool, substbuf, output+1, NULL); } else { rewritelog(r, 4, "add subst prefix: %s -> %s%s", output, substbuf, output); - output = pstrcat(r->pool, substbuf, output, NULL); + output = ap_pstrcat(r->pool, substbuf, output, NULL); } } return output; @@ -3755,7 +3755,7 @@ memcpy(var, s, n); var[n] = '\0'; ap_cpystrn(val, cp+1, sizeof(val)); - table_set(r->subprocess_env, var, val); + ap_table_set(r->subprocess_env, var, val); rewritelog(r, 5, "setting env variable '%s' to '%s'", var, val); } } 1.21 +24 -24 apache-1.3/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_setenvif.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- mod_setenvif.c 1998/03/31 12:53:21 1.20 +++ mod_setenvif.c 1998/04/11 12:00:51 1.21 @@ -144,18 +144,18 @@ static void *create_setenvif_config(pool *p, server_rec *dummy) { - sei_cfg_rec *new = (sei_cfg_rec *) palloc(p, sizeof(sei_cfg_rec)); + sei_cfg_rec *new = (sei_cfg_rec *) ap_palloc(p, sizeof(sei_cfg_rec)); - new->conditionals = make_array(p, 20, sizeof(sei_entry)); + new->conditionals = ap_make_array(p, 20, sizeof(sei_entry)); return (void *) new; } static void *merge_setenvif_config(pool *p, void *basev, void *overridesv) { - sei_cfg_rec *a = pcalloc(p, sizeof(sei_cfg_rec)); + sei_cfg_rec *a = ap_pcalloc(p, sizeof(sei_cfg_rec)); sei_cfg_rec *base = basev, *overrides = overridesv; - a->conditionals = append_arrays(p, base->conditionals, + a->conditionals = ap_append_arrays(p, base->conditionals, overrides->conditionals); return a; } @@ -169,7 +169,7 @@ { char *regex; const char *feature; - sei_cfg_rec *sconf = get_module_config(cmd->server->module_config, + sei_cfg_rec *sconf = ap_get_module_config(cmd->server->module_config, &setenvif_module); sei_entry *new, *entries = (sei_entry *) sconf->conditionals->elts; char *var; @@ -178,9 +178,9 @@ unsigned icase; /* get regex */ - regex = getword_conf(cmd->pool, &args); + regex = ap_getword_conf(cmd->pool, &args); if (!*regex) { - return pstrcat(cmd->pool, "Missing regular expression for ", + return ap_pstrcat(cmd->pool, "Missing regular expression for ", cmd->cmd->name, NULL); } @@ -210,18 +210,18 @@ /* no match, create a new entry */ - new = push_array(sconf->conditionals); + new = ap_push_array(sconf->conditionals); new->name = fname; new->regex = regex; new->icase = icase; - new->preg = pregcomp(cmd->pool, regex, + new->preg = ap_pregcomp(cmd->pool, regex, (REG_EXTENDED | REG_NOSUB | (icase ? REG_ICASE : 0))); if (new->preg == NULL) { - return pstrcat(cmd->pool, cmd->cmd->name, + return ap_pstrcat(cmd->pool, cmd->cmd->name, " regex could not be compiled.", NULL); } - new->features = make_table(cmd->pool, 2); + new->features = ap_make_table(cmd->pool, 2); if (!strcasecmp(fname, "remote_addr")) { new->special_type = SPECIAL_REMOTE_ADDR; @@ -247,25 +247,25 @@ } for (;;) { - feature = getword_conf(cmd->pool, &args); + feature = ap_getword_conf(cmd->pool, &args); if(!*feature) break; beenhere++; - var = getword(cmd->pool, &feature, '='); + var = ap_getword(cmd->pool, &feature, '='); if (*feature) { - table_setn(new->features, var, feature); + ap_table_setn(new->features, var, feature); } else if (*var == '!') { - table_setn(new->features, var + 1, "!"); + ap_table_setn(new->features, var + 1, "!"); } else { - table_setn(new->features, var, "1"); + ap_table_setn(new->features, var, "1"); } } if (!beenhere) { - return pstrcat(cmd->pool, "Missing envariable expression for ", + return ap_pstrcat(cmd->pool, "Missing envariable expression for ", cmd->cmd->name, NULL); } @@ -277,9 +277,9 @@ char *fname; /* get header name */ - fname = getword_conf(cmd->pool, &args); + fname = ap_getword_conf(cmd->pool, &args); if (!*fname) { - return pstrcat(cmd->pool, "Missing header-field name for ", + return ap_pstrcat(cmd->pool, "Missing header-field name for ", cmd->cmd->name, NULL); } return add_setenvif_core(cmd, mconfig, fname, args); @@ -311,7 +311,7 @@ static int match_headers(request_rec *r) { server_rec *s = r->server; - sei_cfg_rec *sconf = (sei_cfg_rec *) get_module_config(s->module_config, + sei_cfg_rec *sconf = (sei_cfg_rec *) ap_get_module_config(s->module_config, &setenvif_module); sei_entry *entries = (sei_entry *) sconf->conditionals->elts; table_entry *elts; @@ -336,7 +336,7 @@ val = r->connection->remote_ip; break; case SPECIAL_REMOTE_HOST: - val = get_remote_host(r->connection, r->per_dir_config, + val = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME); break; case SPECIAL_REMOTE_USER: @@ -349,7 +349,7 @@ val = r->method; break; case SPECIAL_NOT: - val = table_get(r->headers_in, b->name); + val = ap_table_get(r->headers_in, b->name); break; } } @@ -364,10 +364,10 @@ for (j = 0; j < arr->nelts; ++j) { if (!strcmp(elts[j].val, "!")) { - table_unset(r->subprocess_env, elts[j].key); + ap_table_unset(r->subprocess_env, elts[j].key); } else { - table_setn(r->subprocess_env, elts[j].key, elts[j].val); + ap_table_setn(r->subprocess_env, elts[j].key, elts[j].val); } } } 1.19 +17 -17 apache-1.3/src/modules/standard/mod_so.c Index: mod_so.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_so.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- mod_so.c 1998/04/09 08:20:29 1.18 +++ mod_so.c 1998/04/11 12:00:51 1.19 @@ -172,8 +172,8 @@ { so_server_conf *soc; - soc = (so_server_conf *)pcalloc(p, sizeof(so_server_conf)); - soc->loaded_modules = make_array(p, DYNAMIC_MODULE_LIMIT, + soc = (so_server_conf *)ap_pcalloc(p, sizeof(so_server_conf)); + soc->loaded_modules = ap_make_array(p, DYNAMIC_MODULE_LIMIT, sizeof(moduleinfo)); return (void *)soc; } @@ -192,7 +192,7 @@ return; /* remove the module pointer from the core structure */ - remove_module(modi->modp); + ap_remove_module(modi->modp); /* unload the module space itself */ os_dl_unload((os_dl_module_handle_type)modi->modp->dynamic_load_handle); @@ -226,7 +226,7 @@ { void *modhandle; module *modp; - const char *szModuleFile=server_root_relative(cmd->pool, filename); + const char *szModuleFile=ap_server_root_relative(cmd->pool, filename); so_server_conf *sconf; moduleinfo *modi; moduleinfo *modie; @@ -236,7 +236,7 @@ * check for already existing module * If it already exists, we have nothing to do */ - sconf = (so_server_conf *)get_module_config(cmd->server->module_config, + sconf = (so_server_conf *)ap_get_module_config(cmd->server->module_config, &so_module); modie = (moduleinfo *)sconf->loaded_modules->elts; for (i = 0; i < sconf->loaded_modules->nelts; i++) { @@ -244,7 +244,7 @@ if (modi->name != NULL && strcmp(modi->name, modname) == 0) return NULL; } - modi = push_array(sconf->loaded_modules); + modi = ap_push_array(sconf->loaded_modules); modi->name = modname; /* @@ -252,12 +252,12 @@ */ if (!(modhandle = os_dl_load(szModuleFile))) { const char *my_error = os_dl_error(); - return pstrcat (cmd->pool, "Cannot load ", szModuleFile, + return ap_pstrcat (cmd->pool, "Cannot load ", szModuleFile, " into server: ", my_error ? my_error : "(reason unknown)", NULL); } - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "loaded module %s", modname); /* @@ -265,7 +265,7 @@ * for some platforms. */ #ifdef NEED_UNDERSCORE_SYM - modname = pstrcat(cmd->pool, "_", modname, NULL); + modname = ap_pstrcat(cmd->pool, "_", modname, NULL); #endif /* @@ -274,7 +274,7 @@ * symbol name. */ if (!(modp = (module *)(os_dl_sym (modhandle, modname)))) { - return pstrcat(cmd->pool, "Can't find module ", modname, + return ap_pstrcat(cmd->pool, "Can't find module ", modname, " in file ", filename, ":", os_dl_error(), NULL); } modi->modp = modp; @@ -283,15 +283,15 @@ /* * Add this module to the Apache core structures */ - add_module(modp); + ap_add_module(modp); /* * Register a cleanup in the config pool (normally pconf). When * we do a restart (or shutdown) this cleanup will cause the * shared object to be unloaded. */ - register_cleanup(cmd->pool, modi, - (void (*)(void*))unload_module, null_cleanup); + ap_register_cleanup(cmd->pool, modi, + (void (*)(void*))unload_module, ap_null_cleanup); /* * Finally we need to run the configuration functions @@ -317,20 +317,20 @@ void *handle; char *file; - file = server_root_relative(cmd->pool, filename); + file = ap_server_root_relative(cmd->pool, filename); if (!(handle = os_dl_load(file))) { const char *my_error = os_dl_error(); - return pstrcat (cmd->pool, "Cannot load ", filename, + return ap_pstrcat (cmd->pool, "Cannot load ", filename, " into server:", my_error ? my_error : "(reason unknown)", NULL); } - aplog_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, + ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, NULL, "loaded file %s", filename); - register_cleanup(cmd->pool, handle, unload_file, null_cleanup); + ap_register_cleanup(cmd->pool, handle, unload_file, ap_null_cleanup); return NULL; } 1.18 +30 -30 apache-1.3/src/modules/standard/mod_speling.c Index: mod_speling.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_speling.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- mod_speling.c 1998/03/31 12:53:22 1.17 +++ mod_speling.c 1998/04/11 12:00:51 1.18 @@ -98,7 +98,7 @@ void *server_conf = cmd->server->module_config; /* any non-NULL pointer means speling is enabled */ - set_module_config(server_conf, &speling_module, arg ? (void *) &speling_module : NULL); + ap_set_module_config(server_conf, &speling_module, arg ? (void *) &speling_module : NULL); return NULL; } @@ -190,7 +190,7 @@ struct DIR_TYPE *dir_entry; array_header *candidates = NULL; - if (!get_module_config(server_conf, &speling_module)) + if (!ap_get_module_config(server_conf, &speling_module)) return DECLINED; /* We only want to worry about GETs */ @@ -213,17 +213,17 @@ * So we do this in steps. First break r->filename into two pieces */ - filoc = rind(r->filename, '/'); + filoc = ap_rind(r->filename, '/'); /* Don't do anything if the request doesn't contain a slash, or requests "/" */ if (filoc == -1 || strcmp(r->uri, "/") == 0) return DECLINED; /* good = /correct-file */ - good = pstrndup(r->pool, r->filename, filoc); + good = ap_pstrndup(r->pool, r->filename, filoc); /* bad = mispelling */ - bad = pstrdup(r->pool, r->filename + filoc + 1); + bad = ap_pstrdup(r->pool, r->filename + filoc + 1); /* postgood = mispelling/more */ - postgood = pstrcat(r->pool, bad, r->path_info, NULL); + postgood = ap_pstrcat(r->pool, bad, r->path_info, NULL); urlen = strlen(r->uri); pglen = strlen(postgood); @@ -233,16 +233,16 @@ return DECLINED; /* url = /correct-url */ - url = pstrndup(r->pool, r->uri, (urlen - pglen)); + url = ap_pstrndup(r->pool, r->uri, (urlen - pglen)); /* Now open the directory and do ourselves a check... */ - dirp = popendir(r->pool, good); + dirp = ap_popendir(r->pool, good); if (dirp == NULL) /* Oops, not a directory... */ return DECLINED; - candidates = make_array(r->pool, 2, sizeof(misspelled_file)); + candidates = ap_make_array(r->pool, 2, sizeof(misspelled_file)); - dotloc = ind(bad, '.'); + dotloc = ap_ind(bad, '.'); if (dotloc == -1) dotloc = strlen(bad); @@ -255,7 +255,7 @@ * Do _not_ try to redirect this, it causes a loop! */ if (strcmp(bad, dir_entry->d_name) == 0) { - pclosedir(r->pool, dirp); + ap_pclosedir(r->pool, dirp); return OK; } /* @@ -263,8 +263,8 @@ * file, upper case request) */ else if (strcasecmp(bad, dir_entry->d_name) == 0) { - misspelled_file *sp_new = (misspelled_file *) push_array(candidates); - sp_new->name = pstrdup(r->pool, dir_entry->d_name); + misspelled_file *sp_new = (misspelled_file *) ap_push_array(candidates); + sp_new->name = ap_pstrdup(r->pool, dir_entry->d_name); sp_new->quality = SP_MISCAPITALIZED; } /* @@ -272,8 +272,8 @@ * missing/extra/transposed char) */ else if ((q = spdist(bad, dir_entry->d_name)) != SP_VERYDIFFERENT) { - misspelled_file *sp_new = (misspelled_file *) push_array(candidates); - sp_new->name = pstrdup(r->pool, dir_entry->d_name); + misspelled_file *sp_new = (misspelled_file *) ap_push_array(candidates); + sp_new->name = ap_pstrdup(r->pool, dir_entry->d_name); sp_new->quality = q; } /* The spdist() should have found the majority of the misspelled requests. @@ -305,20 +305,20 @@ * (e.g. foo.gif and foo.html) This code will pick the first one * it finds. Better than a Not Found, though. */ - int entloc = ind(dir_entry->d_name, '.'); + int entloc = ap_ind(dir_entry->d_name, '.'); if (entloc == -1) entloc = strlen(dir_entry->d_name); if ((dotloc == entloc) && !strncasecmp(bad, dir_entry->d_name, dotloc)) { - misspelled_file *sp_new = (misspelled_file *) push_array(candidates); - sp_new->name = pstrdup(r->pool, dir_entry->d_name); + misspelled_file *sp_new = (misspelled_file *) ap_push_array(candidates); + sp_new->name = ap_pstrdup(r->pool, dir_entry->d_name); sp_new->quality = SP_VERYDIFFERENT; } #endif } } - pclosedir(r->pool, dirp); + ap_pclosedir(r->pool, dirp); if (candidates->nelts != 0) { /* Wow... we found us a mispelling. Construct a fixed url */ @@ -326,7 +326,7 @@ misspelled_file *variant = (misspelled_file *) candidates->elts; int i; - ref = table_get(r->headers_in, "Referer"); + ref = ap_table_get(r->headers_in, "Referer"); qsort((void *) candidates->elts, candidates->nelts, sizeof(misspelled_file), sort_by_quality); @@ -340,13 +340,13 @@ if (variant[0].quality != SP_VERYDIFFERENT && (candidates->nelts == 1 || variant[0].quality != variant[1].quality)) { - nuri = pstrcat(r->pool, url, variant[0].name, + nuri = ap_pstrcat(r->pool, url, variant[0].name, r->path_info, NULL); - table_setn(r->headers_out, "Location", - construct_url(r->pool, nuri, r)); + ap_table_setn(r->headers_out, "Location", + ap_construct_url(r->pool, nuri, r)); - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r->server, ref ? "Fixed spelling: %s to %s from %s" : "Fixed spelling: %s to %s", r->uri, nuri, ref); @@ -384,7 +384,7 @@ for (i = 0; i < candidates->nelts; ++i) { /* The format isn't very neat... */ - t = pstrcat(p, t, "<li><a href=\"", url, + t = ap_pstrcat(p, t, "<li><a href=\"", url, variant[i].name, r->path_info, "\">", variant[i].name, r->path_info, "</a> (", sp_reason_str[(int) (variant[i].quality)], ")\n", NULL); @@ -399,23 +399,23 @@ if (i > 0 && i < candidates->nelts - 1 && variant[i].quality != SP_VERYDIFFERENT && variant[i + 1].quality == SP_VERYDIFFERENT) { - t = pstrcat(p, t, "</ul>\nFurthermore, the following related documents were found:\n<ul>\n", NULL); + t = ap_pstrcat(p, t, "</ul>\nFurthermore, the following related documents were found:\n<ul>\n", NULL); } } - t = pstrcat(p, "The document name you requested (<code>", + t = ap_pstrcat(p, "The document name you requested (<code>", r->uri, "</code>) could not be found on this server.\n" "However, we found documents with names similar to the one you requested.<p>" "Available documents:\n<ul>\n", t, "</ul>\n", NULL); /* If we know there was a referring page, add a note: */ if (ref != NULL) - t = pstrcat(p, t, "Please consider informing the owner of the <a href=\"", + t = ap_pstrcat(p, t, "Please consider informing the owner of the <a href=\"", ref, "\">referring page</a> about the broken link.\n", NULL); /* Pass our table to http_protocol.c (see mod_negotiation): */ - table_setn(notes, "variant-list", t); + ap_table_setn(notes, "variant-list", t); - aplog_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r->server, + ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_INFO, r->server, ref ? "Spelling fix: %s: %d candidates from %s" : "Spelling fix: %s: %d candidates", r->uri, candidates->nelts, ref); 1.85 +113 -113 apache-1.3/src/modules/standard/mod_status.c Index: mod_status.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_status.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -r1.84 -r1.85 --- mod_status.c 1998/04/06 05:21:43 1.84 +++ mod_status.c 1998/04/11 12:00:51 1.85 @@ -144,23 +144,23 @@ static void format_byte_out(request_rec *r, unsigned long bytes) { if (bytes < (5 * KBYTE)) - rprintf(r, "%d B", (int) bytes); + ap_rprintf(r, "%d B", (int) bytes); else if (bytes < (MBYTE / 2)) - rprintf(r, "%.1f kB", (float) bytes / KBYTE); + ap_rprintf(r, "%.1f kB", (float) bytes / KBYTE); else if (bytes < (GBYTE / 2)) - rprintf(r, "%.1f MB", (float) bytes / MBYTE); + ap_rprintf(r, "%.1f MB", (float) bytes / MBYTE); else - rprintf(r, "%.1f GB", (float) bytes / GBYTE); + ap_rprintf(r, "%.1f GB", (float) bytes / GBYTE); } static void format_kbyte_out(request_rec *r, unsigned long kbytes) { if (kbytes < KBYTE) - rprintf(r, "%d kB", (int) kbytes); + ap_rprintf(r, "%d kB", (int) kbytes); else if (kbytes < MBYTE) - rprintf(r, "%.1f MB", (float) kbytes / KBYTE); + ap_rprintf(r, "%.1f MB", (float) kbytes / KBYTE); else - rprintf(r, "%.1f GB", (float) kbytes / MBYTE); + ap_rprintf(r, "%.1f GB", (float) kbytes / MBYTE); } #endif @@ -176,13 +176,13 @@ hrs = tsecs % 24; days = tsecs / 24; if (days) - rprintf(r, " %ld day%s", days, days == 1 ? "" : "s"); + ap_rprintf(r, " %ld day%s", days, days == 1 ? "" : "s"); if (hrs) - rprintf(r, " %ld hour%s", hrs, hrs == 1 ? "" : "s"); + ap_rprintf(r, " %ld hour%s", hrs, hrs == 1 ? "" : "s"); if (mins) - rprintf(r, " %ld minute%s", mins, mins == 1 ? "" : "s"); + ap_rprintf(r, " %ld minute%s", mins, mins == 1 ? "" : "s"); if (secs) - rprintf(r, " %ld second%s", secs, secs == 1 ? "" : "s"); + ap_rprintf(r, " %ld second%s", secs, secs == 1 ? "" : "s"); } /* Main handler for x-httpd-status requests */ @@ -242,8 +242,8 @@ tu = ts = tcu = tcs = 0; - if (!exists_scoreboard_image()) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, + if (!ap_exists_scoreboard_image()) { + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, "Server status unavailable in inetd mode"); return HTTP_INTERNAL_SERVER_ERROR; } @@ -264,10 +264,10 @@ switch (status_options[i].id) { case STAT_OPT_REFRESH: if (*(loc + strlen(status_options[i].form_data_str)) == '=') - table_set(r->headers_out, status_options[i].hdr_out_str, + ap_table_set(r->headers_out, status_options[i].hdr_out_str, loc + strlen(status_options[i].hdr_out_str) + 1); else - table_set(r->headers_out, status_options[i].hdr_out_str, "1"); + ap_table_set(r->headers_out, status_options[i].hdr_out_str, "1"); break; case STAT_OPT_NOTABLE: no_table_report = 1; @@ -282,15 +282,15 @@ } } - send_http_header(r); + ap_send_http_header(r); if (r->header_only) return 0; - sync_scoreboard_image(); + ap_sync_scoreboard_image(); for (i = 0; i < HARD_SERVER_LIMIT; ++i) { - score_record = scoreboard_image->servers[i]; - ps_record = scoreboard_image->parent[i]; + score_record = ap_scoreboard_image->servers[i]; + ps_record = ap_scoreboard_image->parent[i]; res = score_record.status; stat_buffer[i] = status_flags[res]; if (res == SERVER_READY) @@ -317,131 +317,131 @@ #endif /* STATUS */ } - up_time = nowtime - restart_time; + up_time = nowtime - ap_restart_time; - hard_timeout("send status info", r); + ap_hard_timeout("send status info", r); if (!short_report) { - rputs("<HTML><HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD><BODY>\n", r); - rputs("<H1>Apache Server Status for ", r); - rvputs(r, server->server_hostname, "</H1>\n\n", NULL); - rvputs(r, "Server Version: ", apapi_get_server_version(), "<br>\n", + ap_rputs("<HTML><HEAD>\n<TITLE>Apache Status</TITLE>\n</HEAD><BODY>\n", r); + ap_rputs("<H1>Apache Server Status for ", r); + ap_rvputs(r, server->server_hostname, "</H1>\n\n", NULL); + ap_rvputs(r, "Server Version: ", ap_get_server_version(), "<br>\n", NULL); - rvputs(r, "Server Built: ", apapi_get_server_built(), "<br>\n<hr>\n", + ap_rvputs(r, "Server Built: ", ap_get_server_built(), "<br>\n<hr>\n", NULL); - rvputs(r, "Current Time: ", asctime(localtime(&nowtime)), "<br>\n", NULL); - rvputs(r, "Restart Time: ", asctime(localtime(&restart_time)), "<br>\n", + ap_rvputs(r, "Current Time: ", asctime(localtime(&nowtime)), "<br>\n", NULL); + ap_rvputs(r, "Restart Time: ", asctime(localtime(&ap_restart_time)), "<br>\n", NULL); - rputs("Server uptime: ", r); + ap_rputs("Server uptime: ", r); show_time(r, up_time); - rputs("<br>\n", r); + ap_rputs("<br>\n", r); } #if defined(STATUS) if (short_report) { - rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n", count, kbcount); + ap_rprintf(r, "Total Accesses: %lu\nTotal kBytes: %lu\n", count, kbcount); #ifndef NO_TIMES /* Allow for OS/2 not having CPU stats */ if (ts || tu || tcu || tcs) - rprintf(r, "CPULoad: %g\n", (tu + ts + tcu + tcs) / tick / up_time * 100.); + ap_rprintf(r, "CPULoad: %g\n", (tu + ts + tcu + tcs) / tick / up_time * 100.); #endif - rprintf(r, "Uptime: %ld\n", (long) (up_time)); + ap_rprintf(r, "Uptime: %ld\n", (long) (up_time)); if (up_time > 0) - rprintf(r, "ReqPerSec: %g\n", (float) count / (float) up_time); + ap_rprintf(r, "ReqPerSec: %g\n", (float) count / (float) up_time); if (up_time > 0) - rprintf(r, "BytesPerSec: %g\n", KBYTE * (float) kbcount / (float) up_time); + ap_rprintf(r, "BytesPerSec: %g\n", KBYTE * (float) kbcount / (float) up_time); if (count > 0) - rprintf(r, "BytesPerReq: %g\n", KBYTE * (float) kbcount / (float) count); + ap_rprintf(r, "BytesPerReq: %g\n", KBYTE * (float) kbcount / (float) count); } else { /* !short_report */ - rprintf(r, "Total accesses: %lu - Total Traffic: ", count); + ap_rprintf(r, "Total accesses: %lu - Total Traffic: ", count); format_kbyte_out(r, kbcount); #ifndef NO_TIMES /* Allow for OS/2 not having CPU stats */ - rputs("<br>\n", r); - rprintf(r, "CPU Usage: u%g s%g cu%g cs%g", + ap_rputs("<br>\n", r); + ap_rprintf(r, "CPU Usage: u%g s%g cu%g cs%g", tu / tick, ts / tick, tcu / tick, tcs / tick); if (ts || tu || tcu || tcs) - rprintf(r, " - %.3g%% CPU load", (tu + ts + tcu + tcs) / tick / up_time * 100.); + ap_rprintf(r, " - %.3g%% CPU load", (tu + ts + tcu + tcs) / tick / up_time * 100.); #endif - rputs("<br>\n", r); + ap_rputs("<br>\n", r); if (up_time > 0) - rprintf(r, "%.3g requests/sec - ", + ap_rprintf(r, "%.3g requests/sec - ", (float) count / (float) up_time); if (up_time > 0) { format_byte_out(r, KBYTE * (float) kbcount / (float) up_time); - rputs("/second - ", r); + ap_rputs("/second - ", r); } if (count > 0) { format_byte_out(r, KBYTE * (float) kbcount / (float) count); - rputs("/request", r); + ap_rputs("/request", r); } - rputs("<br>\n", r); + ap_rputs("<br>\n", r); } /* short_report */ #endif /* STATUS */ if (!short_report) - rprintf(r, "\n%d requests currently being processed, %d idle servers\n" + ap_rprintf(r, "\n%d requests currently being processed, %d idle servers\n" ,busy, ready); else - rprintf(r, "BusyServers: %d\nIdleServers: %d\n", busy, ready); + ap_rprintf(r, "BusyServers: %d\nIdleServers: %d\n", busy, ready); /* send the scoreboard 'table' out */ if (!short_report) - rputs("<PRE>", r); + ap_rputs("<PRE>", r); else - rputs("Scoreboard: ", r); + ap_rputs("Scoreboard: ", r); for (i = 0; i < HARD_SERVER_LIMIT; ++i) { - rputc(stat_buffer[i], r); + ap_rputc(stat_buffer[i], r); if ((i % STATUS_MAXLINE == (STATUS_MAXLINE - 1)) && !short_report) - rputs("\n", r); + ap_rputs("\n", r); } if (short_report) - rputs("\n", r); + ap_rputs("\n", r); else { - rputs("</PRE>\n", r); - rputs("Scoreboard Key: <br>\n", r); - rputs("\"<B><code>_</code></B>\" Waiting for Connection, \n", r); - rputs("\"<B><code>S</code></B>\" Starting up, \n", r); - rputs("\"<B><code>R</code></B>\" Reading Request,<BR>\n", r); - rputs("\"<B><code>W</code></B>\" Sending Reply, \n", r); - rputs("\"<B><code>K</code></B>\" Keepalive (read), \n", r); - rputs("\"<B><code>D</code></B>\" DNS Lookup,<BR>\n", r); - rputs("\"<B><code>L</code></B>\" Logging, \n", r); - rputs("\"<B><code>G</code></B>\" Gracefully finishing, \n", r); - rputs("\"<B><code>.</code></B>\" Open slot with no current process<P>\n", r); + ap_rputs("</PRE>\n", r); + ap_rputs("Scoreboard Key: <br>\n", r); + ap_rputs("\"<B><code>_</code></B>\" Waiting for Connection, \n", r); + ap_rputs("\"<B><code>S</code></B>\" Starting up, \n", r); + ap_rputs("\"<B><code>R</code></B>\" Reading Request,<BR>\n", r); + ap_rputs("\"<B><code>W</code></B>\" Sending Reply, \n", r); + ap_rputs("\"<B><code>K</code></B>\" Keepalive (read), \n", r); + ap_rputs("\"<B><code>D</code></B>\" DNS Lookup,<BR>\n", r); + ap_rputs("\"<B><code>L</code></B>\" Logging, \n", r); + ap_rputs("\"<B><code>G</code></B>\" Gracefully finishing, \n", r); + ap_rputs("\"<B><code>.</code></B>\" Open slot with no current process<P>\n", r); } #if defined(STATUS) if (!short_report) { if (no_table_report) - rputs("<p><hr><h2>Server Details</h2>\n\n", r); + ap_rputs("<p><hr><h2>Server Details</h2>\n\n", r); else #ifdef NO_TIMES /* Allow for OS/2 not having CPU stats */ - rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Host<th>VHost<th>Request</tr>\n\n", r); + ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Host<th>VHost<th>Request</tr>\n\n", r); #else - rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M<th>CPU\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Host<th>VHost<th>Request</tr>\n\n", r); + ap_rputs("<p>\n\n<table border=0><tr><th>Srv<th>PID<th>Acc<th>M<th>CPU\n<th>SS<th>Req<th>Conn<th>Child<th>Slot<th>Host<th>VHost<th>Request</tr>\n\n", r); #endif } for (i = 0; i < HARD_SERVER_LIMIT; ++i) { - score_record = scoreboard_image->servers[i]; - ps_record = scoreboard_image->parent[i]; + score_record = ap_scoreboard_image->servers[i]; + ps_record = ap_scoreboard_image->parent[i]; #if defined(NO_GETTIMEOFDAY) #ifndef NO_TIMES @@ -477,50 +477,50 @@ if (!short_report) { if (no_table_report) { if (score_record.status == SERVER_DEAD) - rprintf(r, "<b>Server %d</b> (-): %d|%lu|%lu [", + ap_rprintf(r, "<b>Server %d</b> (-): %d|%lu|%lu [", i, (int) conn_lres, my_lres, lres); else - rprintf(r, "<b>Server %d</b> (%d): %d|%lu|%lu [", + ap_rprintf(r, "<b>Server %d</b> (%d): %d|%lu|%lu [", i, (int) ps_record.pid, (int) conn_lres, my_lres, lres); switch (score_record.status) { case SERVER_READY: - rputs("Ready", r); + ap_rputs("Ready", r); break; case SERVER_STARTING: - rputs("Starting", r); + ap_rputs("Starting", r); break; case SERVER_BUSY_READ: - rputs("<b>Read</b>", r); + ap_rputs("<b>Read</b>", r); break; case SERVER_BUSY_WRITE: - rputs("<b>Write</b>", r); + ap_rputs("<b>Write</b>", r); break; case SERVER_BUSY_KEEPALIVE: - rputs("<b>Keepalive</b>", r); + ap_rputs("<b>Keepalive</b>", r); break; case SERVER_BUSY_LOG: - rputs("<b>Logging</b>", r); + ap_rputs("<b>Logging</b>", r); break; case SERVER_BUSY_DNS: - rputs("<b>DNS lookup</b>", r); + ap_rputs("<b>DNS lookup</b>", r); break; case SERVER_DEAD: - rputs("Dead", r); + ap_rputs("Dead", r); break; case SERVER_GRACEFUL: - rputs("Graceful", r); + ap_rputs("Graceful", r); break; default: - rputs("?STATE?", r); + ap_rputs("?STATE?", r); break; } #ifdef NO_TIMES /* Allow for OS/2 not having CPU stats */ - rprintf(r, "]\n %.0f %ld (", + ap_rprintf(r, "]\n %.0f %ld (", #else - rprintf(r, "] u%g s%g cu%g cs%g\n %.0f %ld (", + ap_rprintf(r, "] u%g s%g cu%g cs%g\n %.0f %ld (", score_record.times.tms_utime / tick, score_record.times.tms_stime / tick, score_record.times.tms_cutime / tick, @@ -533,60 +533,60 @@ #endif (long) req_time); format_byte_out(r, conn_bytes); - rputs("|", r); + ap_rputs("|", r); format_byte_out(r, my_bytes); - rputs("|", r); + ap_rputs("|", r); format_byte_out(r, bytes); - rputs(")\n", r); - rprintf(r, " <i>%s {%s}</i><br>\n\n", + ap_rputs(")\n", r); + ap_rprintf(r, " <i>%s {%s}</i><br>\n\n", score_record.client, - escape_html(r->pool, score_record.request)); + ap_escape_html(r->pool, score_record.request)); } else { /* !no_table_report */ if (score_record.status == SERVER_DEAD) - rprintf(r, "<tr><td><b>%d</b><td>-<td>%d/%lu/%lu", + ap_rprintf(r, "<tr><td><b>%d</b><td>-<td>%d/%lu/%lu", i, (int) conn_lres, my_lres, lres); else - rprintf(r, "<tr><td><b>%d</b><td>%d<td>%d/%lu/%lu", + ap_rprintf(r, "<tr><td><b>%d</b><td>%d<td>%d/%lu/%lu", i, (int) ps_record.pid, (int) conn_lres, my_lres, lres); switch (score_record.status) { case SERVER_READY: - rputs("<td>_", r); + ap_rputs("<td>_", r); break; case SERVER_STARTING: - rputs("<td><b>S</b>", r); + ap_rputs("<td><b>S</b>", r); break; case SERVER_BUSY_READ: - rputs("<td><b>R</b>", r); + ap_rputs("<td><b>R</b>", r); break; case SERVER_BUSY_WRITE: - rputs("<td><b>W</b>", r); + ap_rputs("<td><b>W</b>", r); break; case SERVER_BUSY_KEEPALIVE: - rputs("<td><b>K</b>", r); + ap_rputs("<td><b>K</b>", r); break; case SERVER_BUSY_LOG: - rputs("<td><b>L</b>", r); + ap_rputs("<td><b>L</b>", r); break; case SERVER_BUSY_DNS: - rputs("<td><b>D</b>", r); + ap_rputs("<td><b>D</b>", r); break; case SERVER_DEAD: - rputs("<td>.", r); + ap_rputs("<td>.", r); break; case SERVER_GRACEFUL: - rputs("<td>G", r); + ap_rputs("<td>G", r); break; default: - rputs("<td>?", r); + ap_rputs("<td>?", r); break; } #ifdef NO_TIMES /* Allow for OS/2 not having CPU stats */ - rprintf(r, "\n<td>%.0f<td>%ld", + ap_rprintf(r, "\n<td>%.0f<td>%ld", #else - rprintf(r, "\n<td>%.2f<td>%.0f<td>%ld", + ap_rprintf(r, "\n<td>%.2f<td>%.0f<td>%ld", (score_record.times.tms_utime + score_record.times.tms_stime + score_record.times.tms_cutime + @@ -598,12 +598,12 @@ difftime(nowtime, score_record.last_used), #endif (long) req_time); - rprintf(r, "<td>%-1.1f<td>%-2.2f<td>%-2.2f\n", + ap_rprintf(r, "<td>%-1.1f<td>%-2.2f<td>%-2.2f\n", (float) conn_bytes / KBYTE, (float) my_bytes / MBYTE, (float) bytes / MBYTE); - rprintf(r, "<td>%s<td nowrap>%s<td nowrap>%s</tr>\n\n", + ap_rprintf(r, "<td>%s<td nowrap>%s<td nowrap>%s</tr>\n\n", score_record.client, score_record.vhost, - escape_html(r->pool, score_record.request)); + ap_escape_html(r->pool, score_record.request)); } /* no_table_report */ } /* !short_report */ } /* if (<active child>) */ @@ -611,7 +611,7 @@ if (!(short_report || no_table_report)) { #ifdef __EMX__ - rputs("</table>\n \ + ap_rputs("</table>\n \ <hr> \ <table>\n \ <tr><th>Srv<td>Server number\n \ @@ -625,7 +625,7 @@ <tr><th>Slot<td>Total megabytes transferred this slot\n \ </table>\n", r); #else - rputs("</table>\n \ + ap_rputs("</table>\n \ <hr> \ <table>\n \ <tr><th>Srv<td>Server number\n \ @@ -644,19 +644,19 @@ #else /* !defined(STATUS) */ - rputs("<hr>To obtain a full report with current status information and", r); - rputs(" DNS and LOGGING status codes \n", r); - rputs("you need to recompile Apache after adding the line <pre>", r); - rputs("Rule STATUS=yes</pre>into the file <code>Configuration</code>\n", r); + ap_rputs("<hr>To obtain a full report with current status information and", r); + ap_rputs(" DNS and LOGGING status codes \n", r); + ap_rputs("you need to recompile Apache after adding the line <pre>", r); + ap_rputs("Rule STATUS=yes</pre>into the file <code>Configuration</code>\n", r); #endif /* STATUS */ if (!short_report) { - rputs(psignature("<HR>\n",r), r); - rputs("</BODY></HTML>\n", r); + ap_rputs(ap_psignature("<HR>\n",r), r); + ap_rputs("</BODY></HTML>\n", r); } - kill_timeout(r); + ap_kill_timeout(r); return 0; } 1.15 +8 -8 apache-1.3/src/modules/standard/mod_unique_id.c Index: mod_unique_id.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_unique_id.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- mod_unique_id.c 1998/03/31 12:53:23 1.14 +++ mod_unique_id.c 1998/04/11 12:00:53 1.15 @@ -148,7 +148,7 @@ */ if (XtOffsetOf(unique_id_rec, counter) + sizeof(cur_unique_id.counter) != 14) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, "mod_unique_id: sorry the size assumptions are wrong " "in mod_unique_id.c, please remove it from your server " "or fix the code!"); @@ -161,21 +161,21 @@ * be unique as the physical address of the machine */ if (gethostname(str, sizeof(str) - 1) != 0) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, "gethostname: mod_unique_id requires the hostname of the server"); exit(1); } str[sizeof(str) - 1] = '\0'; if ((hent = gethostbyname(str)) == NULL) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ALERT, s, "mod_unique_id: unable to gethostbyname(\"%s\")", str); exit(1); } global_in_addr = ((struct in_addr *) hent->h_addr_list[0])->s_addr; - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, s, "mod_unique_id: using ip addr %s", inet_ntoa(*(struct in_addr *) hent->h_addr_list[0])); @@ -232,7 +232,7 @@ * global_init ... but oh well. */ if (cur_unique_id.pid != pid) { - aplog_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, s, + ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_CRIT, s, "oh no! pids are greater than 32-bits! I'm broken!"); } @@ -290,8 +290,8 @@ /* copy the unique_id if this is an internal redirect (we're never * actually called for sub requests, so we don't need to test for * them) */ - if (r->prev && (e = table_get(r->subprocess_env, "REDIRECT_UNIQUE_ID"))) { - table_setn(r->subprocess_env, "UNIQUE_ID", e); + if (r->prev && (e = ap_table_get(r->subprocess_env, "REDIRECT_UNIQUE_ID"))) { + ap_table_setn(r->subprocess_env, "UNIQUE_ID", e); return DECLINED; } @@ -324,7 +324,7 @@ str[18] = uuencoder[((x[1] & 0x0f) << 2) | ((0 & 0xc0) >> 6)]; str[19] = '\0'; - table_setn(r->subprocess_env, "UNIQUE_ID", pstrdup(r->pool, str)); + ap_table_setn(r->subprocess_env, "UNIQUE_ID", ap_pstrdup(r->pool, str)); /* and increment the identifier for the next call */ counter = ntohs(cur_unique_id.counter) + 1; 1.35 +24 -24 apache-1.3/src/modules/standard/mod_userdir.c Index: mod_userdir.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_userdir.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- mod_userdir.c 1998/04/01 14:24:36 1.34 +++ mod_userdir.c 1998/04/11 12:00:53 1.35 @@ -111,12 +111,12 @@ static void *create_userdir_config(pool *p, server_rec *s) { userdir_config - * newcfg = (userdir_config *) pcalloc(p, sizeof(userdir_config)); + * newcfg = (userdir_config *) ap_pcalloc(p, sizeof(userdir_config)); newcfg->globally_disabled = 0; newcfg->userdir = DEFAULT_USER_DIR; - newcfg->enabled_users = make_table(p, 4); - newcfg->disabled_users = make_table(p, 4); + newcfg->enabled_users = ap_make_table(p, 4); + newcfg->disabled_users = ap_make_table(p, 4); return (void *) newcfg; } @@ -127,7 +127,7 @@ static const char *set_user_dir(cmd_parms *cmd, void *dummy, char *arg) { userdir_config - * s_cfg = (userdir_config *) get_module_config + * s_cfg = (userdir_config *) ap_get_module_config ( cmd->server->module_config, &userdir_module @@ -135,7 +135,7 @@ char *username; const char *usernames = arg; - char *kw = getword_conf(cmd->pool, &usernames); + char *kw = ap_getword_conf(cmd->pool, &usernames); table *usertable; /* @@ -168,7 +168,7 @@ * If the first (only?) value isn't one of our keywords, just copy * the string to the userdir string. */ - s_cfg->userdir = pstrdup(cmd->pool, arg); + s_cfg->userdir = ap_pstrdup(cmd->pool, arg); return NULL; } /* @@ -176,8 +176,8 @@ * the appropriate table. */ while (*usernames) { - username = getword_conf(cmd->pool, &usernames); - table_setn(usertable, username, kw); + username = ap_getword_conf(cmd->pool, &usernames); + ap_table_setn(usertable, username, kw); } return NULL; } @@ -192,7 +192,7 @@ { void *server_conf = r->server->module_config; const userdir_config *s_cfg = - (userdir_config *) get_module_config(server_conf, &userdir_module); + (userdir_config *) ap_get_module_config(server_conf, &userdir_module); char *name = r->uri; const char *userdirs = s_cfg->userdir; const char *w, *dname; @@ -213,7 +213,7 @@ } dname = name + 2; - w = getword(r->pool, &dname, '/'); + w = ap_getword(r->pool, &dname, '/'); /* * The 'dname' funny business involves backing it up to capture the '/' @@ -235,7 +235,7 @@ /* * Nor if there's an username but it's in the disabled list. */ - if (table_get(s_cfg->disabled_users, w) != NULL) { + if (ap_table_get(s_cfg->disabled_users, w) != NULL) { return DECLINED; } /* @@ -244,7 +244,7 @@ */ if ( s_cfg->globally_disabled && - (table_get(s_cfg->enabled_users, w) == NULL) + (ap_table_get(s_cfg->enabled_users, w) == NULL) ) { return DECLINED; } @@ -254,13 +254,13 @@ */ while (*userdirs) { - const char *userdir = getword_conf(r->pool, &userdirs); + const char *userdir = ap_getword_conf(r->pool, &userdirs); char *filename = NULL; if (strchr(userdir, '*')) - x = getword(r->pool, &userdir, '*'); + x = ap_getword(r->pool, &userdir, '*'); - if (userdir[0] == '\0' || os_is_path_absolute(userdir)) { + if (userdir[0] == '\0' || ap_is_path_absolute(userdir)) { if (x) { #ifdef WIN32 /* @@ -274,19 +274,19 @@ if (strchr(x, ':')) #endif /* WIN32 */ { - redirect = pstrcat(r->pool, x, w, userdir, dname, NULL); - table_setn(r->headers_out, "Location", redirect); + redirect = ap_pstrcat(r->pool, x, w, userdir, dname, NULL); + ap_table_setn(r->headers_out, "Location", redirect); return REDIRECT; } else - filename = pstrcat(r->pool, x, w, userdir, NULL); + filename = ap_pstrcat(r->pool, x, w, userdir, NULL); } else - filename = pstrcat(r->pool, userdir, "/", w, NULL); + filename = ap_pstrcat(r->pool, userdir, "/", w, NULL); } else if (strchr(userdir, ':')) { - redirect = pstrcat(r->pool, userdir, "/", w, dname, NULL); - table_setn(r->headers_out, "Location", redirect); + redirect = ap_pstrcat(r->pool, userdir, "/", w, dname, NULL); + ap_table_setn(r->headers_out, "Location", redirect); return REDIRECT; } else { @@ -298,9 +298,9 @@ if ((pw = getpwnam(w))) { #ifdef __EMX__ /* Need to manually add user name for OS/2 */ - filename = pstrcat(r->pool, pw->pw_dir, w, "/", userdir, NULL); + filename = ap_pstrcat(r->pool, pw->pw_dir, w, "/", userdir, NULL); #else - filename = pstrcat(r->pool, pw->pw_dir, "/", userdir, NULL); + filename = ap_pstrcat(r->pool, pw->pw_dir, "/", userdir, NULL); #endif } #endif /* WIN32 */ @@ -313,7 +313,7 @@ * used, for example, to run a CGI script for the user. */ if (filename && (!*userdirs || stat(filename, &statbuf) != -1)) { - r->filename = pstrcat(r->pool, filename, dname, NULL); + r->filename = ap_pstrcat(r->pool, filename, dname, NULL); /* when statbuf contains info on r->filename we can save a syscall * by copying it to r->finfo */ 1.34 +19 -19 apache-1.3/src/modules/standard/mod_usertrack.c Index: mod_usertrack.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_usertrack.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- mod_usertrack.c 1998/04/06 05:21:44 1.33 +++ mod_usertrack.c 1998/04/11 12:00:53 1.34 @@ -125,7 +125,7 @@ static void make_cookie(request_rec *r) { - cookie_log_state *cls = get_module_config(r->server->module_config, + cookie_log_state *cls = ap_get_module_config(r->server->module_config, &usertrack_module); #if defined(NO_GETTIMEOFDAY) && !defined(NO_TIMES) clock_t mpe_times; @@ -138,7 +138,7 @@ char cookiebuf[1024]; char *new_cookie; char *dot; - const char *rname = get_remote_host(r->connection, r->per_dir_config, + const char *rname = ap_get_remote_host(r->connection, r->per_dir_config, REMOTE_NAME); if ((dot = strchr(rname, '.'))) @@ -187,24 +187,24 @@ tms = gmtime(&when); /* Cookie with date; as strftime '%a, %d-%h-%y %H:%M:%S GMT' */ - new_cookie = psprintf(r->pool, + new_cookie = ap_psprintf(r->pool, "%s%s; path=/; expires=%s, %.2d-%s-%.2d %.2d:%.2d:%.2d GMT", - COOKIE_NAME, cookiebuf, day_snames[tms->tm_wday], - tms->tm_mday, month_snames[tms->tm_mon], + COOKIE_NAME, cookiebuf, ap_day_snames[tms->tm_wday], + tms->tm_mday, ap_month_snames[tms->tm_mon], tms->tm_year % 100, tms->tm_hour, tms->tm_min, tms->tm_sec); } else - new_cookie = psprintf(r->pool, "%s%s; path=/", COOKIE_NAME, cookiebuf); + new_cookie = ap_psprintf(r->pool, "%s%s; path=/", COOKIE_NAME, cookiebuf); - table_setn(r->headers_out, "Set-Cookie", new_cookie); - table_setn(r->notes, "cookie", pstrdup(r->pool, cookiebuf)); /* log first time */ + ap_table_setn(r->headers_out, "Set-Cookie", new_cookie); + ap_table_setn(r->notes, "cookie", ap_pstrdup(r->pool, cookiebuf)); /* log first time */ return; } static int spot_cookie(request_rec *r) { - int *enable = (int *) get_module_config(r->per_dir_config, + int *enable = (int *) ap_get_module_config(r->per_dir_config, &usertrack_module); char *cookie; char *value; @@ -212,18 +212,18 @@ if (!*enable) return DECLINED; - if ((cookie = table_get(r->headers_in, "Cookie"))) + if ((cookie = ap_table_get(r->headers_in, "Cookie"))) if ((value = strstr(cookie, COOKIE_NAME))) { char *cookiebuf, *cookieend; value += strlen(COOKIE_NAME); - cookiebuf = pstrdup(r->pool, value); + cookiebuf = ap_pstrdup(r->pool, value); cookieend = strchr(cookiebuf, ';'); if (cookieend) *cookieend = '\0'; /* Ignore anything after a ; */ /* Set the cookie in a note, for logging */ - table_setn(r->notes, "cookie", cookiebuf); + ap_table_setn(r->notes, "cookie", cookiebuf); return DECLINED; /* Theres already a cookie, no new one */ } @@ -234,7 +234,7 @@ static void *make_cookie_log_state(pool *p, server_rec *s) { cookie_log_state *cls = - (cookie_log_state *) palloc(p, sizeof(cookie_log_state)); + (cookie_log_state *) ap_palloc(p, sizeof(cookie_log_state)); cls->expires = 0; @@ -243,7 +243,7 @@ static void *make_cookie_dir(pool *p, char *d) { - return (void *) pcalloc(p, sizeof(int)); + return (void *) ap_pcalloc(p, sizeof(int)); } static const char *set_cookie_enable(cmd_parms *cmd, int *c, int arg) @@ -254,7 +254,7 @@ static const char *set_cookie_exp(cmd_parms *parms, void *dummy, const char *arg) { - cookie_log_state *cls = get_module_config(parms->server->module_config, + cookie_log_state *cls = ap_get_module_config(parms->server->module_config, &usertrack_module); time_t factor, modifier = 0; time_t num = 0; @@ -272,9 +272,9 @@ * CookieExpires "[plus] {<num> <type>}*" */ - word = getword_conf(parms->pool, &arg); + word = ap_getword_conf(parms->pool, &arg); if (!strncasecmp(word, "plus", 1)) { - word = getword_conf(parms->pool, &arg); + word = ap_getword_conf(parms->pool, &arg); }; /* {<num> <type>}* */ @@ -286,7 +286,7 @@ return "bad expires code, numeric value expected."; /* <type> */ - word = getword_conf(parms->pool, &arg); + word = ap_getword_conf(parms->pool, &arg); if (!word[0]) return "bad expires code, missing <type>"; @@ -311,7 +311,7 @@ modifier = modifier + factor * num; /* next <num> */ - word = getword_conf(parms->pool, &arg); + word = ap_getword_conf(parms->pool, &arg); } cls->expires = modifier; 1.5 +11 -11 apache-1.3/src/modules/test/mod_rndchunk.c Index: mod_rndchunk.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/test/mod_rndchunk.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_rndchunk.c 1998/03/31 12:53:36 1.4 +++ mod_rndchunk.c 1998/04/11 12:01:01 1.5 @@ -104,23 +104,23 @@ return DECLINED; r->content_type = "text/html"; - send_http_header(r); + ap_send_http_header(r); if(r->header_only) { return 0; } - hard_timeout("send_rndchunk", r); + ap_hard_timeout("send_rndchunk", r); if (!r->chunked) { - rputs("Not chunked!", r); - kill_timeout(r); + ap_rputs("Not chunked!", r); + ap_kill_timeout(r); return 0; } args = r->args; if (!args) { error: - rputs("Must include args! ... of the form <code>?seed,count</code>", r); - kill_timeout(r); + ap_rputs("Must include args! ... of the form <code>?seed,count</code>", r); + ap_kill_timeout(r); return 0; } seed = strtol(args, &endptr, 0); @@ -134,22 +134,22 @@ for (i = 0; i < count; ++i) { len = random() % (MAX_SEGMENT + ONE_WEIGHT); if (len >= MAX_SEGMENT) { - rputc((i & 1) ? '0' : '1', r); + ap_rputc((i & 1) ? '0' : '1', r); } else if (len == 0) { /* not a really nice thing to do, but we need to test * beginning/ending chunks as well */ - bsetflag(r->connection->client, B_CHUNK, 0); - bsetflag(r->connection->client, B_CHUNK, 1); + ap_bsetflag(r->connection->client, B_CHUNK, 0); + ap_bsetflag(r->connection->client, B_CHUNK, 1); } else { memset(buf, '2' + len, len); buf[len] = 0; - rputs(buf, r); + ap_rputs(buf, r); } } - kill_timeout(r); + ap_kill_timeout(r); return 0; } 1.5 +16 -16 apache-1.3/src/modules/test/mod_test_util_uri.c Index: mod_test_util_uri.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/test/mod_test_util_uri.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- mod_test_util_uri.c 1998/03/31 12:53:37 1.4 +++ mod_test_util_uri.c 1998/04/11 12:01:01 1.5 @@ -148,7 +148,7 @@ failures = 0; - input_uri = palloc(r->pool, + input_uri = ap_palloc(r->pool, strlen(pieces->scheme) + 3 + strlen(pieces->user) + 1 + strlen(pieces->password) + 1 @@ -206,8 +206,8 @@ } *strp = 0; - sub = make_sub_pool(r->pool); - status = parse_uri_components(sub, input_uri, &result); + sub = ap_make_sub_pool(r->pool); + status = ap_parse_uri_components(sub, input_uri, &result); if (status == HTTP_OK) { #define CHECK(f) \ if ((expect & T_##f) \ @@ -228,19 +228,19 @@ #undef CHECK } if (status != HTTP_OK) { - rprintf(r, "<tr><td>%d</td><td>0x%02x</td><td>0x%02x</td><td>%d</td><td>\"%s\"</td>", row, u, expect, status, input_uri); + ap_rprintf(r, "<tr><td>%d</td><td>0x%02x</td><td>0x%02x</td><td>%d</td><td>\"%s\"</td>", row, u, expect, status, input_uri); #define DUMP(f) \ if (result.f) { \ - rvputs(r, "<td>\"", result.f, "\"<br>", NULL); \ + ap_rvputs(r, "<td>\"", result.f, "\"<br>", NULL); \ } \ else { \ - rputs("<td>NULL<br>", r); \ + ap_rputs("<td>NULL<br>", r); \ } \ if (expect & T_##f) { \ - rvputs(r, "\"", pieces->f, "\"</td>", NULL); \ + ap_rvputs(r, "\"", pieces->f, "\"</td>", NULL); \ } \ else { \ - rputs("NULL</td>", r); \ + ap_rputs("NULL</td>", r); \ } DUMP(scheme); DUMP(user); @@ -251,10 +251,10 @@ DUMP(query); DUMP(fragment); #undef DUMP - rputs("</tr>\n", r); + ap_rputs("</tr>\n", r); ++failures; } - destroy_pool(sub); + ap_destroy_pool(sub); } return failures; } @@ -269,13 +269,13 @@ return DECLINED; r->content_type = "text/html"; - send_http_header(r); + ap_send_http_header(r); if(r->header_only) { return 0; } - hard_timeout("test_util_uri", r); + ap_hard_timeout("test_util_uri", r); - rputs(" + ap_rputs(" <html><body> <p>Key: <dl> @@ -295,7 +295,7 @@ <p>Only failures are displayed. <p> <table><tr><th>row</th><th>u</th><th>expect</th><th>status</th><th>input uri</th>", r); -#define HEADER(f) rprintf(r, "<th>" #f "<br>0x%02x</th>", T_##f) +#define HEADER(f) ap_rprintf(r, "<th>" #f "<br>0x%02x</th>", T_##f) HEADER(scheme); HEADER(user); HEADER(password); @@ -315,14 +315,14 @@ for (i = 0; i < sizeof(uri_tests) / sizeof(uri_tests[0]); ++i) { total_failures += iterate_pieces(r, &uri_tests[i], i); if (total_failures > 256) { - rprintf(r, "</table>\n<b>Stopped early to save your browser " + ap_rprintf(r, "</table>\n<b>Stopped early to save your browser " "from certain death!</b>\nTOTAL FAILURES = %u\n", total_failures); return OK; } } } - rprintf(r, "</table>\nTOTAL FAILURES = %u\n", total_failures); + ap_rprintf(r, "</table>\nTOTAL FAILURES = %u\n", total_failures); return OK; } 1.4 +1 -1 apache-1.3/src/os/bs2000/os-inline.c Index: os-inline.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os-inline.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- os-inline.c 1998/02/28 15:39:34 1.3 +++ os-inline.c 1998/04/11 12:01:02 1.4 @@ -25,7 +25,7 @@ #endif -INLINE int os_is_path_absolute(const char *file) +INLINE int ap_is_path_absolute(const char *file) { return (file && file[0] == '/' ? 1 : 0); } 1.6 +2 -2 apache-1.3/src/os/bs2000/os.c Index: os.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- os.c 1998/03/31 12:53:39 1.5 +++ os.c 1998/04/11 12:01:02 1.6 @@ -83,13 +83,13 @@ if (r->content_type && strncmp(r->content_type, "text/", 5)==0) { if (strncmp(r->content_type, ASCIITEXT_MAGIC_TYPE_PREFIX, sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) - r->content_type = pstrcat(r->pool, "text/", + r->content_type = ap_pstrcat(r->pool, "text/", r->content_type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, NULL); else /* translate EBCDIC to ASCII */ convert_to_ascii = 1; } - bsetflag(r->connection->client, B_EBCDIC2ASCII, convert_to_ascii); + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert_to_ascii); return convert_to_ascii; } 1.5 +1 -1 apache-1.3/src/os/bs2000/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/os.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- os.h 1998/02/14 03:07:55 1.4 +++ os.h 1998/04/11 12:01:03 1.5 @@ -20,7 +20,7 @@ /* Compiler does not support inline, so prototype the inlineable functions * as normal */ -extern int os_is_path_absolute(const char *f); +extern int ap_is_path_absolute(const char *f); #endif /* Sorry if this is ugly, but the include order doesn't allow me 1.4 +1 -1 apache-1.3/src/os/emx/os-inline.c Index: os-inline.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/emx/os-inline.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- os-inline.c 1998/02/28 15:39:37 1.3 +++ os-inline.c 1998/04/11 12:01:03 1.4 @@ -25,7 +25,7 @@ #endif -INLINE int os_is_path_absolute(const char *file) +INLINE int ap_is_path_absolute(const char *file) { /* For now, just do the same check that http_request.c and mod_alias.c * do. 1.3 +1 -1 apache-1.3/src/os/emx/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/emx/os.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- os.h 1998/02/14 03:07:57 1.2 +++ os.h 1998/04/11 12:01:04 1.3 @@ -16,7 +16,7 @@ /* Compiler does not support inline, so prototype the inlineable functions * as normal */ -extern int os_is_path_absolute(const char *f); +extern int ap_is_path_absolute(const char *f); #endif /* OS/2 doesn't have symlinks so S_ISLNK is always false */ 1.5 +1 -1 apache-1.3/src/os/unix/os-inline.c Index: os-inline.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os-inline.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- os-inline.c 1998/02/28 15:39:36 1.4 +++ os-inline.c 1998/04/11 12:01:04 1.5 @@ -25,7 +25,7 @@ #endif -INLINE int os_is_path_absolute(const char *file) +INLINE int ap_is_path_absolute(const char *file) { return file[0] == '/'; } 1.18 +1 -1 apache-1.3/src/os/unix/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/unix/os.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- os.h 1998/04/09 08:20:30 1.17 +++ os.h 1998/04/11 12:01:05 1.18 @@ -76,7 +76,7 @@ /* Compiler does not support inline, so prototype the inlineable functions * as normal */ -extern int os_is_path_absolute(const char *f); +extern int ap_is_path_absolute(const char *f); #endif /* 1.9 +6 -6 apache-1.3/src/os/win32/mod_dll.c Index: mod_dll.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/mod_dll.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- mod_dll.c 1998/03/31 12:53:42 1.8 +++ mod_dll.c 1998/04/11 12:01:05 1.9 @@ -112,24 +112,24 @@ { HINSTANCE modhandle; module *modp; - const char *szModuleFile=server_root_relative(cmd->pool, filename); + const char *szModuleFile=ap_server_root_relative(cmd->pool, filename); if (been_there_done_that) return NULL; if (!(modhandle = LoadLibraryEx(szModuleFile, NULL, LOAD_WITH_ALTERED_SEARCH_PATH))) - return pstrcat (cmd->pool, "Cannot load ", szModuleFile, " into server", + return ap_pstrcat (cmd->pool, "Cannot load ", szModuleFile, " into server", NULL); /* If I knew what the correct cast is here, I'd be happy. But * I don't. So I'll use (void *). It works. */ if (!(modp = (module *)(GetProcAddress (modhandle, modname)))) { - return pstrcat (cmd->pool, "Can't find module ", modname, + return ap_pstrcat (cmd->pool, "Can't find module ", modname, " in file ", filename, NULL); } - add_module (modp); + ap_add_module (modp); /* Alethea Patch (rws,djw2) - need to run configuration functions in new modules */ @@ -150,8 +150,8 @@ { if (been_there_done_that) return NULL; - if (!LoadLibrary(server_root_relative(cmd->pool, filename))) - return pstrcat (cmd->pool, "Cannot load ", filename, " into server", NULL); + if (!LoadLibrary(ap_server_root_relative(cmd->pool, filename))) + return ap_pstrcat (cmd->pool, "Cannot load ", filename, " into server", NULL); return NULL; } 1.10 +45 -45 apache-1.3/src/os/win32/mod_isapi.c Index: mod_isapi.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/mod_isapi.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- mod_isapi.c 1998/03/31 12:53:43 1.9 +++ mod_isapi.c 1998/04/11 12:01:05 1.10 @@ -116,21 +116,21 @@ int isapi_handler (request_rec *r) { LPEXTENSION_CONTROL_BLOCK ecb = - pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK)); - HSE_VERSION_INFO *pVer = pcalloc(r->pool, sizeof(HSE_VERSION_INFO)); + ap_pcalloc(r->pool, sizeof(struct _EXTENSION_CONTROL_BLOCK)); + HSE_VERSION_INFO *pVer = ap_pcalloc(r->pool, sizeof(HSE_VERSION_INFO)); HINSTANCE isapi_handle; BOOL (*isapi_version)(HSE_VERSION_INFO *); /* entry point 1 */ DWORD (*isapi_entry)(LPEXTENSION_CONTROL_BLOCK); /* entry point 2 */ BOOL (*isapi_term)(DWORD); /* optional entry point 3 */ - isapi_cid *cid = pcalloc(r->pool, sizeof(isapi_cid)); + isapi_cid *cid = ap_pcalloc(r->pool, sizeof(isapi_cid)); table *e = r->subprocess_env; int retval; /* Use similar restrictions as CGIs */ - if (!(allow_options(r) & OPT_EXECCGI)) + if (!(ap_allow_options(r) & OPT_EXECCGI)) return FORBIDDEN; if (r->finfo.st_mode == 0) @@ -143,14 +143,14 @@ if (!(isapi_handle = LoadLibraryEx(r->filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH))) { - aplog_error(APLOG_MARK, APLOG_ALERT, r->server, + ap_log_error(APLOG_MARK, APLOG_ALERT, r->server, "Could not load DLL: %s", r->filename); return SERVER_ERROR; } if (!(isapi_version = (void *)(GetProcAddress(isapi_handle, "GetExtensionVersion")))) { - aplog_error(APLOG_MARK, APLOG_ALERT, r->server, + ap_log_error(APLOG_MARK, APLOG_ALERT, r->server, "DLL could not load GetExtensionVersion(): %s", r->filename); FreeLibrary(isapi_handle); return SERVER_ERROR; @@ -158,7 +158,7 @@ if (!(isapi_entry = (void *)(GetProcAddress(isapi_handle, "HttpExtensionProc")))) { - aplog_error(APLOG_MARK, APLOG_ALERT, r->server, + ap_log_error(APLOG_MARK, APLOG_ALERT, r->server, "DLL could not load HttpExtensionProc(): %s", r->filename); FreeLibrary(isapi_handle); return SERVER_ERROR; @@ -169,15 +169,15 @@ /* Run GetExtensionVersion() */ if ((*isapi_version)(pVer) != TRUE) { - aplog_error(APLOG_MARK, APLOG_ALERT, r->server, + ap_log_error(APLOG_MARK, APLOG_ALERT, r->server, "ISAPI GetExtensionVersion() failed: %s", r->filename); FreeLibrary(isapi_handle); return SERVER_ERROR; } /* Set up variables */ - add_common_vars(r); - add_cgi_vars(r); + ap_add_common_vars(r); + ap_add_cgi_vars(r); /* Set up connection ID */ ecb->ConnID = (HCONN)cid; @@ -190,25 +190,25 @@ ecb->dwHttpStatusCode = 0; strcpy(ecb->lpszLogData, ""); ecb->lpszMethod = r->method; - ecb->lpszQueryString = table_get(e, "QUERY_STRING"); - ecb->lpszPathInfo = table_get(e, "PATH_INFO"); - ecb->lpszPathTranslated = table_get(e, "PATH_TRANSLATED"); - ecb->lpszContentType = table_get(e, "CONTENT_TYPE"); + ecb->lpszQueryString = ap_table_get(e, "QUERY_STRING"); + ecb->lpszPathInfo = ap_table_get(e, "PATH_INFO"); + ecb->lpszPathTranslated = ap_table_get(e, "PATH_TRANSLATED"); + ecb->lpszContentType = ap_table_get(e, "CONTENT_TYPE"); /* Set up client input */ - if ((retval = setup_client_block(r, REQUEST_CHUNKED_ERROR))) { + if ((retval = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) { if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD); FreeLibrary(isapi_handle); return retval; } - if (should_client_block(r)) { + if (ap_should_client_block(r)) { /* Unlike IIS, which limits this to 48k, we read the whole * sucker in. I suppose this could be bad for memory if someone * uploaded the complete works of Shakespeare. Well, WebSite * does the same thing. */ - long to_read = atol(table_get(e, "CONTENT_LENGTH")); + long to_read = atol(ap_table_get(e, "CONTENT_LENGTH")); long read; /* Actually, let's cap it at 48k, until we figure out what @@ -222,9 +222,9 @@ return HTTP_REQUEST_ENTITY_TOO_LARGE; } - ecb->lpbData = pcalloc(r->pool, 1 + to_read); + ecb->lpbData = ap_pcalloc(r->pool, 1 + to_read); - if ((read = get_client_block(r, ecb->lpbData, to_read)) < 0) { + if ((read = ap_get_client_block(r, ecb->lpbData, to_read)) < 0) { if (isapi_term) (*isapi_term)(HSE_TERM_MUST_UNLOAD); FreeLibrary(isapi_handle); return SERVER_ERROR; @@ -260,7 +260,7 @@ /* Check for a log message - and log it */ if (ecb->lpszLogData && strcmp(ecb->lpszLogData, "")) - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "%s: %s", ecb->lpszLogData, r->filename); /* All done with the DLL... get rid of it */ @@ -279,7 +279,7 @@ return OK; case HSE_STATUS_PENDING: /* We don't support this */ - aplog_error(APLOG_MARK, APLOG_WARNING, r->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, r->server, "ISAPI asynchronous I/O not supported: %s", r->filename); case HSE_STATUS_ERROR: default: @@ -303,7 +303,7 @@ /* We don't support NT users, so this is always the same as * REMOTE_USER */ - result = table_get(e, "REMOTE_USER"); + result = ap_table_get(e, "REMOTE_USER"); } else if (!strcasecmp(lpszVariableName, "SERVER_PORT_SECURE")) { /* Apache doesn't support secure requests inherently, so @@ -316,7 +316,7 @@ result = r->uri; } else { - result = table_get(e, lpszVariableName); + result = ap_table_get(e, lpszVariableName); } if (result) { @@ -341,13 +341,13 @@ /* We only support synchronous writing */ if (dwReserved && dwReserved != HSE_IO_SYNC) { - aplog_error(APLOG_MARK, APLOG_WARNING, r->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, r->server, "ISAPI asynchronous I/O not supported: %s", r->filename); SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - if ((writ = rwrite(Buffer, *lpwdwBytes, r)) == EOF) { + if ((writ = ap_rwrite(Buffer, *lpwdwBytes, r)) == EOF) { SetLastError(ERROR); /* XXX: Find the right error code */ return FALSE; } @@ -373,7 +373,7 @@ /* Set the status to be returned when the HttpExtensionProc() * is done. */ - table_set (r->headers_out, "Location", lpvBuffer); + ap_table_set (r->headers_out, "Location", lpvBuffer); cid->status = cid->r->status = cid->ecb->dwHttpStatusCode = REDIRECT; return TRUE; @@ -383,21 +383,21 @@ if (r->remaining > 0) { char argsbuffer[HUGE_STRING_LEN]; - while (get_client_block(r, argsbuffer, HUGE_STRING_LEN)); + while (ap_get_client_block(r, argsbuffer, HUGE_STRING_LEN)); } /* Reset the method to GET */ - r->method = pstrdup(r->pool, "GET"); + r->method = ap_pstrdup(r->pool, "GET"); r->method_number = M_GET; /* Don't let anyone think there's still data */ - table_unset(r->headers_in, "Content-Length"); + ap_table_unset(r->headers_in, "Content-Length"); - internal_redirect((char *)lpvBuffer, r); + ap_internal_redirect((char *)lpvBuffer, r); return TRUE; case HSE_REQ_SEND_RESPONSE_HEADER: - r->status_line = lpvBuffer ? lpvBuffer : pstrdup(r->pool, "200 OK"); + r->status_line = lpvBuffer ? lpvBuffer : ap_pstrdup(r->pool, "200 OK"); sscanf(r->status_line, "%d", &r->status); cid->ecb->dwHttpStatusCode = r->status; @@ -409,12 +409,12 @@ * Easy case first: */ if (!lpdwDataType) { - send_http_header(r); + ap_send_http_header(r); return TRUE; } /* Make a copy - don't disturb the original */ - data = pstrdup(r->pool, (char *)lpdwDataType); + data = ap_pstrdup(r->pool, (char *)lpdwDataType); /* We *should* break before this while loop ends */ while (*data) { @@ -422,7 +422,7 @@ int p; if (!lf) { /* Huh? Invalid data, I think */ - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "ISA sent invalid headers: %s", r->filename); SetLastError(ERROR); /* XXX: Find right error */ return FALSE; @@ -441,7 +441,7 @@ if (!(value = strchr(data, ':'))) { SetLastError(ERROR); /* XXX: Find right error */ - aplog_error(APLOG_MARK, APLOG_ERR, r->server, + ap_log_error(APLOG_MARK, APLOG_ERR, r->server, "ISA sent invalid headers", r->filename); return FALSE; } @@ -460,20 +460,20 @@ char *endp = value + strlen(value) - 1; while (endp > value && isspace(*endp)) *endp-- = '\0'; - r->content_type = pstrdup (r->pool, value); - str_tolower(r->content_type); + r->content_type = ap_pstrdup (r->pool, value); + ap_str_tolower(r->content_type); } else if (!strcasecmp(data, "Content-Length")) { - table_set(r->headers_out, data, value); + ap_table_set(r->headers_out, data, value); } else if (!strcasecmp(data, "Transfer-Encoding")) { - table_set(r->headers_out, data, value); + ap_table_set(r->headers_out, data, value); } else if (!strcasecmp(data, "Set-Cookie")) { - table_add(r->err_headers_out, data, value); + ap_table_add(r->err_headers_out, data, value); } else { - table_merge(r->err_headers_out, data, value); + ap_table_merge(r->err_headers_out, data, value); } /* Reset data */ @@ -482,16 +482,16 @@ /* All the headers should be set now */ - send_http_header(r); + ap_send_http_header(r); /* Any data left should now be sent directly */ - rputs(data, r); + ap_rputs(data, r); return TRUE; case HSE_REQ_MAP_URL_TO_PATH: /* Map a URL to a filename */ - subreq = sub_req_lookup_uri(pstrndup(r->pool, (char *)lpvBuffer, + subreq = ap_sub_req_lookup_uri(ap_pstrndup(r->pool, (char *)lpvBuffer, *lpdwSize), r); GetFullPathName(subreq->filename, *lpdwSize - 1, (char *)lpvBuffer, NULL); @@ -516,7 +516,7 @@ /* We don't support all this async I/O, Microsoft-specific stuff */ case HSE_REQ_IO_COMPLETION: case HSE_REQ_TRANSMIT_FILE: - aplog_error(APLOG_MARK, APLOG_WARNING, r->server, + ap_log_error(APLOG_MARK, APLOG_WARNING, r->server, "ISAPI asynchronous I/O not supported: %s", r->filename); default: SetLastError(ERROR_INVALID_PARAMETER); 1.8 +2 -2 apache-1.3/src/os/win32/modules.c Index: modules.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/modules.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- modules.c 1998/02/24 10:30:56 1.7 +++ modules.c 1998/04/11 12:01:06 1.8 @@ -25,7 +25,7 @@ extern module setenvif_module; extern module isapi_module; -module *prelinked_modules[] = { +module *ap_prelinked_modules[] = { &core_module, &so_module, &mime_module, @@ -47,7 +47,7 @@ &isapi_module, NULL }; -module *preloaded_modules[] = { +module *ap_preloaded_modules[] = { &core_module, &so_module, &mime_module, 1.4 +10 -10 apache-1.3/src/os/win32/multithread.c Index: multithread.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/multithread.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- multithread.c 1997/08/13 08:37:34 1.3 +++ multithread.c 1998/04/11 12:01:06 1.4 @@ -72,18 +72,18 @@ -API_EXPORT(mutex *) create_mutex(char *name) +API_EXPORT(mutex *) ap_create_mutex(char *name) { return(CreateMutex(NULL, FALSE, name)); } -API_EXPORT(mutex *) open_mutex(char *name) +API_EXPORT(mutex *) ap_open_mutex(char *name) { return(OpenMutex(MUTEX_ALL_ACCESS, FALSE, name)); } -API_EXPORT(int) acquire_mutex(mutex *mutex_id) +API_EXPORT(int) ap_acquire_mutex(mutex *mutex_id) { int rv; @@ -92,12 +92,12 @@ return(map_rv(rv)); } -API_EXPORT(int) release_mutex(mutex *mutex_id) +API_EXPORT(int) ap_release_mutex(mutex *mutex_id) { return(ReleaseMutex(mutex_id)); } -API_EXPORT(void) destroy_mutex(mutex *mutex_id) +API_EXPORT(void) ap_destroy_mutex(mutex *mutex_id) { CloseHandle(mutex_id); } @@ -193,25 +193,25 @@ {} -mutex *create_mutex(char *name) +mutex *ap_create_mutex(char *name) { return(NULL); } -mutex *open_mutex(char *name) +mutex *ap_open_mutex(char *name) { return(NULL); } -int acquire_mutex(mutex *mutex_id) +int ap_acquire_mutex(mutex *mutex_id) { return(0); } -int release_mutex(mutex *mutex_id) +int ap_release_mutex(mutex *mutex_id) { return(0); } -void destroy_mutex(mutex *mutex_id) +void ap_destroy_mutex(mutex *mutex_id) {} 1.15 +1 -1 apache-1.3/src/os/win32/os.h Index: os.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/os.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- os.h 1998/04/06 05:21:49 1.14 +++ os.h 1998/04/11 12:01:06 1.15 @@ -77,7 +77,7 @@ #define NO_OTHER_CHILD #define NO_RELIABLE_PIPED_LOGS -__inline int os_is_path_absolute(const char *file) +__inline int ap_is_path_absolute(const char *file) { /* For now, just do the same check that http_request.c and mod_alias.c * do. 1.3 +8 -8 apache-1.3/src/os/win32/registry.c Index: registry.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/registry.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- registry.c 1998/03/21 05:15:34 1.2 +++ registry.c 1998/04/11 12:01:06 1.3 @@ -40,7 +40,7 @@ */ #define do_error(rv,fmt,arg) do { \ SetLastError(rv); \ - aplog_error(APLOG_MARK, APLOG_WIN32ERROR|APLOG_ERR, NULL, fmt,arg); \ + ap_log_error(APLOG_MARK, APLOG_WIN32ERROR|APLOG_ERR, NULL, fmt,arg); \ } while (0); /* @@ -94,7 +94,7 @@ &hKey); if (rv == ERROR_FILE_NOT_FOUND) { - aplog_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, "Registry does not contain key " REGKEY); return -1; } @@ -121,13 +121,13 @@ return -1; } - pValue = palloc(p, nSize); + pValue = ap_palloc(p, nSize); *ppValue = pValue; if (!pValue) { /* Eek, out of memory, probably not worth trying to carry on, * but let's give it a go */ - aplog_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO,NULL, "Error getting registry key: out of memory"); return -2; } @@ -148,7 +148,7 @@ retval = 0; /* Return value */ if (rv == ERROR_FILE_NOT_FOUND) { - aplog_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, "Registry does not contain value " REGKEY "\\%s", key); retval = -1; } @@ -158,7 +158,7 @@ * allocate a buffer if another process changed the length of the * value since we found out its length above. Umm. */ - aplog_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_ERR|APLOG_NOERRNO,NULL, "Error getting registry value %s: buffer not big enough", key); retval = -3; } @@ -331,7 +331,7 @@ &hKey); if (rv == ERROR_FILE_NOT_FOUND) { - aplog_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_WARNING|APLOG_NOERRNO,NULL, "Registry does not contain key " REGKEY " after creation"); return -1; @@ -359,7 +359,7 @@ retval = -4; } else { - aplog_error(APLOG_MARK,APLOG_INFO|APLOG_NOERRNO,NULL, + ap_log_error(APLOG_MARK,APLOG_INFO|APLOG_NOERRNO,NULL, "Registry stored HKLM\\" REGKEY "\\%s value %s", key, type == REG_SZ ? value : "(not displayable)"); } 1.9 +6 -6 apache-1.3/src/os/win32/service.c Index: service.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/service.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- service.c 1998/02/24 12:27:22 1.8 +++ service.c 1998/04/11 12:01:06 1.9 @@ -148,7 +148,7 @@ // case SERVICE_CONTROL_STOP: state = SERVICE_STOP_PENDING; - start_shutdown(); + ap_start_shutdown(); break; // Update the service status. @@ -228,7 +228,7 @@ SC_MANAGER_ALL_ACCESS // access required ); if (!schSCManager) { - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, "OpenSCManager failed"); } else { @@ -251,10 +251,10 @@ CloseServiceHandle(schService); /* Now store the server_root in the registry */ - ap_registry_set_server_root(server_root); + ap_registry_set_server_root(ap_server_root); } else { - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, "CreateService failed"); } @@ -277,7 +277,7 @@ SC_MANAGER_ALL_ACCESS // access required ); if (!schSCManager) { - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, "OpenSCManager failed"); } else { @@ -285,7 +285,7 @@ if (schService == NULL) { /* Could not open the service */ - aplog_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, + ap_log_error(APLOG_MARK, APLOG_ERR|APLOG_WIN32ERROR, NULL, "OpenService failed"); } else { 1.12 +2 -2 apache-1.3/src/os/win32/util_win32.c Index: util_win32.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/util_win32.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- util_win32.c 1998/03/03 22:02:32 1.11 +++ util_win32.c 1998/04/11 12:01:07 1.12 @@ -54,7 +54,7 @@ } } -API_EXPORT(char *) os_canonical_filename(pool *pPool, const char *szFile) +API_EXPORT(char *) ap_canonical_filename(pool *pPool, const char *szFile) { char buf[HUGE_STRING_LEN]; @@ -64,7 +64,7 @@ if (*szFile && szFile[strlen(szFile)-1] == '/') strcat(buf, "/"); - return pstrdup(pPool, buf); + return ap_pstrdup(pPool, buf); } /* Win95 doesn't like trailing /s. NT and Unix don't mind. This works 1.16 +3 -3 apache-1.3/src/support/htdigest.c Index: htdigest.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/support/htdigest.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- htdigest.c 1998/03/19 09:56:43 1.15 +++ htdigest.c 1998/04/11 12:01:08 1.16 @@ -104,9 +104,9 @@ /* Do MD5 stuff */ sprintf(string, "%s:%s:%s", user, realm, pw); - MD5Init(&context); - MD5Update(&context, (unsigned char *) string, strlen(string)); - MD5Final(digest, &context); + ap_MD5Init(&context); + ap_MD5Update(&context, (unsigned char *) string, strlen(string)); + ap_MD5Final(digest, &context); for (i = 0; i < 16; i++) fprintf(f, "%02x", digest[i]); 1.6 +2 -2 apache-1.3/src/test/rename/rename.cf Index: rename.cf =================================================================== RCS file: /export/home/cvs/apache-1.3/src/test/rename/rename.cf,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- rename.cf 1998/04/11 10:07:19 1.5 +++ rename.cf 1998/04/11 12:01:09 1.6 @@ -395,6 +395,6 @@ os_is_path_absolute PREFIX_is_path_absolute # specials: these two require also a (trivial) change in Configure -#prelinked_modules PREFIX_prelinked_modules -#preloaded_modules PREFIX_preloaded_modules +prelinked_modules PREFIX_prelinked_modules +preloaded_modules PREFIX_preloaded_modules