From a756d60d8157f2259700e9593ced0c4450ff4f8f Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Thu, 2 Dec 2004 13:28:04 +0000 Subject: [PATCH] Fix gcc "no previous prototype" warnings after reorganisation: * server/core_filters.c (ap_core_input_filter, ap_core_output_filter, ap_net_time_filter): Renamed to add ap_ prefixes for global symbols. * include/ap_listen.h: Don't export ap_listen_open at all, it's not used outside server/listen.c any more. * server/listen.c (open_listeners): Renamed from ap_listen_open. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109498 13f79535-47bb-0310-9956-ffa450edef68 --- include/ap_listen.h | 14 -------------- include/http_core.h | 9 +++++++++ server/core.c | 12 +++--------- server/core_filters.c | 14 +++++++------- server/listen.c | 15 +++++++++++---- 5 files changed, 30 insertions(+), 34 deletions(-) diff --git a/include/ap_listen.h b/include/ap_listen.h index 21c52e78c1..edac2a1fa9 100644 --- a/include/ap_listen.h +++ b/include/ap_listen.h @@ -75,20 +75,6 @@ AP_DECLARE(void) ap_listen_pre_config(void); */ AP_DECLARE(int) ap_setup_listeners(server_rec *s); #endif -/* Split into two #if's to make the exports scripts easier. - */ -#if defined(SPMT_OS2_MPM) -/** - * Create and open a socket on the specified port. This includes listening - * and binding the socket. - * @param process The process record for the currently running server - * @param port The port to open a socket on. - * @return The number of open sockets - * @warning This function is only available to Windows platforms, or the - * Prefork or SPMT_OS2 MPMs. - */ -AP_DECLARE(int) ap_listen_open(process_rec *process, apr_port_t port); -#endif /* Although these functions are exported from libmain, they are not really * public functions. These functions are actually called while parsing the diff --git a/include/http_core.h b/include/http_core.h index d74a4cf5dd..fbc2b8d258 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -558,6 +558,15 @@ AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config); AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config); AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg); +/* Core filters; not exported. */ +int ap_net_time_filter(ap_filter_t *f, apr_bucket_brigade *b, + ap_input_mode_t mode, apr_read_type_e block, + apr_off_t readbytes); +int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, + ap_input_mode_t mode, apr_read_type_e block, + apr_off_t readbytes); +apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b); + #endif /* CORE_PRIVATE */ diff --git a/server/core.c b/server/core.c index 4f82ff8c0a..23f47a8086 100644 --- a/server/core.c +++ b/server/core.c @@ -93,12 +93,6 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle; AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle; -extern int core_input_filter(ap_filter_t *, apr_bucket_brigade *, - ap_input_mode_t, apr_read_type_e, apr_off_t); -extern int net_time_filter(ap_filter_t *, apr_bucket_brigade *, - ap_input_mode_t, apr_read_type_e, apr_off_t); -extern apr_status_t core_output_filter(ap_filter_t *, apr_bucket_brigade *); - /* magic pointer for ErrorDocument xxx "default" */ static char errordocument_default; @@ -3782,16 +3776,16 @@ static void register_hooks(apr_pool_t *p) ap_hook_insert_filter(core_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); ap_core_input_filter_handle = - ap_register_input_filter("CORE_IN", core_input_filter, + ap_register_input_filter("CORE_IN", ap_core_input_filter, NULL, AP_FTYPE_NETWORK); ap_net_time_filter_handle = - ap_register_input_filter("NET_TIME", net_time_filter, + ap_register_input_filter("NET_TIME", ap_net_time_filter, NULL, AP_FTYPE_PROTOCOL); ap_content_length_filter_handle = ap_register_output_filter("CONTENT_LENGTH", ap_content_length_filter, NULL, AP_FTYPE_PROTOCOL); ap_core_output_filter_handle = - ap_register_output_filter("CORE", core_output_filter, + ap_register_output_filter("CORE", ap_core_output_filter, NULL, AP_FTYPE_NETWORK); ap_subreq_core_filter_handle = ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, diff --git a/server/core_filters.c b/server/core_filters.c index dc7e293953..9140546f7f 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -61,9 +61,9 @@ typedef struct net_time_filter_ctx { int first_line; } net_time_filter_ctx_t; -int net_time_filter(ap_filter_t *f, apr_bucket_brigade *b, - ap_input_mode_t mode, apr_read_type_e block, - apr_off_t readbytes) +int ap_net_time_filter(ap_filter_t *f, apr_bucket_brigade *b, + ap_input_mode_t mode, apr_read_type_e block, + apr_off_t readbytes) { net_time_filter_ctx_t *ctx = f->ctx; int keptalive = f->c->keepalive == AP_CONN_KEEPALIVE; @@ -108,9 +108,9 @@ do { \ } while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \ } while (0) -int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, - ap_input_mode_t mode, apr_read_type_e block, - apr_off_t readbytes) +int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, + ap_input_mode_t mode, apr_read_type_e block, + apr_off_t readbytes) { apr_bucket *e; apr_status_t rv; @@ -535,7 +535,7 @@ static apr_status_t emulate_sendfile(core_net_rec *c, apr_file_t *fd, */ extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out; -apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b) +apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b) { apr_status_t rv; apr_bucket_brigade *more; diff --git a/server/listen.c b/server/listen.c index 1167e0b2fc..461ebc4d5b 100644 --- a/server/listen.c +++ b/server/listen.c @@ -288,13 +288,20 @@ static const char *alloc_listener(process_rec *process, char *addr, apr_port_t p return NULL; } -AP_DECLARE(int) ap_listen_open(apr_pool_t *pool, apr_port_t port) +/** + * Create and open a socket on the specified port. This includes listening + * and binding the socket. + * @param process The process record for the currently running server + * @param port The port to open a socket on. + * @return The number of open sockets + */ +static int open_listeners(apr_pool_t *pool, apr_port_t port) { ap_listen_rec *lr; ap_listen_rec *next; ap_listen_rec *previous; int num_open; - const char *userdata_key = "ap_listen_open"; + const char *userdata_key = "ap_open_listeners"; void *data; /* Don't allocate a default listener. If we need to listen to a @@ -396,7 +403,7 @@ AP_DECLARE(int) ap_listen_open(apr_pool_t *pool, apr_port_t port) status = apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1); if (status != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, status, pool, - "ap_listen_open: unable to make socket non-blocking"); + "unable to make listening socket non-blocking"); return -1; } } @@ -423,7 +430,7 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s) ap_listen_rec *lr; int num_listeners = 0; - if (ap_listen_open(s->process->pool, s->port)) { + if (open_listeners(s->process->pool, s->port)) { return 0; } -- 2.50.1