Re: CGI: Running a forked background process
- From: xhoster@xxxxxxxxx
- Date: 17 Jul 2006 15:28:20 GMT
Hal Vaughan <hal@xxxxxxxxxxxxxxxxxxxx> wrote:
I have a web page (served up by Apache 2) where a user click a link to....
download a file. The link calls my Perl CGI script which takes the
parameters and generates a file to download. It takes time to generate
the file, so my idea was to fork like this:
I've found, though, that the fork is not working. When I click on the
link, I get a LONG pause and eventually the countdown page appears, but
only after the forked program is done with it's work.
The child program is holding onto the STDOUT and STDERR that it inherited
from the parent. Apache knows that STDOUT is not yet closed, and therefore
assumes the CGI isn't done yet and holds the connection to the browser open
(or something like that.) The forked process needs to close or reopen
STDOUT/STDERR in order to cut the web browser free.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- References:
- CGI: Running a forked background process
- From: Hal Vaughan
- CGI: Running a forked background process
- Prev by Date: Re: why is perl -e 'unlink(glob("*"))' so much faster than rm ?
- Next by Date: Re: When would you use qr// on a literal string?
- Previous by thread: Re: CGI: Running a forked background process
- Next by thread: FAQ 1.6 What is perl6?
- Index(es):
Relevant Pages
|