You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rb...@apache.org on 2002/02/05 23:18:49 UTC
cvs commit: httpd-2.0/server/mpm/perchild perchild.c
rbb 02/02/05 14:18:49
Modified: include http_connection.h
modules/experimental mod_example.c
modules/proxy proxy_ftp.c proxy_http.c
modules/ssl mod_ssl.c
server connection.c core.c
server/mpm/perchild perchild.c
Log:
Remove the install_transport_filters hook. The same function can be
acheived with the pre_connection hook. I have added the socket to the
pre_connection phase to make this possible.
Reviewed by: Bill Stoddard
Revision Changes Path
1.52 +10 -16 httpd-2.0/include/http_connection.h
Index: http_connection.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_connection.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- http_connection.h 1 Feb 2002 22:16:30 -0000 1.51
+++ http_connection.h 5 Feb 2002 22:18:49 -0000 1.52
@@ -70,9 +70,12 @@
* 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);
@@ -114,26 +117,17 @@
(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
1.33 +1 -1 httpd-2.0/modules/experimental/mod_example.c
Index: mod_example.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_example.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- mod_example.c 28 Jan 2002 23:49:39 -0000 1.32
+++ mod_example.c 5 Feb 2002 22:18:49 -0000 1.33
@@ -1028,7 +1028,7 @@
* 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;
1.111 +2 -2 httpd-2.0/modules/proxy/proxy_ftp.c
Index: proxy_ftp.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_ftp.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- proxy_ftp.c 4 Feb 2002 10:11:29 -0000 1.110
+++ proxy_ftp.c 5 Feb 2002 22:18:49 -0000 1.111
@@ -1044,7 +1044,7 @@
*/
/* 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. */
@@ -1786,7 +1786,7 @@
}
/* set up the connection filters */
- ap_run_install_transport_filters(data, data_sock);
+ ap_run_pre_connection(data, data_sock);
/*
* VI: Receive the Response ------------------------
1.129 +1 -1 httpd-2.0/modules/proxy/proxy_http.c
Index: proxy_http.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- proxy_http.c 1 Feb 2002 22:16:30 -0000 1.128
+++ proxy_http.c 5 Feb 2002 22:18:49 -0000 1.129
@@ -450,7 +450,7 @@
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;
}
1.44 +1 -1 httpd-2.0/modules/ssl/mod_ssl.c
Index: mod_ssl.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- mod_ssl.c 28 Jan 2002 23:49:39 -0000 1.43
+++ mod_ssl.c 5 Feb 2002 22:18:49 -0000 1.44
@@ -219,7 +219,7 @@
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;
1.100 +3 -8 httpd-2.0/server/connection.c
Index: connection.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/connection.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- connection.c 1 Feb 2002 22:16:30 -0000 1.99
+++ connection.c 5 Feb 2002 22:18:49 -0000 1.100
@@ -77,16 +77,13 @@
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
@@ -221,13 +218,11 @@
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);
1.143 +5 -4 httpd-2.0/server/core.c
Index: core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -r1.142 -r1.143
--- core.c 1 Feb 2002 22:16:30 -0000 1.142
+++ core.c 5 Feb 2002 22:18:49 -0000 1.143
@@ -3651,7 +3651,7 @@
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));
@@ -3671,17 +3671,18 @@
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);
1.108 +1 -1 httpd-2.0/server/mpm/perchild/perchild.c
Index: perchild.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -r1.107 -r1.108
--- perchild.c 4 Feb 2002 18:41:46 -0000 1.107
+++ perchild.c 5 Feb 2002 22:18:49 -0000 1.108
@@ -1726,7 +1726,7 @@
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;