httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabien COELHO <fab...@cri.ensmp.fr>
Subject Re: mod_macro
Date Tue, 22 Jun 1999 11:09:20 GMT

Hello.

> > I was thinking... since we will most likely be adding the mass-vhost
> > module (a special module to be sure) I would like us to (re)consider
> > mod_macro (http://www.cri.ensmp.fr/~coelho/mod_macro/).

That's a good idea;-) 

It is proven useful to anybody who has to manage non trivial configuration
files. I have spent a lot of time to detect and report syntax errors
precisely, and to detect potential errors quickly. I did it because I HATE
copy-pastes and large files to manage if they don't need to be that large.

> Is it thread-safe?

It depends;-)

Macros are managed on a per configuration basis. There are hooks to manage
stuff per directory and per virtual host, but I have not found any hook to
attach per configuration entities, and I have not found a clean way to
know that a new configuration is started. So I manage these entities
myself with a static variable, and I detect new configuration phases when
the "temp" pool pointer has changed. All mod_macros structures are
allocated in the "temp" pool.

If different threads can run onto a configuration file independently, it
is not thread safe at the time. I think that the risk occurs only in
.htaccess files. I have sent mails to discuss these issues on the
new-httpd list in january when I was promoting the incorporation of
mod_macro, but it get thru unnoticed and finally I gave up. One way to
aleviate this issue is to add a proper hook somewhere, possibly in
main/http_co*.c files.

A simple short term fix to this problem is to prohibit the use of macros
in .htaccess files. This is a few characters fix in the source code of
mod_macro. A long term solution would involve small modifications in the
apache core to add the proper hook. It is not a very big deal, but it
requires some time and thoughts.

> Will it work on Win32?

The module contains string processing stuff (strcpy, strlen...) which
should be quite portable I guess;-) However I cannot test it on a Win32.

> Will it destabilise what we've got already?

Basically it should not destabilise anything. For instance, there is no
callback from the request processing sequence, only a set of configuration
commands and a basic initializer.

-- 
Fabien COELHO   _____   fabien@coelho.net   _____   http://www.coelho.net
Apache mod_macro:              http://www.cri.ensmp.fr/~coelho/mod_macro/

Mime
View raw message