httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m.kos...@webcrawler.com (Martijn Koster)
Subject Re: initialising children in apache
Date Wed, 31 Jul 1996 04:09:44 GMT
At 12:53 PM 7/30/96, Brian Behlendorf wrote:

>What I'd suggest, is that you lay out your plan of attack, and send it to
>new-httpd, soliciting comments.

[so here goes :-)]

Hi all,

Having used the Apache API for a while now, I keep needing two things it
doesn't offer me: per-child module initialisation, and per-child cleanup.
I need these for third-party libs that do pid-based locking and use
tmp files and stuff. My apologies if these have been discussed to death
already.

Per-child initialisation I can fudge with statics in the module's handler,
but this is ugly, slows processing, and defers failures. Instead I currently
fudge it by re-configging a child in child_main, which is also ugly, still
requires statics in the module, and wastes space with duplicate configs.

I've now decided to invest some time to migrate to a non-hacky solution,
and wondered if anyone had advice on what might method make it back into
the Apache distribution.

The most obvious way would be just to add two new function pointers in the
module struct, and call them in the right place (child_main()).
This would require a (simple one-line) change to all modules.
If there are plans to break the API anyway, it'd be nice to have this in.

Another way would be for the (parent) init handler of a module to schedule
the two init/cleanup function calls by calling some server function and
passing it the server_rec; this function could then store these
callbacks (in a globals list for instance) for later use by child_main().
This would not touch the modules as is only extends the API without
changing structs, but sounds unelegant.

I've not tried either of these yet, but am about to.
What do you guys think of the options above? Are there others?
Do other people miss this? Would it be worth having this functionality
in the main distribution?

Please cc me on any responses, as I'm not subscribed to this list.
[Actually Brian, could you put me on for a while?]

Regards,

-- Martijn Koster

-- Martijn

Email: m.koster@webcrawler.com
WWW: http://info.webcrawler.com/mak/mak.html





Mime
View raw message