You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kate Yoak <ka...@yoak.com> on 2009/01/03 16:24:05 UTC
Flushing output and preserving headers
Hey guys,
I seem to have some magic going on in the background and it has
stopped me in my tracks.
The actual problem is that my Content-type header gets overwritten
before it is sent back to the client. In addition, I am unable to
flush the output.
Here is the idea:
$r->headers_out->set('Content-Type' => "image/gif");
warn $r->headers_out->get('Content-Type');
#warns image/gif
for my $i (0..5){
sleep(1);
$r->print($i);
$r->rflush; #does not send $i to client. The headers do arrive at the
first iteration (with the wrong content-type).
warn $r->headers_out->get('Content-Type');
#warns text/plain
}
#sends 012345, all at once
Server version: Apache/2.2.8 (Unix)
mod_perl-2.0.2-6.3.el5
Server: Apache/2.2.8 (Unix) DAV/2 mod_apreq2-20051231/2.6.0 mod_perl/
2.0.4 Perl/v5.8.8
Where is the magic?
Cheers,
Kate
RE: Flushing output and preserving headers
Posted by Kate Yoak <ka...@yoak.com>.
That worked! Thanks.
> -----Original Message-----
> From: Torsten Foertsch [mailto:torsten.foertsch@gmx.net]
> Sent: Saturday, January 03, 2009 7:31 AM
> To: modperl@perl.apache.org
> Cc: Kate Yoak
> Subject: Re: Flushing output and preserving headers
>
>
> On Sat 03 Jan 2009, Kate Yoak wrote:
> > $r->headers_out->set('Content-Type' => "image/gif");
>
> use $r->content_type(...)
>
> Torsten
>
> --
> Need professional mod_perl support?
> Just hire me: torsten.foertsch@gmx.net
>
Re: Flushing output and preserving headers
Posted by Torsten Foertsch <to...@gmx.net>.
On Sat 03 Jan 2009, Kate Yoak wrote:
> $r->headers_out->set('Content-Type' => "image/gif");
use $r->content_type(...)
Torsten
--
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net