httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <>
Subject Re: Confusion: run_method and optimized lists? (Dean?)
Date Sat, 11 Jul 1998 18:01:21 GMT

In article <> you wrote:

> On Sat, 11 Jul 1998, Ralf S. Engelschall wrote:

>> The reason why I didn't discovered this while I've done
>> my "grep core_translate" is because Dean calls it via
>>     /* we require other modules to first set up a filename */
>>     res = core_module.translate_handler(r);    
>>     if (res == DECLINED || !r->filename) {
>>         return res;
>>     }
>> Shit! In other words: Whenever mod_mmap_static is present (independed if used
>> or not!) the complete translation phase comes out of sync because
>> mod_mmap_static itself runs the methods again.

> It doesn't run the methods again, it only runs core_translate.

> I thought I had a comment in there saying mod_mmap_static should be the
> first module (i.e. lowest priority above core).  That's where it's
> supposed to be... it's supposed to run after mod_rewrite and mod_alias
> have had a chance to translate the filename, not before. 

Then shouldn't we move it inside Configuration.tmpl to the top?

> I'm curious though, the example setup you gave me, does that really enable
> mod_mmap_static?  It shouldn't be enabled at all in any server by default. 

Sorry, yes, you have to use --enable-module=all there. I missed this in my
example because at this time I thought it was not important, so I says only
--enable-module=rewrite. But the problem is that just having this module
_loaded_ makes the problems even if you don't use it. A lot of users say for
instance "--enable-module=all --enable-shared=all" or typically
"--enable-shared=remain" and thus get a and a LoadModule
directive. Brian's setup on taz was such a situation! Can we at least change
mod_mmap_static so it does _NOTHING_ unless the user has actually configured
some files to mmap()? Because then its ok, its experimental and when one uses
it problems can occur. But just having it around and not using it but
receiving problems/side-effects it not what we should accept, shouldn't we?

So I suggest the following patch:
Index: src/modules/experimental/mod_mmap_static.c
RCS file:
retrieving revision 1.7
diff -u -r1.7 mod_mmap_static.c
--- mod_mmap_static.c   1998/04/11 12:00:38     1.7
+++ mod_mmap_static.c   1998/07/11 17:55:33
@@ -280,12 +280,16 @@
     a_file *match;
     int res;
+    /* we only operate when at least one mmapfile directive was used */
+    sconf = ap_get_module_config(r->server->module_config, &mmap_static_module);
+    if (ap_is_empty_table(sconf->files))
+       return DECLINED;
     /* we require other modules to first set up a filename */
     res = core_module.translate_handler(r);
     if (res == DECLINED || !r->filename) {
        return res;
-    sconf = ap_get_module_config(r->server->module_config,
     tmp.filename = r->filename;
     match = (a_file *)bsearch(&tmp, sconf->files->elts, sconf->files->nelts,
        sizeof(a_file), file_compare);

What do you think?
                                       Ralf S. Engelschall

View raw message