]> granicus.if.org Git - apache/commitdiff
Performance improvement: incorporated the use of the new
authorBrian Pane <brianp@apache.org>
Sun, 27 Jan 2002 02:13:10 +0000 (02:13 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 27 Jan 2002 02:13:10 +0000 (02:13 +0000)
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

include/http_core.h
server/core.c

index 9ba793bac87b2af478f1bfff8f941bac8959fa6f..d4cfc38711f3a7790bc40265ac8d945381806081 100644 (file)
@@ -61,6 +61,7 @@
 
 #include "apr.h"
 #include "apr_hash.h"
+#include "util_filter.h"
 
 #if APR_HAVE_STRUCT_RLIMIT
 #include <sys/time.h>
@@ -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.
index e265bb84722f386563beed532d0dec9eaa9f96e3..a26d4eb1a1f4beee8c1dda660cc75d680e7f25ed 100644 (file)
@@ -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);
 }