You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/09/04 21:08:36 UTC

[PATCH] Make filter names lowercase

Both Cliff and OtherBill sent me emails complaining about the
change to strcasecmp in some places to support Brian Pane's
new hash code in util_filter.c.  (Never mind that a lot of 
the code already did strcasecmp...)

This patch makes the filter name lowercase for the searches
and lets us use strcmp.  (I only searched for files that 
used frec->name directly...)

Please review and test.  My commits are getting an awful lot
of negative feedback lately, so I'm going to switch to R-T-C.
So, I'll need 3 +1s to commit this.  -- justin

Index: ./modules/experimental/mod_charset_lite.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_charset_lite.c,v
retrieving revision 1.51
diff -u -r1.51 mod_charset_lite.c
--- ./modules/experimental/mod_charset_lite.c	2001/09/04 07:59:55	1.51
+++ ./modules/experimental/mod_charset_lite.c	2001/09/04 19:03:08
@@ -116,9 +116,9 @@
 } ees_t;
 
 /* registered name of the output translation filter */
-#define XLATEOUT_FILTER_NAME "XLATEOUT"
+#define XLATEOUT_FILTER_NAME "xlateout"
 /* registered name of input translation filter */
-#define XLATEIN_FILTER_NAME  "XLATEIN" 
+#define XLATEIN_FILTER_NAME  "xlatein" 
 
 typedef struct charset_dir_t {
     /** debug level; -1 means uninitialized, 0 means no debug */
@@ -379,7 +379,7 @@
     struct ap_filter_t *filter = filter_list;
 
     while (filter) {
-        if (!strcasecmp(filter_name, filter->frec->name)) {
+        if (!strcmp(filter_name, filter->frec->name)) {
             return 1;
         }
         filter = filter->next;
@@ -623,7 +623,7 @@
     charset_filter_ctx_t *curctx, *last_xlate_ctx = NULL,
         *ctx = f->ctx;
     int debug = ctx->dc->debug;
-    int output = !strcasecmp(f->frec->name, XLATEOUT_FILTER_NAME);
+    int output = !strcmp(f->frec->name, XLATEOUT_FILTER_NAME);
 
     if (ctx->noop) {
         return;
@@ -634,7 +634,7 @@
      */
     curf = output ? f->r->output_filters : f->r->input_filters;
     while (curf) {
-        if (!strcasecmp(curf->frec->name, f->frec->name) &&
+        if (!strcmp(curf->frec->name, f->frec->name) &&
             curf->ctx) {
             curctx = (charset_filter_ctx_t *)curf->ctx;
             if (!last_xlate_ctx) {
Index: ./modules/experimental/mod_disk_cache.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_disk_cache.c,v
retrieving revision 1.10
diff -u -r1.10 mod_disk_cache.c
--- ./modules/experimental/mod_disk_cache.c	2001/09/04 07:59:55	1.10
+++ ./modules/experimental/mod_disk_cache.c	2001/09/04 19:03:08
@@ -94,7 +94,7 @@
      * again.
      */
     for ((f = r->output_filters); (f = f->next);) {
-        if (!strcasecmp(f->frec->name, "CACHE")) {
+        if (!strcmp(f->frec->name, "cache")) {
             ap_remove_output_filter(f);
         }
     }
Index: ./modules/experimental/cache_util.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/experimental/cache_util.c,v
retrieving revision 1.4
diff -u -r1.4 cache_util.c
--- ./modules/experimental/cache_util.c	2001/08/24 16:57:13	1.4
+++ ./modules/experimental/cache_util.c	2001/09/04 19:03:08
@@ -84,9 +84,9 @@
     ap_filter_t *f = r->output_filters;
 
     while (f) {
-        if (!strcasecmp(f->frec->name, "CORE") ||
-            !strcasecmp(f->frec->name, "CONTENT_LENGTH") ||
-            !strcasecmp(f->frec->name, "HTTP_HEADER")) {
+        if (!strcmp(f->frec->name, "core") ||
+            !strcmp(f->frec->name, "content_length") ||
+            !strcmp(f->frec->name, "http_header")) {
             f = f->next;
             continue;
         }
Index: ./modules/http/http_request.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
retrieving revision 1.113
diff -u -r1.113 http_request.c
--- ./modules/http/http_request.c	2001/08/31 03:49:42	1.113
+++ ./modules/http/http_request.c	2001/09/04 19:03:08
@@ -96,11 +96,11 @@
     ap_filter_t *f = r->output_filters;
     int has_core = 0, has_content = 0, has_http_header = 0;
     while (f) {
-        if(!strcasecmp(f->frec->name, "CORE"))
+        if(!strcmp(f->frec->name, "core"))
             has_core = 1; 
-        else if(!strcasecmp(f->frec->name, "CONTENT_LENGTH"))
+        else if(!strcmp(f->frec->name, "content_length"))
             has_content = 1; 
-        else if(!strcasecmp(f->frec->name, "HTTP_HEADER")) 
+        else if(!strcmp(f->frec->name, "http_header")) 
             has_http_header = 1;
         f = f->next;
     }
Index: ./server/mpm/perchild/perchild.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/perchild/perchild.c,v
retrieving revision 1.78
diff -u -r1.78 perchild.c
--- ./server/mpm/perchild/perchild.c	2001/09/04 07:59:55	1.78
+++ ./server/mpm/perchild/perchild.c	2001/09/04 19:03:08
@@ -1490,7 +1490,7 @@
                                                  &mpm_perchild_module);
 
     while (f) {
-        if (!strcasecmp("PERCHILD_BUFFER", f->frec->name)) {
+        if (!strcmp("perchild_buffer", f->frec->name)) {
             ap_remove_output_filter(f);
             break;
         }
Index: ./server/protocol.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/protocol.c,v
retrieving revision 1.43
diff -u -r1.43 protocol.c
--- ./server/protocol.c	2001/09/04 07:59:55	1.43
+++ ./server/protocol.c	2001/09/04 19:03:08
@@ -1064,7 +1064,7 @@
 
     /* this will typically exit on the first test */
     for (f = r->output_filters; f != NULL; f = f->next)
-        if (strcasecmp("OLD_WRITE", f->frec->name) == 0)
+        if (strcmp("old_write", f->frec->name) == 0)
             break;
     if (f == NULL) {
         /* our filter hasn't been added yet */