perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: $|, flushing, etc... [was Next Release]
Date Tue, 04 Oct 2005 06:20:46 GMT
Stas Bekman wrote:
> Philip M. Gollucci wrote:
> [...]
>> 6.  Okay so from the 4 above attached files in #5 it looks like 
>> PerlIOApache_flush() is being called, but not working.
>>     [I'll list this function at the end of the e-mail.]
>>     Basically, I think there is a SNAFU here
>> MP_RUN_CROAK(modperl_wbucket_flush(rcfg->wbucket, FALSE), ":Apache2 IO 
>> flush");
>> That FALSE ends up being add_flush_bucket so even though we call flush 
>> we never get a flush bucket!!!!!!
> I think your observation and the fix are correct Philip. But before we 
> commit any fix we need to have a test that breaks and the fix fixes it.

As I think more about it, there was a reason for this FALSE setting. As 
you know Apache will send headers as soon as it gets some data out and a 
flush bucket is by Apache-talk is data. So what was happening is that when 
users were doing something in their code that was causing perl to flush 
STDOUT behind the scenes (like a filehandle dup), Apache will go and 
generate the headers even if the user haven't had a chance to set those. 
That's why it was written in such a way: i.e. add a flush bucket only if 
there is some data to flush, otherwise you need to call $r->flush if you 
want the flush to be sent anyway.

I think we may even have a test for that case (grep for $| I guess)

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

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

View raw message