httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexei Kosut <ako...@organic.com>
Subject Re: mod_perl and exit
Date Sat, 02 Aug 1997 23:56:37 GMT
On Sat, 2 Aug 1997, Doug MacEachern wrote:

> why I put this off for so long.  Two, and more import, now that I can
> jump out of a callback and maintain Perl interpreter sanity, how
> should I terminate the child process?  Is there a need for some kind
> of child_done() routine?  Or a new handler return code, say
> `TERMINATE' which tells httpd to finish up logging, protocol,
> child_exit, etc.?  I know I could hack something together that would

I don't think something exists. You'd want something that works on a
per-request level, so Perl wouldn't ever get run again, wheras everyhting
we have (max_requests_per_child, etc...) works on a per-commection
level. You'd have to tag something to break out of the process_request
while() loop, and then exit.

One thing you could do without adding new code (and that would work with
existing Apaches) would be to put this at the end of the handler
function:

r->connection->keepalive = 0;
requests_this_child = max_requests_per_child

Although that does involve doing things that aren't quite kosher (and
assuming max_requests_per_child > 0), it should work.

I agree it would be best to add a function to do that, though.

-- Alexei Kosut <akosut@organic.com>


Mime
View raw message