You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Octavian Rasnita <or...@fcc.ro> on 2006/01/24 10:45:05 UTC

Re: [users@httpd] mod_perl not sending Content-Length header

Hi,

Use the following method:

$r->set_content_length(length($content));

Upgrading mod_perl is also a good idea.


Teddy

----- Original Message ----- 
From: "Khai Doan" <kh...@hotmail.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, January 24, 2006 6:11 AM
Subject: [users@httpd] mod_perl not sending Content-Length header


> Hello everyone,
>
> I have Fedora Core 2 which has Apache/2.0.51 and mod_perl-1.99_12-2.1 .  I
am using mod_perl to generate dynamic content, and I always know the length
of the content I will be sending to the browser.  So I have Keep-Alive On.
In my code, I call:
>
> $r->headers_out->add("Content-Length",length($content));
>
> But I notice that it does not send the Content-Length response header
(verified with ethereal packet capture)
>
> Anyone has similar problem?  Any suggestion?
>
> Khai
> --------------------------------------------------------------------- The
official User-To-User support forum of the Apache HTTP Server Project. See
for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org "
from the digest: users-digest-unsubscribe@httpd.apache.org For additional
commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_perl not sending Content-Length header

Posted by Khai Doan <kh...@hotmail.com>.
The bug is in my own code.  I called $r->rflush() before 
$r->headers_out->add("Content-Length",length($content)).  This somehow also 
seem to trigger the response header Transfer-Encoding: chunked

Khai

>From: "Octavian Rasnita" <or...@fcc.ro>
>Reply-To: users@httpd.apache.org
>To: <us...@httpd.apache.org>
>Subject: Re: [users@httpd] mod_perl not sending Content-Length header
>Date: Tue, 24 Jan 2006 11:45:05 +0200
>
>Hi,
>
>Use the following method:
>
>$r->set_content_length(length($content));
>
>Upgrading mod_perl is also a good idea.
>
>
>Teddy
>
>----- Original Message -----
>From: "Khai Doan" <kh...@hotmail.com>
>To: <us...@httpd.apache.org>
>Sent: Tuesday, January 24, 2006 6:11 AM
>Subject: [users@httpd] mod_perl not sending Content-Length header
>
>
> > Hello everyone,
> >
> > I have Fedora Core 2 which has Apache/2.0.51 and mod_perl-1.99_12-2.1 .  
>I
>am using mod_perl to generate dynamic content, and I always know the length
>of the content I will be sending to the browser.  So I have Keep-Alive On.
>In my code, I call:
> >
> > $r->headers_out->add("Content-Length",length($content));
> >
> > But I notice that it does not send the Content-Length response header
>(verified with ethereal packet capture)
> >
> > Anyone has similar problem?  Any suggestion?
> >
> > Khai
> > --------------------------------------------------------------------- 
>The
>official User-To-User support forum of the Apache HTTP Server Project. See
>for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org "
>from the digest: users-digest-unsubscribe@httpd.apache.org For additional
>commands, e-mail: users-help@httpd.apache.org
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org