perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: PerlIOApache_flush() [was $|, flushing, etc... [was Next Release]]
Date Mon, 31 Oct 2005 07:52:28 GMT
Philip M. Gollucci wrote:
> Philip M. Gollucci wrote:
>> Stas Bekman wrote:
>>  > and if you try my last patch suggestion?
>> Hi, yikes, I'm behind.... Anyway, I finally got around to trying this.
>> Same result as without.  Hopefully, at some point during the week, 
>> I'll be able to turn on tracing and the like and see why nothing changed.
> Well, I turned on Apache2::DebugFilter and PerlTrace fo again.  The 
> output is correct as in flush buckets are now sent when they should be, 
> but if I visually look at the browser, nothing shows up until the end.
> Something is still buffering the data.

I'd have suggested to push that debug filter just before the "CORE" output 
filter, so you could check that some other filter on the way doesn't 
misbehave and ignores our FLUSH bucket, but Apache's API won't let you 
easily do that at run-time. It's probably do-able in C. something like:

     for (f = c->input_filters; f; f = f->next) {
         if (strcasecmp(f->frec->name, "CORE") == 0) {
             f->frec->filter_func.in_func = my_core_output_filter;

and have that filter do some debugging and call the original CORE filter.

In perl you can just remove the filter:

         for (my $ff = $f->r->connection->output_filters; $ff;
             $ff = $ff->next) {
             if ($ff->frec->name eq 'CORE') {

but can't substitute or inject a new one, which is what we are after. But 
I think we could extend the API to allow injecting new perl filters. That 
would be handy.

So it's probably the easiest to modify the CORE filter core_output_filter 
in apache sources to dump the debug info like Apache2::DebugFilter does. 
Check httpd-2.0/.gdbinit for the code that dumps brigades.

Stas Bekman
MailChannels: Assured Messaging(TM)
The "Practical mod_perl" book

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message