]> granicus.if.org Git - apache/commitdiff
As hinted on dev@httpd, change filter naming schemes to match our
authorJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 7 Mar 2002 09:27:17 +0000 (09:27 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Thu, 7 Mar 2002 09:27:17 +0000 (09:27 +0000)
expectations of their usage.

The reason that we should make this change now is that we have changed
the implied meaning of AP_FTYPE_HTTP_HEADER - some users of this should
be PROTOCOL while others should be CONTENT_SET.  In order to clarify it,
toss all of the bogus names and force the filter writers to make sure
they understand what they are doing.

CONTENT_SET is new (horrible name - change if you have better idea), but
it indicates that it should run between RESOURCE and PROTOCOL.
mod_deflate is the ideal CONTENT_SET filter.

The changed type names are:
CONTENT is now RESOURCE.
HTTP_HEADER is now PROTOCOL.  However, most filters that used HTTP_HEADER
may want CONTENT_SET.  (Only things like POP and HTTP belong as PROTOCOL.)

MMN bump since all filters need to be recompiled due to filter reordering.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93756 13f79535-47bb-0310-9956-ffa450edef68

17 files changed:
include/ap_mmn.h
include/util_filter.h
modules/experimental/mod_cache.c
modules/experimental/mod_case_filter.c
modules/experimental/mod_case_filter_in.c
modules/experimental/mod_charset_lite.c
modules/experimental/mod_deflate.c
modules/experimental/mod_ext_filter.c
modules/filters/mod_include.c
modules/http/http_core.c
modules/metadata/mod_headers.c
modules/proxy/proxy_ftp.c
modules/test/mod_bucketeer.c
server/core.c
server/mpm/experimental/perchild/perchild.c
server/mpm/perchild/perchild.c
server/util_filter.c

index 071d3392f20d082b2d98485e1fa770bf17444811..9d17825e3935d0a52af0fdaea7d76a6622dbb3e9 100644 (file)
  * 20020218 (2.0.33-dev) bump for AddOutputFilterByType directive
  * 20020220 (2.0.33-dev) bump for scoreboard.h structure change
  * 20020302 (2.0.33-dev) bump for protocol_filter additions.
+ * 20020306 (2.0.34-dev) bump for filter type renames.
  */
 
 #define MODULE_MAGIC_COOKIE 0x41503230UL /* "AP20" */
 
 #ifndef MODULE_MAGIC_NUMBER_MAJOR
-#define MODULE_MAGIC_NUMBER_MAJOR 20020302
+#define MODULE_MAGIC_NUMBER_MAJOR 20020306
 #endif
 #define MODULE_MAGIC_NUMBER_MINOR 0                     /* 0...n */
 #define MODULE_MAGIC_NUMBER MODULE_MAGIC_NUMBER_MAJOR  /* backward compat */
index 19d845afb96a3b70c4dbd9619778330f5be2ca84..8a66a47227188f10dbfce01d7eccaa57229e64cb 100644 (file)
@@ -185,26 +185,29 @@ typedef union ap_filter_func {
 typedef enum {
     /** These filters are used to alter the content that is passed through
      *  them. Examples are SSI or PHP. */
-    AP_FTYPE_CONTENT     = 10,
-    /** (XXX somebody rename me or get rid of me please)
-     *  This special type ensures that the HTTP header filter ends up in
-     *  the proper location in the filter chain. */
-    AP_FTYPE_HTTP_HEADER = 20,
+    AP_FTYPE_RESOURCE     = 10,
+    /** These filters are used to alter the content as a whole, but after all
+     *  AP_FTYPE_RESOURCE filters are executed.  These filters should not
+     *  change the content-type.  An example is deflate.  */
+    AP_FTYPE_CONTENT_SET  = 20,
+    /** These filters are used to handle the protocol between server and
+     *  client.  Examples are HTTP and POP. */
+    AP_FTYPE_PROTOCOL     = 30,
     /** These filters implement transport encodings (e.g., chunking). */
-    AP_FTYPE_TRANSCODE   = 30,
+    AP_FTYPE_TRANSCODE    = 40,
     /** These filters will alter the content, but in ways that are
      *  more strongly associated with the connection.  Examples are
-     *  splitting an HTTP connection into multiple requests and
-     *  buffering HTTP responses across multiple requests.
+     *  splitting an HTTP connection into multiple requests and
+     *  buffering HTTP responses across multiple requests.
      *
      *  It is important to note that these types of filters are not
      *  allowed in a sub-request. A sub-request's output can certainly
-     *  be filtered by ::AP_FTYPE_CONTENT filters, but all of the "final
+     *  be filtered by ::AP_FTYPE_RESOURCE filters, but all of the "final
      *  processing" is determined by the main request. */
-    AP_FTYPE_CONNECTION  = 40,
+    AP_FTYPE_CONNECTION  = 50,
     /** These filters don't alter the content.  They are responsible for
      *  sending/receiving data to/from the client. */
-    AP_FTYPE_NETWORK     = 50
+    AP_FTYPE_NETWORK     = 60
 } ap_filter_type;
 
 /**
index c72b15d531dec6c67c605c1b1ead802d33e6156b..86c52aca09274cba2848f9248883bf6fab38d171 100644 (file)
@@ -998,13 +998,13 @@ register_hooks(apr_pool_t *p)
      */
     ap_register_output_filter("CACHE_IN", 
                               cache_in_filter, 
-                              AP_FTYPE_CONTENT+1);
+                              AP_FTYPE_CONTENT_SET);
     ap_register_output_filter("CACHE_OUT", 
                               cache_out_filter, 
-                              AP_FTYPE_CONTENT+1);
+                              AP_FTYPE_CONTENT_SET);
     ap_register_output_filter("CACHE_CONDITIONAL", 
                               cache_conditional_filter, 
-                              AP_FTYPE_CONTENT+1);
+                              AP_FTYPE_CONTENT_SET);
     ap_hook_post_config(cache_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
 }
 
index 95515d729829a4c51f4c5b49a5deec4178c6f113..ae0209d8325d6805c049ddf67487dd2f2147d7f0 100644 (file)
@@ -100,7 +100,7 @@ static void CaseFilterRegisterHooks(apr_pool_t *p)
     {
     ap_hook_insert_filter(CaseFilterInsertFilter,NULL,NULL,APR_HOOK_MIDDLE);
     ap_register_output_filter(s_szCaseFilterName,CaseFilterOutFilter,
-                             AP_FTYPE_CONTENT);
+                             AP_FTYPE_RESOURCE);
     }
 
 module AP_MODULE_DECLARE_DATA case_filter_module =
index 18b44dd7216c2cf416c2d0beff799678a78cc1cf..d907573a85c6f9aeb9db1a87088c669663f341fa 100644 (file)
@@ -181,7 +181,7 @@ static void CaseFilterInRegisterHooks(apr_pool_t *p)
     ap_hook_insert_filter(CaseFilterInInsertFilter, NULL, NULL, 
                           APR_HOOK_MIDDLE);
     ap_register_input_filter(s_szCaseFilterName, CaseFilterInFilter,
-                             AP_FTYPE_CONTENT);
+                             AP_FTYPE_RESOURCE);
 }
 
 module AP_MODULE_DECLARE_DATA case_filter_in_module =
index cdc48296af6a204a5aa650acf366cf7bf64bac24..218574a100c986c783d0e98f03f058320f2ee806 100644 (file)
@@ -1100,9 +1100,9 @@ static void charset_register_hooks(apr_pool_t *p)
     ap_hook_fixups(find_code_page, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_insert_filter(xlate_insert_filter, NULL, NULL, APR_HOOK_REALLY_LAST);
     ap_register_output_filter(XLATEOUT_FILTER_NAME, xlate_out_filter, 
-                              AP_FTYPE_CONTENT);
+                              AP_FTYPE_RESOURCE);
     ap_register_input_filter(XLATEIN_FILTER_NAME, xlate_in_filter, 
-                             AP_FTYPE_CONTENT);
+                             AP_FTYPE_RESOURCE);
 }
 
 module AP_MODULE_DECLARE_DATA charset_lite_module =
index 2e4b15b86a5d6083dee7c9fe6a8aea07fd9bbc51..33e8e23515ef69745472f79cee859fa82c062fd8 100644 (file)
@@ -445,7 +445,7 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
 static void register_hooks(apr_pool_t * p)
 {
     ap_register_output_filter(deflateFilterName, deflate_out_filter,
-                              AP_FTYPE_HTTP_HEADER);
+                              AP_FTYPE_CONTENT_SET);
 }
 
 static const command_rec deflate_filter_cmds[] = {
index ba5444bb319657289fbd093e3c490e3b19e54682..5f0ee7aeb770859f1ca3ec017e19d1687041d163 100644 (file)
@@ -310,12 +310,12 @@ static const char *define_filter(cmd_parms *cmd, void *dummy, const char *args)
      */
     if (filter->mode == OUTPUT_FILTER) {
         /* XXX need a way to ensure uniqueness among all filters */
-        ap_register_output_filter(filter->name, ef_output_filter, AP_FTYPE_CONTENT);
+        ap_register_output_filter(filter->name, ef_output_filter, AP_FTYPE_RESOURCE);
     }
 #if 0              /* no input filters yet */
     else if (filter->mode == INPUT_FILTER) {
         /* XXX need a way to ensure uniqueness among all filters */
-        ap_register_input_filter(filter->name, ef_input_filter, AP_FTYPE_CONTENT);
+        ap_register_input_filter(filter->name, ef_input_filter, AP_FTYPE_RESOURCE);
     }
 #endif
     else {
index 60880601642822843dd3235792e8529463c383a7..0416073d1ba4804d046d3324735054f7c807c322 100644 (file)
@@ -3457,7 +3457,7 @@ static void register_hooks(apr_pool_t *p)
     APR_REGISTER_OPTIONAL_FN(ap_register_include_handler);
     ap_hook_post_config(include_post_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
     ap_hook_fixups(include_fixup, NULL, NULL, APR_HOOK_LAST);
-    ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_CONTENT);
+    ap_register_output_filter("INCLUDES", includes_filter, AP_FTYPE_RESOURCE);
 }
 
 module AP_MODULE_DECLARE_DATA include_module =
index 26e50935b65447c642930c5d8f44a0fa5955a408..2d36387a3a40801dc2d1668afaa1254f90f95c6b 100644 (file)
@@ -326,15 +326,15 @@ static void register_hooks(apr_pool_t *p)
     ap_hook_create_request(http_create_request, NULL, NULL, APR_HOOK_REALLY_LAST);
     ap_http_input_filter_handle =
         ap_register_input_filter("HTTP_IN", ap_http_filter,
-                                 AP_FTYPE_HTTP_HEADER);
+                                 AP_FTYPE_PROTOCOL);
     ap_http_header_filter_handle =
         ap_register_output_filter("HTTP_HEADER", ap_http_header_filter, 
-                                  AP_FTYPE_HTTP_HEADER);
+                                  AP_FTYPE_PROTOCOL);
     ap_chunk_filter_handle =
         ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_TRANSCODE);
     ap_byterange_filter_handle =
         ap_register_output_filter("BYTERANGE", ap_byterange_filter,
-                                  AP_FTYPE_HTTP_HEADER);
+                                  AP_FTYPE_PROTOCOL);
 }
 
 module AP_MODULE_DECLARE_DATA http_module = {
index 2e06ad52a6cb61f2d06634f30cc05b84276a95ae..258b831be77977b73272e0d9a125da708c105cce 100644 (file)
@@ -620,7 +620,7 @@ static void register_hooks(apr_pool_t *p)
     ap_hook_pre_config(header_pre_config,NULL,NULL,APR_HOOK_MIDDLE);
     ap_hook_insert_filter(ap_headers_insert_output_filter, NULL, NULL, APR_HOOK_LAST);
     ap_hook_fixups(ap_headers_fixup, NULL, NULL, APR_HOOK_LAST);
-    ap_register_output_filter("FIXUP_HEADERS_OUT", ap_headers_output_filter, AP_FTYPE_HTTP_HEADER);
+    ap_register_output_filter("FIXUP_HEADERS_OUT", ap_headers_output_filter, AP_FTYPE_CONTENT_SET);
 }
 
 module AP_MODULE_DECLARE_DATA headers_module =
index 33faf65aa7fddc28da167c20cfee133371a24600..d8d5380246650fda60bf12de296a082fdd471649 100644 (file)
@@ -1859,7 +1859,7 @@ static void ap_proxy_ftp_register_hook(apr_pool_t *p)
     proxy_hook_scheme_handler(ap_proxy_ftp_handler, NULL, NULL, APR_HOOK_MIDDLE);
     proxy_hook_canon_handler(ap_proxy_ftp_canon, NULL, NULL, APR_HOOK_MIDDLE);
     /* filters */
-    ap_register_output_filter("PROXY_SEND_DIR", ap_proxy_send_dir_filter, AP_FTYPE_CONTENT);
+    ap_register_output_filter("PROXY_SEND_DIR", ap_proxy_send_dir_filter, AP_FTYPE_RESOURCE);
 }
 
 module AP_MODULE_DECLARE_DATA proxy_ftp_module = {
index 2f19de88b75588463b5fd52282de31bed021bf2c..bd33b4b4caa265046f9bc99d2b3df479cefaa936 100644 (file)
@@ -194,7 +194,7 @@ static apr_status_t bucketeer_out_filter(ap_filter_t *f,
 static void register_hooks(apr_pool_t * p)
 {
     ap_register_output_filter(bucketeerFilterName, bucketeer_out_filter,
-                              AP_FTYPE_CONTENT-1);
+                              AP_FTYPE_RESOURCE-1);
 }
 
 static const command_rec bucketeer_filter_cmds[] = {
index 3c708d9b1c6eeee3d6459df1681eb2097c1d0422..3eca23ddd6ab23981c643f77caee13430f6ac462 100644 (file)
@@ -3141,7 +3141,7 @@ static int default_handler(request_rec *r)
     d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
                                                 &core_module);
     bld_content_md5 = (d->content_md5 & 1)
-                      && r->output_filters->frec->ftype != AP_FTYPE_CONTENT;
+                      && r->output_filters->frec->ftype != AP_FTYPE_RESOURCE;
 
     ap_allow_standard_methods(r, MERGE_ALLOW, M_GET, M_OPTIONS, M_POST, -1);
 
@@ -4031,18 +4031,18 @@ static void register_hooks(apr_pool_t *p)
                                  AP_FTYPE_NETWORK);
     ap_net_time_filter_handle =
         ap_register_input_filter("NET_TIME", net_time_filter,
-                                 AP_FTYPE_HTTP_HEADER);
+                                 AP_FTYPE_PROTOCOL);
     ap_content_length_filter_handle =
         ap_register_output_filter("CONTENT_LENGTH", ap_content_length_filter,
-                                  AP_FTYPE_HTTP_HEADER);
+                                  AP_FTYPE_PROTOCOL);
     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_CONTENT + 5);
+                                  AP_FTYPE_CONTENT_SET);
     ap_old_write_func = ap_register_output_filter("OLD_WRITE",
-                                   ap_old_write_filter, AP_FTYPE_CONTENT - 10);
+                                   ap_old_write_filter, AP_FTYPE_RESOURCE - 10);
 }
 
 AP_DECLARE_DATA module core_module = {
index a92cc0ddee9e2386ea4f495dc8a13b08298a319c..0181d87ef0ea264eb8b2daa9c34caa86e12a731c 100644 (file)
@@ -1754,7 +1754,7 @@ static void perchild_hooks(apr_pool_t *p)
     ap_hook_post_read_request(perchild_post_read, NULL, NULL,
                               APR_HOOK_REALLY_FIRST);
     ap_register_input_filter("PERCHILD_BUFFER", perchild_buffer,
-                             AP_FTYPE_CONTENT);
+                             AP_FTYPE_RESOURCE);
 }
 
 static const char *set_num_daemons(cmd_parms *cmd, void *dummy,
index a92cc0ddee9e2386ea4f495dc8a13b08298a319c..0181d87ef0ea264eb8b2daa9c34caa86e12a731c 100644 (file)
@@ -1754,7 +1754,7 @@ static void perchild_hooks(apr_pool_t *p)
     ap_hook_post_read_request(perchild_post_read, NULL, NULL,
                               APR_HOOK_REALLY_FIRST);
     ap_register_input_filter("PERCHILD_BUFFER", perchild_buffer,
-                             AP_FTYPE_CONTENT);
+                             AP_FTYPE_RESOURCE);
 }
 
 static const char *set_num_daemons(cmd_parms *cmd, void *dummy,
index 5d597c37cae0a31acacd5b2e0ad6b8b89ae674d8..88b62ee1451467a2f1808e9e812fad63c2bf3eb2 100644 (file)
@@ -301,7 +301,7 @@ static ap_filter_t *add_any_filter_handle(ap_filter_rec_t *frec, void *ctx,
     ap_filter_t *f = apr_palloc(p, sizeof(*f));
     ap_filter_t **outf;
 
-    if (frec->ftype < AP_FTYPE_HTTP_HEADER) {
+    if (frec->ftype < AP_FTYPE_PROTOCOL) {
         if (r) {
             outf = r_filters;
         }