Hello Rodger,

Thanks for the advice. I'm concerned that this sounds like a lot of search-and-replace for my application. I wonder if there is a cleaner method that simply toggles off buffering?

Anyone has any ideas on this?

Rodger Castle wrote:

If I am not mistaken, modperl tends to cache all output until the script is completed, then it sends out the page. If I want to (for example) print a period (.) back to the browser every second, what do I need to do? I tried $| but it does not work.

I fought with this for a while, too. You can use the 'bucket brigade' 
technique. I'm a bit green, so someone with more experience could expound more. 
 Here's a snippet:

sub send_response_body
{
   my ( $r, $data ) = @_;
my $bb = APR::Brigade->new ( $r->pool,
                                 $r->connection->bucket_alloc );
   my $b = APR::Bucket->new ( $data );
   $bb->insert_tail ($b);
   $r->output_filters->fflush ( $bb );
   $bb->destroy;
}

Hope this helps.

Rodger

Reply via email to