Martin Wickman wrote:

Please try the latest mp2 cvs, I've added a new test t/api/rflush.t, it tests rflush explicitly (even though it's already used for exactly this purpose in several other tests).

It does exactly what your code does:

sub response {
    my $r = shift;

    # just to make sure that print() won't flush, or we would get the
    # count wrong
    local $| = 0;

    $r->content_type('text/plain');
    $r->print("<foo");
    $r->rflush;     # this sends the data in the buffer + flush bucket
    $r->print("bar>");
    $r->rflush;     # this sends the data in the buffer + flush bucket
    $r->print("<who");
    $r->rflush;     # this sends the data in the buffer + flush bucket
    $r->print("ah>");

    Apache::OK;
}


Then an output filter that brakets the data:


sub braket {
      my $filter = shift;

my $data = '';

      while ($filter->read(my $buffer, 1024)) {
          $data .= $buffer;
      }

$filter->print("[$data]") if $data;

      return Apache::OK;
}

the response body is: [<foo][bar>][<who][ah>]

does it work for you? Is it any different from your code?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



Reply via email to