From: Brian Pane Date: Sun, 27 Jan 2002 02:13:10 +0000 (+0000) Subject: Performance improvement: incorporated the use of the new X-Git-Tag: 2.0.31~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=196916cef17148e55ad7770de2d82be0b72cb3e6;p=apache Performance improvement: incorporated the use of the new ap_add_input_filter_handle() and ap_add_output_filter_handle() functions for core filters git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93040 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/http_core.h b/include/http_core.h index 9ba793bac8..d4cfc38711 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -61,6 +61,7 @@ #include "apr.h" #include "apr_hash.h" +#include "util_filter.h" #if APR_HAVE_STRUCT_RLIMIT #include @@ -571,6 +572,13 @@ typedef struct { ap_mgmt_value v; } ap_mgmt_item_t; +/* Handles for core filters */ +extern ap_filter_rec_t *ap_subreq_core_filter_handle; +extern ap_filter_rec_t *ap_core_output_filter_handle; +extern ap_filter_rec_t *ap_content_length_filter_handle; +extern ap_filter_rec_t *ap_net_time_filter_handle; +extern ap_filter_rec_t *ap_core_input_filter_handle; + /** * This hook provdes a way for modules to provide metrics/statistics about * their operational status. diff --git a/server/core.c b/server/core.c index e265bb8472..a26d4eb1a1 100644 --- a/server/core.c +++ b/server/core.c @@ -119,6 +119,13 @@ AP_IMPLEMENT_HOOK_RUN_ALL(int, get_mgmt_items, * the http_conf_globals. */ +/* Handles for core filters */ +ap_filter_rec_t *ap_subreq_core_filter_handle; +ap_filter_rec_t *ap_core_output_filter_handle; +ap_filter_rec_t *ap_content_length_filter_handle; +ap_filter_rec_t *ap_net_time_filter_handle; +ap_filter_rec_t *ap_core_input_filter_handle; + static void *create_core_dir_config(apr_pool_t *a, char *dir) { core_dir_config *conf; @@ -3590,7 +3597,8 @@ static int core_create_req(request_rec *r) } ap_set_module_config(r->request_config, &core_module, req_cfg); - ap_add_input_filter("NET_TIME", NULL, r, r->connection); + ap_add_input_filter_handle(ap_net_time_filter_handle, + NULL, r, r->connection); /* Begin by presuming any module can make it's own path_info assumptions, * until some module interjects and changes the value. @@ -3651,8 +3659,9 @@ static conn_rec *core_create_conn(apr_pool_t *ptrans, server_rec *server, net->c->id = conn_id; 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); + ap_add_input_filter_handle(ap_core_input_filter_handle, net, NULL, net->c); + ap_add_output_filter_handle(ap_core_output_filter_handle, + net, NULL, net->c); return net->c; } @@ -3678,13 +3687,21 @@ static void register_hooks(apr_pool_t *p) */ ap_hook_insert_filter(core_insert_filter, NULL, NULL, APR_HOOK_MIDDLE); - ap_register_input_filter("CORE_IN", core_input_filter, AP_FTYPE_NETWORK); - ap_register_input_filter("NET_TIME", net_time_filter, AP_FTYPE_CONTENT); - ap_register_output_filter("CONTENT_LENGTH", ap_content_length_filter, - AP_FTYPE_HTTP_HEADER); - ap_register_output_filter("CORE", core_output_filter, AP_FTYPE_NETWORK); - ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, - AP_FTYPE_HTTP_HEADER); + ap_core_input_filter_handle = + ap_register_input_filter("CORE_IN", core_input_filter, + AP_FTYPE_NETWORK); + ap_net_time_filter_handle = + ap_register_input_filter("NET_TIME", net_time_filter, + AP_FTYPE_CONTENT); + ap_content_length_filter_handle = + ap_register_output_filter("CONTENT_LENGTH", ap_content_length_filter, + AP_FTYPE_HTTP_HEADER); + ap_core_output_filter_handle = + ap_register_output_filter("CORE", core_output_filter, + AP_FTYPE_NETWORK); + ap_subreq_core_filter_handle = + ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, + AP_FTYPE_HTTP_HEADER); ap_old_write_func = ap_register_output_filter("OLD_WRITE", ap_old_write_filter, AP_FTYPE_CONTENT - 10); }