Skip to content

Commit b35b9cf

Browse files
committed
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
1 parent 4ead175 commit b35b9cf

5 files changed

Lines changed: 30 additions & 34 deletions

File tree

include/ap_listen.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,6 @@ AP_DECLARE(void) ap_listen_pre_config(void);
7575
*/
7676
AP_DECLARE(int) ap_setup_listeners(server_rec *s);
7777
#endif
78-
/* Split into two #if's to make the exports scripts easier.
79-
*/
80-
#if defined(SPMT_OS2_MPM)
81-
/**
82-
* Create and open a socket on the specified port. This includes listening
83-
* and binding the socket.
84-
* @param process The process record for the currently running server
85-
* @param port The port to open a socket on.
86-
* @return The number of open sockets
87-
* @warning This function is only available to Windows platforms, or the
88-
* Prefork or SPMT_OS2 MPMs.
89-
*/
90-
AP_DECLARE(int) ap_listen_open(process_rec *process, apr_port_t port);
91-
#endif
9278

9379
/* Although these functions are exported from libmain, they are not really
9480
* public functions. These functions are actually called while parsing the

include/http_core.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,15 @@ AP_CORE_DECLARE(void) ap_add_per_url_conf(server_rec *s, void *url_config);
558558
AP_CORE_DECLARE(void) ap_add_file_conf(core_dir_config *conf, void *url_config);
559559
AP_CORE_DECLARE_NONSTD(const char *) ap_limit_section(cmd_parms *cmd, void *dummy, const char *arg);
560560

561+
/* Core filters; not exported. */
562+
int ap_net_time_filter(ap_filter_t *f, apr_bucket_brigade *b,
563+
ap_input_mode_t mode, apr_read_type_e block,
564+
apr_off_t readbytes);
565+
int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
566+
ap_input_mode_t mode, apr_read_type_e block,
567+
apr_off_t readbytes);
568+
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b);
569+
561570
#endif /* CORE_PRIVATE */
562571

563572

server/core.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,6 @@ AP_DECLARE_DATA ap_filter_rec_t *ap_content_length_filter_handle;
9393
AP_DECLARE_DATA ap_filter_rec_t *ap_net_time_filter_handle;
9494
AP_DECLARE_DATA ap_filter_rec_t *ap_core_input_filter_handle;
9595

96-
extern int core_input_filter(ap_filter_t *, apr_bucket_brigade *,
97-
ap_input_mode_t, apr_read_type_e, apr_off_t);
98-
extern int net_time_filter(ap_filter_t *, apr_bucket_brigade *,
99-
ap_input_mode_t, apr_read_type_e, apr_off_t);
100-
extern apr_status_t core_output_filter(ap_filter_t *, apr_bucket_brigade *);
101-
10296
/* magic pointer for ErrorDocument xxx "default" */
10397
static char errordocument_default;
10498

@@ -3782,16 +3776,16 @@ static void register_hooks(apr_pool_t *p)
37823776
ap_hook_insert_filter(core_insert_filter, NULL, NULL, APR_HOOK_MIDDLE);
37833777

37843778
ap_core_input_filter_handle =
3785-
ap_register_input_filter("CORE_IN", core_input_filter,
3779+
ap_register_input_filter("CORE_IN", ap_core_input_filter,
37863780
NULL, AP_FTYPE_NETWORK);
37873781
ap_net_time_filter_handle =
3788-
ap_register_input_filter("NET_TIME", net_time_filter,
3782+
ap_register_input_filter("NET_TIME", ap_net_time_filter,
37893783
NULL, AP_FTYPE_PROTOCOL);
37903784
ap_content_length_filter_handle =
37913785
ap_register_output_filter("CONTENT_LENGTH", ap_content_length_filter,
37923786
NULL, AP_FTYPE_PROTOCOL);
37933787
ap_core_output_filter_handle =
3794-
ap_register_output_filter("CORE", core_output_filter,
3788+
ap_register_output_filter("CORE", ap_core_output_filter,
37953789
NULL, AP_FTYPE_NETWORK);
37963790
ap_subreq_core_filter_handle =
37973791
ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter,

server/core_filters.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ typedef struct net_time_filter_ctx {
6161
int first_line;
6262
} net_time_filter_ctx_t;
6363

64-
int net_time_filter(ap_filter_t *f, apr_bucket_brigade *b,
65-
ap_input_mode_t mode, apr_read_type_e block,
66-
apr_off_t readbytes)
64+
int ap_net_time_filter(ap_filter_t *f, apr_bucket_brigade *b,
65+
ap_input_mode_t mode, apr_read_type_e block,
66+
apr_off_t readbytes)
6767
{
6868
net_time_filter_ctx_t *ctx = f->ctx;
6969
int keptalive = f->c->keepalive == AP_CONN_KEEPALIVE;
@@ -108,9 +108,9 @@ do { \
108108
} while (!APR_BRIGADE_EMPTY(b) && (e != APR_BRIGADE_SENTINEL(b))); \
109109
} while (0)
110110

111-
int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
112-
ap_input_mode_t mode, apr_read_type_e block,
113-
apr_off_t readbytes)
111+
int ap_core_input_filter(ap_filter_t *f, apr_bucket_brigade *b,
112+
ap_input_mode_t mode, apr_read_type_e block,
113+
apr_off_t readbytes)
114114
{
115115
apr_bucket *e;
116116
apr_status_t rv;
@@ -535,7 +535,7 @@ static apr_status_t emulate_sendfile(core_net_rec *c, apr_file_t *fd,
535535
*/
536536
extern APR_OPTIONAL_FN_TYPE(ap_logio_add_bytes_out) *logio_add_bytes_out;
537537

538-
apr_status_t core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
538+
apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *b)
539539
{
540540
apr_status_t rv;
541541
apr_bucket_brigade *more;

server/listen.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,13 +288,20 @@ static const char *alloc_listener(process_rec *process, char *addr, apr_port_t p
288288
return NULL;
289289
}
290290

291-
AP_DECLARE(int) ap_listen_open(apr_pool_t *pool, apr_port_t port)
291+
/**
292+
* Create and open a socket on the specified port. This includes listening
293+
* and binding the socket.
294+
* @param process The process record for the currently running server
295+
* @param port The port to open a socket on.
296+
* @return The number of open sockets
297+
*/
298+
static int open_listeners(apr_pool_t *pool, apr_port_t port)
292299
{
293300
ap_listen_rec *lr;
294301
ap_listen_rec *next;
295302
ap_listen_rec *previous;
296303
int num_open;
297-
const char *userdata_key = "ap_listen_open";
304+
const char *userdata_key = "ap_open_listeners";
298305
void *data;
299306

300307
/* 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)
396403
status = apr_socket_opt_set(lr->sd, APR_SO_NONBLOCK, 1);
397404
if (status != APR_SUCCESS) {
398405
ap_log_perror(APLOG_MARK, APLOG_STARTUP|APLOG_ERR, status, pool,
399-
"ap_listen_open: unable to make socket non-blocking");
406+
"unable to make listening socket non-blocking");
400407
return -1;
401408
}
402409
}
@@ -423,7 +430,7 @@ AP_DECLARE(int) ap_setup_listeners(server_rec *s)
423430
ap_listen_rec *lr;
424431
int num_listeners = 0;
425432

426-
if (ap_listen_open(s->process->pool, s->port)) {
433+
if (open_listeners(s->process->pool, s->port)) {
427434
return 0;
428435
}
429436

0 commit comments

Comments
 (0)