Hi,

my apache 2.2.11 does not pass the current httpd test framework:

t/modules/include.t       (Wstat: 0 Tests: 88 Failed: 1)
  Failed test:  67
t/modules/info.t          (Wstat: 0 Tests: 1 Failed: 1)
  Failed test:  1
t/modules/rewrite.t       (Wstat: 0 Tests: 29 Failed: 1)
  Failed test:  24

At least for the first failure I have found a reason. The test file that
should be parsed by the includes filter looks:

<!--#config timefmt="%Y" -->
xx<!--#echo var="DATE_LOCAL" -->xx

But in the output DATE_LOCAL is printed as "Tuesday, 31-Mar-2009
17:09:45 CEST".

The problem is the INCLUDES filter is inserted twice, once by mod_mime
for the .shtml extension:

#0  ap_add_output_filter (name=0xb747b8 "includes", ctx=0x0, r=0xb76548, 
c=0xb646a8) at util_filter.c:422
#1  0x00007fdbfb36cf11 in find_ct (r=0xb76548) at mod_mime.c:876
#2  0x0000000000436ce3 in ap_run_type_checker (r=0xb76548) at request.c:75

and a second time by mod_include in

#0  ap_add_output_filter (name=0x7fdbfe836b85 "INCLUDES", ctx=0x0, r=0xb76548, 
c=0xb646a8) at util_filter.c:422
#1  0x00007fdbfe8322da in include_fixup (r=0xb76548) at mod_include.c:3738
#2  0x0000000000436c1a in ap_run_fixups (r=0xb76548) at request.c:73

Thus the first filter in the chain handles the timefmt correctly and
sets DATE_LOCAL in r->subprocess_env. But the 2nd filter overwrites this
value in add_include_vars() called here:

static apr_status_t includes_filter(ap_filter_t *f, apr_bucket_brigade *b)
{

...

    if ((parent = ap_get_module_config(r->request_config, &include_module))) {
        /* Kludge --- for nested includes, we want to keep the subprocess
         * environment of the base document (for compatibility); that means
         * torquing our own last_modified date as well so that the
         * LAST_MODIFIED variable gets reset to the proper value if the
         * nested document resets <!--#config timefmt -->.
         */
        r->subprocess_env = r->main->subprocess_env;
        apr_pool_join(r->main->pool, r->pool);
        r->finfo.mtime = r->main->finfo.mtime;
    }
    else {
        /* we're not a nested include, so we create an initial
         * environment */
        ap_add_common_vars(r);
        ap_add_cgi_vars(r);
        add_include_vars(r, conf->default_time_fmt);               <-- here
    }
...

Is this a known bug?

Torsten

-- 
Need professional mod_perl support?
Just hire me: torsten.foert...@gmx.net

Reply via email to