Thanos Chatziathanassiou wrote:
Josh Chamas wrote:

Maybe the Content-Length field is not calculated correctly by Apache::ASP?
If its too short, this could be a problem. To have Apache::ASP not calculate
the content length, try to flush when the script first starts, that will flush
the headers, and see if there is a difference.


Regards,

Josh

Sure enough, the Content-Length header was miscalculated. Since I had the ethereal capture handy, I could verify it rather easily (although had I been careful, I would have been able to figure it out myself - thanks for pointing it out).
A ``$Response->Flush();'' fixed things for me.
Still, in the beginning I wasn't using Script_OnFlush, I used a regular global.asa sub on the database data directly and I still got the same problem. Then I switched to Script_OnFlush to save myself the trouble of changing some 200+ files one by one.

Great. The Content-Length header is calculated like this in Response.pm:


$self->{headers_out}->set('Content-Length', length($$out));

As you can see, it does not do anything but use perl's length() method.

So I wonder if you are using a perl that is UTF8 aware, like perl 5.8.x series?
Otherwise, is there anything you can do to make it aware like the LANG ENV
setting?

The only other thing I can think of is maybe we should not trust perl's
UTF8 handling generally for the length calculation, and if this is set:

$Response->{ContentType} = 'text/html;charset=UTF-8'

then we simply do not calculate the Content-Length automatically, leaving
it as an exercise for the developer?

Regards,

Josh

________________________________________________________________________
Josh Chamas, Founder    | NodeWorks - http://www.nodeworks.com
Chamas Enterprises Inc. | NodeWorks Directory - http://dir.nodeworks.com
http://www.chamas.com   | Apache::ASP - http://www.apache-asp.org



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to