httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sun, 27 Jan 2002 02:13:11 GMT
brianp      02/01/26 18:13:11

  Modified:    include  http_core.h
               server   core.c
  Log:
  Performance improvement: incorporated the use of the new
  ap_add_input_filter_handle() and ap_add_output_filter_handle()
  functions for core filters
  
  Revision  Changes    Path
  1.60      +8 -0      httpd-2.0/include/http_core.h
  
  Index: http_core.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- http_core.h	11 Jan 2002 18:55:27 -0000	1.59
  +++ http_core.h	27 Jan 2002 02:13:10 -0000	1.60
  @@ -61,6 +61,7 @@
   
   #include "apr.h"
   #include "apr_hash.h"
  +#include "util_filter.h"
   
   #if APR_HAVE_STRUCT_RLIMIT
   #include <sys/time.h>
  @@ -570,6 +571,13 @@
       ap_mgmt_type_e vtype;
       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
  
  
  
  1.137     +27 -10    httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.136
  retrieving revision 1.137
  diff -u -r1.136 -r1.137
  --- core.c	26 Jan 2002 23:05:10 -0000	1.136
  +++ core.c	27 Jan 2002 02:13:10 -0000	1.137
  @@ -119,6 +119,13 @@
    * 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 @@
       }
       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 @@
       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 @@
        */
       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);
   }
  
  
  

Mime
View raw message