httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug MacEachern <>
Subject Re: ApacheModulePerl.dll
Date Wed, 30 Jul 1997 21:01:50 GMT
Alexei Kosut <> wrote:

> On Wed, 30 Jul 1997, Doug MacEachern wrote:
> > The problem is, no scripts should call exit(), but many people's CGI scripts are
> > littered with exit() statements.  Which is fine for CGI scripts as
> > they are their own process, mod_perl scripts are inside the server.
> > log_transaction() was a half-assed attempt to "do-the-right-thing".
> > What happens if a C module calls exit()?  Everything stops ticking
> > right away, right? 
> True. But since Perl is interpreted inside Apache, can't you trap exit()
> and make it do something useful? You already seem to be able to make it
> call log_transaction() - can't you make it just return from the handler
> instead?

Not really.  We override Perl's built-in exit(), with a routine that calls
log_transaction(), then C-level exit().  The only other "clean" way to
terminate callback inside the interpreter besides C-level exit() would
be to call Perl's croak(), which by itself would cause "Internal
Server Error".  Which we might be able to get around by installing a
__DIE__ handler, but that gets messy too.  I think Perl needs a better
way to terminate the callback, heck, maybe there is one hiding
somewhere, just a matter of roundtuits.  If the Perl callback were to
call perl's built-in exit(), the interpreter gets _really_ confused.


View raw message