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
* 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 */
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;
/**
*/
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);
}
{
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 =
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 =
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 =
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[] = {
*/
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 {
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 =
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 = {
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 =
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 = {
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[] = {
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);
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 = {
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,
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,
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;
}