You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rasmus Lerdorf <ra...@lerdorf.on.ca> on 1998/07/27 23:18:23 UTC

ap_rflush() ?

Once upon a time, not sure how many hundreds of versions ago, rflush()
worked ok and I could write a little PHP script that looked like this:

    for($i=0;$i<100;$i++) {
        echo ".";
        flush();
        sleep(1);
    }

It would work as expected sending a '.' every second.  With Apache-1.3
this is no longer the case.  I realize that defeating Apache's buffering
makes a mess of chunking and fragments the TCP packets and probably does
another 50 bad things, but still, what's the point of ap_rflush() if it
doesn't flush?  Is there some other way to force such a flush now? 

This goes back to my trouble with detecting someone hitting the STOP
button.  At various critical points in a complex script I would like to be
able to do a flush() so I can detect whether the client has gone away
before heading into the next resource-intensive (generally complex SQL
queries) part of the application.

-Rasmus


Re: ap_rflush() ?

Posted by Dean Gaudet <dg...@arctic.org>.

On Mon, 27 Jul 1998, Rasmus Lerdorf wrote:

> Once upon a time, not sure how many hundreds of versions ago, rflush()
> worked ok and I could write a little PHP script that looked like this:

ap_rflush() should still work... and it appears to work for me.  Could you
set a break at ap_rflush and step through this? 

Thanks
Dean