Ok, I didn't get any replies, but I finally figured it out.

When forking off a process, I simply closed STDOUT in the child.
When the parent exited, the browser quit loading.
WOO HOO!

-Mike


Earlier, I wrote:
> 
> All:
> 
> I have a CGI script which forks off a new process to perform lengthy
> operations, and then uses the parent to display a short message in
> the browser indicating that the process has begun.
> 
> However, I'm finding that the browser tries to continue loading until
> the child has completed.  How can I stop this (or can I?)  I want the
> parent to print the message and exit, but the browser waits for the
> child anyway...  UGH...
> 
>    use strict;
>    use CGI qw(:all);
>    $|++;
> 
>    my $pid = fork;
>    if ($pid == 0) {    # CHILD
>       sleep 30;
>       # Do stuff that takes a long time.
>       exit;
>    }
> 
>    print header;
>    print start_html;
>    print "<h1>Running command.  Thanks.</h1>\n";
>    exit;
> 
> I'm guessing I need to send some special kind of headers to the server
> or something, but I really haven't a clue.  Any ideas?
> 
> Thanks,
> 
> -Mike

Reply via email to