httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject Re: the mod_include problem...
Date Mon, 02 Feb 1998 03:20:19 GMT

On Sun, 1 Feb 1998, Marc Slemko wrote:

> How?
> Can't you just manually copy any junk out of the subrequest before
> destroying it?
> (no, I haven't looked at the code...)

The problem is that you have no idea what to copy and what not to copy. 
Don't look at HEAD, HEAD has another hack in it right now passing time
until a better solution is found... look at 1.2.5 or at mod_include rev
1.67.  Here it is:

    if (r->main) {
        /* 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;
        r->finfo.st_mtime = r->main->finfo.st_mtime;
    else {
        add_include_vars(r, DEFAULT_TIME_FORMAT);

So LAST_MODIFIED is special cased, but other things aren't.  Additionally,
if another module ever does a run_sub_request it's possible that the
add_xxx_vars() calls won't ever happen.  Here's what I'm planning to do.

The first request that goes into send_parsed_file will be the "root"
request.  mod_include routines will be modified to use the root request's
environment when setting/fetching values (so that mod_include subrequests
will share the same environment).  I'll be storing enough data in
r->request_config to find the root efficiently.  I'll maintain the
LAST_MODIFIED kludge too.

Another alternative is to forget the new table API w.r.t.
r->subprocess_env.  But I am really loathe to do this because I think
r->subprocess_env gains the most from it (since a lot of the table_set
calls use a constant key, and the value doesn't need strduping or is
already strduped).

Another alternative is to add a table_pool(t) function and use it a lot,
all over the place.  I really don't like this one either because it is
a lot of work in the short term and the long term.


View raw message