httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Ralf S. Engelschall)
Subject Re: Interesting problem: virtual host config
Date Fri, 27 Feb 1998 11:18:20 GMT

In article <> you wrote:

> Woah, no way.  You shouldn't be playing with any config structures after
> config time... espcially not changing server->module_config.  If you do
> this you will cause another page of memory to become unshared across all
> children.  And you won't be thread safe.

Ops, yes, you are correct, Dean. I totally forgot threading and copy-on-write
tricks of the kernels. Thanks for shouting immediately. Hmmm... then we need
another solution.

> What I was suggesting was if r->server != conf->server then test the
> RewriteInherit setting in conf->server and if it's off then pretend
> there's no conf for r->server.
> I'm not sure I understand why RewriteInherit even exists -- none of our
> other modules behave this way. 

The "RewriteOptions inherit" is placed where the the stuff should be
inherited, not at the parent's place who provides the stuff.  Putting
"RewriteOptions inherit" into the main server has no real effect.  Putting it
into a virtual host sections means this section now inherits the rules of the
main server. Same for per-dir context.

So my problem now is that a lot of functions in mod_rewrite call
get_module_config(). And for the case where no directives exist in a virtual
host section the retrieves config is not the default created one.  (which one
is it actually? The one from the main server, I think. Correct?). But here I
want the default config because I think it is ugly to just on-the-fly assume
that the rewrite engine is off and return immediately in each function.

Hmmm... while your conf->server != r->server trick is the key to our solution
I still searching now for a general solution without having to change all
places where get_module_config() is called.

                                       Ralf S. Engelschall

View raw message