You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by dg...@apache.org on 1999/04/20 19:26:49 UTC

Re: mod_mime/3427: apache core dump when started with locale other then C

[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request ]
[from a developer.                                      ]
[Reply only with text; DO NOT SEND ATTACHMENTS!         ]


Synopsis: apache core dump when started with locale other then C

State-Changed-From-To: open-closed
State-Changed-By: dgaudet
State-Changed-When: Tue Apr 20 10:26:47 PDT 1999
State-Changed-Why:
This patch should do it... I'm committing it to 1.3.7-dev,
thanks.

Dean

Index: modules/standard/mod_mime.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v
retrieving revision 1.48
diff -u -r1.48 mod_mime.c
--- mod_mime.c  1999/01/01 19:05:11     1.48
+++ mod_mime.c  1999/04/20 17:26:07
@@ -233,13 +233,8 @@
  * get private versions through AddType...
  */
 
-/* MIME_HASHSIZE used to be 27 (26 chars and one "non-alpha" slot), but
- * with character sets like EBCDIC, this is insufficient because the
- * range 'a'...'z' is not contigous. Defining it as ('z'-'a'+2) is
- * equivalent to 27 in ASCII, and makes it work in EBCDIC.
- */
-#define MIME_HASHSIZE ('z'-'a'+2)
-#define hash(i) (ap_isalpha(i) ? (ap_tolower(i)) - 'a' : (MIME_HASHSIZE-1))
+#define MIME_HASHSIZE (32)
+#define hash(i) (ap_tolower(i) % MIME_HASHSIZE)
 
 static table *hash_buckets[MIME_HASHSIZE];