Flushing CGI output when using ProxyPass?

1. How to 'flush' output of 'C' cgi-program

Help!                  

Should be a simple problem. I have a 'C' program that responds to POSTs. Program        
does some stuff then prints a new screen. However, with Netscape Commerce
Server (AIX), the results screen does not finish loading until the handler program      
terminates. I need to have the page display (and complete loading), while the  
handler remains for a few minutes. I have tried flushing and closing stout, adding      
extra CRLF and a bunch of other things but no success. Many browsers just paint
about 3/4 of the screen and still show loading until the handler finally dies.

I have also tried 'forking' a separate program to handle the section of code that
has to process AFTER the screen is shown, and although the parent terminates,
the screen still 'loads' until the CHILD process terminates. This action is different  
from the NCSA server, which seems to provide a different communications path    
between the browser and your program.

Any ideas? The real problem here is ensuring the person has seen the results page,
so if there is any other way (with Netscape Commerce Server) to determine the  
user has not abandoned the request, that would suffice. (NCSA returns an error
on printf while outputing the page if the client has gone away, Netscape does not).
What I am doing now is having the original handler wait on a semaphore and the
result page includes an acknowledge button, which when submitted, clears the
semaphore and completes the original transaction. I know this messy, but can't
see any other way to do it.    

thanks
Peter Donaldson        

(P.S) If there is a more appropriate group for this question, please let me know...

2. ambiguous DMA disabled msg

3. Apache: flushing CGI output to client

4. MS-DOS font for X?

5. Server doesn't flush CGI output?!

6. KDE build for Solaris?

7. CGI script output flushing?

8. Help with NameResolution

9. /cgi-bin/phf /cgi-bin/test-cgi /cgi-bin/handler

10. "flushing" output to pty

11. redirected output is buffered, how do you flush it?

12. help: flushing serial output from C prog.

13. 'ipfw -q flush' produced annoying output