It apparently works after I played with the code for the final flush. I'm not
sure why, though. There was only one change (below). Anybody see a
significant difference?
In any case, I'll take it, since it works now. :-)
------Original (broken) code------------
$f->print(join '',
$state_ref->{'handle'}->flush(),
pack("V V",
crc32($state_ref->{'body'}),
length($state_ref->{'body'})),
);
-------------------------------------------
------Working code----------------------
$final_output = $state_ref->{'handle'}->flush();
$f->print(join '',
$final_output,
pack("V V",
crc32($state_ref->{'body'}),
length($state_ref->{'body'})),
);
------------------------------------------
On Friday 26 August 2005 03:11 pm, Alexander Charbonnet wrote:
> Okay, I've tried the new filter on a Gentoo system: Apache 2.0.54-r13,
> mod_perl 2.0.1-r2. It helped me to port the filter to the correct API
> (which only required a couple of changes, thankfully), but it didn't fix
> the weird IE problem.
>
> I know I'm not alone in wanting this feature (being able to flush
> compressed output), since wherever CGI and compression are discussed, this
> is the main disadvantage. If we could get this filter working it would
> give mod_perl a big advantage over PHP for applications where this is
> needed.
>
> The updated filter resides at: http://www.charbonnet.com/ChunkGzip.pm
>
> I modified my test script (below) to print the time, as well as to do an
> additional flush just to be sure.
>
> Here's what happens in my IE window:
>
> prints "starting 1125086461"
> pauses 3 seconds
> prints "finished 1125086464"; this is where everything should stop
> status displays "Web site found, waiting for reply"
> screen clears
> prints "starting 1125086464"
> done
>
> The browser got the finished output, and everything was fine for a split
> second, until it decided to reload the page and only print part of the
> output the second time.
>
> Is there something I'm not setting? Is there a special IE keepalive or
> something that could fix this? It does still work perfectly in Gecko and
> KHTML.
>
> Thanks again for your help,
> Alex
>
>
> Test script:
> ---------------
> use CGI qw(:standard);
> my $r = shift;
> print
> header,
> start_html,
> p('starting '.time),
> ;
> $r->rflush;
> sleep 3; #"doing work"
> print
> p('finished '.time),
> end_html,
> ;
> $r->rflush;
>
> On Friday 26 August 2005 03:42 am, you wrote:
> > Alexander Charbonnet wrote:
> > > I'm running the Debian Sarge versions of everything: Apache 2.0.54-4,
> > > mod_perl 1.999.21-1.
> >
> > I'd update to something after RC5 so that you don't use an unsupported
> > API of mod_perl2.
> >
> > see:
> > http://perl.apache.org/docs/2.0/rename.html