You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Martin Kraemer <Ma...@mch.sni.de> on 1999/04/20 20:56:33 UTC

Re: cvs commit: apache-1.3/src/modules/standard mod_mime.c

Dean writes,...
> dgaudet     99/04/20 10:27:51
> 
>   Modified:    src      CHANGES
>                src/modules/standard mod_mime.c
>   Log:
>   islower() returns true for stuff outside a-z when locale isn't C
>...
>   Index: mod_mime.c
>   ===================================================================
>   RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v
>   retrieving revision 1.48
>   retrieving revision 1.49
>   diff -u -r1.48 -r1.49
>   --- mod_mime.c	1999/01/01 19:05:11	1.48
>   +++ mod_mime.c	1999/04/20 17:27:51	1.49
>   @@ -233,13 +233,8 @@
>   +#define MIME_HASHSIZE (32)
>   +#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)

Oops! While is makes sense to delimit the possible hash index by using
modulo, I expect better hash results for EBCDIC by using a slightly larger
prime (EBCDIC('z') - EBCDIC('a') + 1 + 1 = 42! What a coincidence ;-)
Maybe I should put an #ifdef CHARSET_EBCDIC around it.

    Martin
-- 
<Ma...@MchP.Siemens.De>      |        Siemens Information and
Phone: +49-89-636-46021               |        Communication  Products
FAX:   +49-89-636-47816               |        81730  Munich,  Germany

Re: cvs commit: apache-1.3/src/modules/standard mod_mime.c

Posted by Dean Gaudet <dg...@arctic.org>.

On Tue, 20 Apr 1999, Martin Kraemer wrote:

> Dean writes,...
> > dgaudet     99/04/20 10:27:51
> > 
> >   Modified:    src      CHANGES
> >                src/modules/standard mod_mime.c
> >   Log:
> >   islower() returns true for stuff outside a-z when locale isn't C
> >...
> >   Index: mod_mime.c
> >   ===================================================================
> >   RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v
> >   retrieving revision 1.48
> >   retrieving revision 1.49
> >   diff -u -r1.48 -r1.49
> >   --- mod_mime.c	1999/01/01 19:05:11	1.48
> >   +++ mod_mime.c	1999/04/20 17:27:51	1.49
> >   @@ -233,13 +233,8 @@
> >   +#define MIME_HASHSIZE (32)
> >   +#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)
> 
> Oops! While is makes sense to delimit the possible hash index by using
> modulo, I expect better hash results for EBCDIC by using a slightly larger
> prime (EBCDIC('z') - EBCDIC('a') + 1 + 1 = 42! What a coincidence ;-)
> Maybe I should put an #ifdef CHARSET_EBCDIC around it.

It's actually a pretty bogus hash regardless... and it's only there due to
laziness.  Given that the complete set of extensions is known at
configuration time someone could have easily built a binary search table
(or something better).  I don't think it really matters much...

Dean