From efe8e43078c53e2ca6c79b02bc9c2e039b57639d Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Thu, 30 Aug 2001 12:29:37 +0000 Subject: [PATCH] since the core now stores the input and output filter lists in a different format, mod_charset_lite needs different logic to walk through it git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90811 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/mod_charset_lite.c | 32 ++++++++++++++----------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/modules/experimental/mod_charset_lite.c b/modules/experimental/mod_charset_lite.c index 573c87124e..07b23c15c8 100644 --- a/modules/experimental/mod_charset_lite.c +++ b/modules/experimental/mod_charset_lite.c @@ -373,34 +373,38 @@ static int find_code_page(request_rec *r) return DECLINED; } +static int configured_in_list(request_rec *r, const char *filter_name, + const char *filter_list) +{ + const char *filter; + + if (filter_list) { + while ((filter = ap_getword(r->pool, &filter_list, ';')) && filter[0]) { + /* yeah, I'm an ass and expect them to type it correctly (all caps) + */ + if (!strcmp(filter, filter_name)) + return 1; + } + } + return 0; +} + static int configured_on_input(request_rec *r, const char *filter_name) { - int i; core_dir_config *conf = (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - char **items = (char **)conf->input_filters->elts; - for (i = 0; i < conf->input_filters->nelts; i++) { - if (!strcmp(items[i], filter_name)) - return 1; - } - return 0; + return configured_in_list(r, filter_name, conf->input_filters); } static int configured_on_output(request_rec *r, const char *filter_name) { - int i; core_dir_config *conf = (core_dir_config *)ap_get_module_config(r->per_dir_config, &core_module); - char **items = (char **)conf->output_filters->elts; - for (i = 0; i < conf->output_filters->nelts; i++) { - if (!strcmp(items[i], filter_name)) - return 1; - } - return 0; + return configured_in_list(r, filter_name, conf->output_filters); } /* xlate_insert_filter() is a filter hook which decides whether or not -- 2.40.0