You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Alexei Kosut <ak...@organic.com> on 1997/08/04 07:43:17 UTC
Re: mod_perl and exit
On Sun, 3 Aug 1997, Roy T. Fielding wrote:
> >
> >+ API_EXPORT(void) child_terminate (request_rec *r)
> >+ {
> >+ r->connection->keepalive = 0;
> >+ requests_this_child = max_requests_per_child;
> >+ }
>
> That should be
>
> r->connection->keepalive = -1;
>
> if you want to force keepalive off.
Nope. Because this would be happening at the end of the request, not the
beginning. It's set_keepalive() that checks to see if keepliave == -1,
and ifs it to 0. set_keepalive() is called in send_http_header(), which
would already have been called if you're terminating due to an exit in a
Perl script. We do this to break out of the loop in http_main, which only
checks for !keepalive.
But I suggested that if you want to leave the code alone. If we are going
to add a child_terminate(), I'd perfer we add another flag to conn_rec,
out of the keepalive loop, and then exits at the end of child_main.
I think the reason that Brian asked about subrequests, btw, Doug, is that
he's concerned about Perl being called twice in a requests, after it's
been exited. i.e. will the second Perl call still work?
-- Alexei Kosut <ak...@organic.com>