httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r440028 - in /httpd/httpd/trunk: CHANGES modules/filters/mod_ext_filter.c
Date Mon, 04 Sep 2006 11:08:54 GMT
Author: trawick
Date: Mon Sep  4 04:08:53 2006
New Revision: 440028

URL: http://svn.apache.org/viewvc?view=rev&rev=440028
Log:
Handle filter names which include capital letters.

PR: 40323

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/filters/mod_ext_filter.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?view=diff&rev=440028&r1=440027&r2=440028
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Sep  4 04:08:53 2006
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
   [Remove entries to the current 2.0 and 2.2 section below, when backported]
 
+  *) mod_ext_filter: Handle filter names which include capital letters.
+     PR 40323.  [Jeff Trawick]
+
   *) mod_deflate: Rework inflate output and deflate output filter to fix several
      issues: Incorrect handling of flush buckets, potential memory leaks,
      excessive memory usage in inflate output filter for large compressed

Modified: httpd/httpd/trunk/modules/filters/mod_ext_filter.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_ext_filter.c?view=diff&rev=440028&r1=440027&r2=440028
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_ext_filter.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_ext_filter.c Mon Sep  4 04:08:53 2006
@@ -206,6 +206,7 @@
                                              &ext_filter_module);
     const char *token;
     const char *name;
+    char *normalized_name;
     ef_filter_t *filter;
 
     name = ap_getword_white(cmd->pool, &args);
@@ -213,7 +214,16 @@
         return "Filter name not found";
     }
 
-    if (apr_hash_get(conf->h, name, APR_HASH_KEY_STRING)) {
+    /* During request processing, we find information about the filter
+     * by looking up the filter name provided by core server in our
+     * hash table.  But the core server has normalized the filter
+     * name by converting it to lower case.  Thus, when adding the
+     * filter to our hash table we have to use lower case as well.
+     */
+    normalized_name = apr_pstrdup(cmd->pool, name);
+    ap_str_tolower(normalized_name);
+
+    if (apr_hash_get(conf->h, normalized_name, APR_HASH_KEY_STRING)) {
         return apr_psprintf(cmd->pool, "ExtFilter %s is already defined",
                             name);
     }
@@ -222,7 +232,7 @@
     filter->name = name;
     filter->mode = OUTPUT_FILTER;
     filter->ftype = AP_FTYPE_RESOURCE;
-    apr_hash_set(conf->h, name, APR_HASH_KEY_STRING, filter);
+    apr_hash_set(conf->h, normalized_name, APR_HASH_KEY_STRING, filter);
 
     while (*args) {
         while (apr_isspace(*args)) {



Mime
View raw message