Let browser say "done" immediately after parent finish and do not wait child.

Z

Zhidian Du

I am writing a CGI program.

Why browsers always wait (saying "transferring data from..." from the
status bar) until both parent and chilld finish and say "done".

How can I let browser say "done" immediately after parent finish.


I use a query->end_html() in there and it doesn't work.

Thanks.


FORK: {

if ( $pid = fork ) {

print "Wait for a couple minutes and get your result via email\n";

print $query->end_html();

exit 0;
}
elsif ( defined $pid ) {

#running a couple minutes here

}
elsif ( $! == EAGAIN ) {
sleep 3;
redo FORK;
}
else {

print " Could not fork $!";
return 0;
}
 
B

Ben Morrow

I am writing a CGI program.

Why browsers always wait (saying "transferring data from..." from the
status bar) until both parent and chilld finish and say "done".

How can I let browser say "done" immediately after parent finish.

I use a query->end_html() in there and it doesn't work.

You need to close STDOUT in the child.

Ben
 
D

David Efflandt

I am writing a CGI program.

Why browsers always wait (saying "transferring data from..." from the
status bar) until both parent and chilld finish and say "done".

How can I let browser say "done" immediately after parent finish.


I use a query->end_html() in there and it doesn't work.

Look for 'daemonize' in 'perldoc perlipc'. You have to fork and
disassociate the child from the parent to not hold up the parent.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top