Commit b35b9cf9 authored by Joe Orton's avatar Joe Orton
Browse files

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
parent 4ead1757
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -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
+9 −0
Original line number Diff line number Diff line
@@ -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 */


+3 −9
Original line number Diff line number Diff line
@@ -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,
+7 −7
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ 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,
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)
{
@@ -108,7 +108,7 @@ 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,
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)
{
@@ -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;
+11 −4
Original line number Diff line number Diff line
@@ -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;
    }