*/
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
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 */
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;
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,
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;
} 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;
*/
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;
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
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;
}
}
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;
}