httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul J. Reder" <rede...@raleigh.ibm.com>
Subject [Patch]: Fix mod_mime to hook in the right order.
Date Wed, 19 Jan 2000 02:12:51 GMT
mod_mime and mod_mime_magic were both hooking MIDDLE. Apparently
when the hooks were sorted, mod_mime_magic was getting called 
first. This was not allowing mod_mime to be called, so server
side includes were not working (since AddHandler for shtml
wasn't being used). mod_mime should always be called first and
mod_mime_magic should only be called if mod_mime is clueless.

I'm not sure whether the line:
IMPLEMENT_HOOK_RUN_FIRST(int,type_checker,(request_rec *r),(r),DECLINED)
in the file http_request.c should be changed to:
IMPLEMENT_HOOK_RUN_ALL(int,type_checker,(request_rec *r),(r),OK,DECLINED)
so that mod_mime_magic has a chance to override mod_mime. Right now,
if mod_mime sets the content_type then mod_mime_magic never gets called.

Someone who knows the hooks code better than me might want to look at
this. This patch seems to pass the mime and server side include tests
that I ran.

-- 
Paul J. Reder
------------------------------------------------------------
"Remember, Information is not knowledge; Knowledge is not Wisdom;
Wisdom is not truth; Truth is not beauty; Beauty is not love;
Love is not music; Music is the best." -- Frank Zappa


Index: mod_mime.c
===================================================================
RCS file: /home/cvs/apache-2.0/src/modules/standard/mod_mime.c,v
retrieving revision 1.7
diff -u -r1.7 mod_mime.c
--- mod_mime.c	2000/01/10 15:35:51	1.7
+++ mod_mime.c	2000/01/19 01:43:35
@@ -382,7 +382,7 @@
 
 static void register_hooks(void)
 {
-    ap_hook_type_checker(find_ct,NULL,NULL,HOOK_MIDDLE);
+    ap_hook_type_checker(find_ct,NULL,NULL,HOOK_FIRST);
     ap_hook_post_config(mime_post_config,NULL,NULL,HOOK_MIDDLE);
 }

Mime
View raw message