* This is the protocol module driver. This calls all of the
* pre-connection and connection hooks for all protocol modules.
* @param c The connection on which the request is read
- * @deffunc void ap_process_connection(conn_rec *)
+ * @param csd The mechanism on which this connection is to be read.
+ * Most times this will be a socket, but it is up to the module
+ * that accepts the request to determine the exact type.
+ * @deffunc void ap_process_connection(conn_rec *c, void *csd)
*/
-AP_CORE_DECLARE(void) ap_process_connection(conn_rec *, apr_socket_t *csd);
+AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, void *csd);
AP_CORE_DECLARE(void) ap_flush_conn(conn_rec *c);
AP_DECLARE_HOOK(conn_rec *, create_connection,
(apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh))
-/**
- * install_transport_filters is a RUN_FIRST hook used to install the bottom
- * most input and output network transport filters (e.g., CORE_IN and CORE_OUT)
- * used to interface to the network. This hook can access vhost configuration.
- *
- * @param c The socket to the client
- * @param csd Pointer to the client apr_socket_t struct.
- * @return OK or DECLINED
- * @deffunc int ap_run_install_transport_filters(conn_rec *c, apr_socket_t *csd)
- */
-AP_DECLARE_HOOK(int, install_transport_filters, (conn_rec *c, apr_socket_t *csd))
-
/**
* This hook gives protocol modules an opportunity to set everything up
* before calling the protocol handler. All pre-connection hooks are
* run until one returns something other than ok or decline
* @param c The connection on which the request has been received.
+ * @param csd The mechanism on which this connection is to be read.
+ * Most times this will be a socket, but it is up to the module
+ * that accepts the request to determine the exact type.
* @return OK or DECLINED
- * @deffunc int ap_run_pre_connection(conn_rec *c)
+ * @deffunc int ap_run_pre_connection(conn_rec *c, void *csd)
*/
-AP_DECLARE_HOOK(int,pre_connection,(conn_rec *c))
+AP_DECLARE_HOOK(int,pre_connection,(conn_rec *c, void *csd))
/**
* This hook implements different protocols. After a connection has been
* server will still call any remaining modules with an handler for this
* phase.
*/
-static int x_pre_connection(conn_rec *c)
+static int x_pre_connection(conn_rec *c, void *csd)
{
x_cfg *cfg;
*/
/* set up the connection filters */
- ap_run_install_transport_filters(origin, sock);
+ ap_run_pre_connection(origin, sock);
/* possible results: */
/* 120 Service ready in nnn minutes. */
}
/* set up the connection filters */
- ap_run_install_transport_filters(data, data_sock);
+ ap_run_pre_connection(data, data_sock);
/*
* VI: Receive the Response ------------------------
p_conn->addr, p_conn->name);
/* set up the connection filters */
- ap_run_install_transport_filters(*origin, p_conn->sock);
+ ap_run_pre_connection(*origin, p_conn->sock);
}
return OK;
}
return OK;
}
-static int ssl_hook_pre_connection(conn_rec *c)
+static int ssl_hook_pre_connection(conn_rec *c, void *csd)
{
SSLSrvConfigRec *sc = mySrvConfig(c->base_server);
SSL *ssl;
APR_HOOK_STRUCT(
APR_HOOK_LINK(create_connection)
APR_HOOK_LINK(process_connection)
- APR_HOOK_LINK(install_transport_filters)
APR_HOOK_LINK(pre_connection)
)
AP_IMPLEMENT_HOOK_RUN_FIRST(conn_rec *,create_connection,
(apr_pool_t *p, server_rec *server, apr_socket_t *csd, long conn_id, void *sbh),
(p, server, csd, conn_id, sbh), NULL)
AP_IMPLEMENT_HOOK_RUN_FIRST(int,process_connection,(conn_rec *c),(c),DECLINED)
-AP_IMPLEMENT_HOOK_RUN_FIRST(int, install_transport_filters,
- (conn_rec *c, apr_socket_t *csd),(c, csd), DECLINED)
-AP_IMPLEMENT_HOOK_RUN_ALL(int,pre_connection,(conn_rec *c),(c),OK,DECLINED)
+AP_IMPLEMENT_HOOK_RUN_ALL(int,pre_connection,(conn_rec *c, void *csd),(c, csd),OK,DECLINED)
/*
* More machine-dependent networking gooo... on some systems,
* you've got to be *really* sure that all the packets are acknowledged
return;
}
-AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, apr_socket_t *csd)
+AP_CORE_DECLARE(void) ap_process_connection(conn_rec *c, void *csd)
{
ap_update_vhost_given_ip(c);
- ap_run_install_transport_filters(c, csd);
-
- ap_run_pre_connection(c);
+ ap_run_pre_connection(c, csd);
if (!c->aborted) {
ap_run_process_connection(c);
c->id = id;
return c;
}
-static int core_install_transport_filters(conn_rec *c, apr_socket_t *csd)
+static int core_pre_connection(conn_rec *c, void *csd)
{
core_net_rec *net = apr_palloc(c->pool, sizeof(*net));
ap_set_module_config(net->c->conn_config, &core_module, csd);
ap_add_input_filter("CORE_IN", net, NULL, net->c);
ap_add_output_filter("CORE", net, NULL, net->c);
- return OK;
+ return DONE;
}
static void register_hooks(apr_pool_t *p)
{
- /* create_connection and install_transport_filters are RUN_FIRST
+ /* create_connection and install_transport_filters are
* hooks that should always be APR_HOOK_REALLY_LAST to give other
* modules the opportunity to install alternate network transports
+ * and stop other functions from being run.
*/
ap_hook_create_connection(core_create_conn, NULL, NULL, APR_HOOK_REALLY_LAST);
- ap_hook_install_transport_filters(core_install_transport_filters, NULL,
+ ap_hook_pre_connection(core_pre_connection, NULL,
NULL, APR_HOOK_REALLY_LAST);
ap_hook_post_config(core_post_config,NULL,NULL,APR_HOOK_REALLY_FIRST);
return APR_SUCCESS;
}
-static int perchild_pre_connection(conn_rec *c)
+static int perchild_pre_connection(conn_rec *c, void *csd)
{
ap_add_input_filter("PERCHILD_BUFFER", NULL, NULL, c);
return OK;
return APR_SUCCESS;
}
-static int perchild_pre_connection(conn_rec *c)
+static int perchild_pre_connection(conn_rec *c, void *csd)
{
ap_add_input_filter("PERCHILD_BUFFER", NULL, NULL, c);
return OK;