Re: Barrier to implementing web content compression in mod_perl

[prev] [thread] [next] [Date index for 2005/01/31]

From: Perrin Harkins
Subject: Re: Barrier to implementing web content compression in mod_perl
Date: 20:34 on 31 Jan 2005
On Sun, 2005-01-30 at 21:54 +0000, Alex Greg wrote:
> The problem I have found is that when I modify print_content_type as follows:
> 
> sub print_content_type
> {
> 	my ($content_type) = @_;
> 	
> 	my $r = Apache->request();
> 	
> 	$r = $r->filter_register;
> 	$fh = $r->filter_input();
> 	
> 	if (!$content_type)
> 	{
> 		$r->send_http_header("text/html");
> 	}
> 	else
> 	{
> 		$r->send_http_header($content_type);
> 	}
> }
> 
> in order to register our application with the Apache::RegistryFilter
> chain (which is required to use either Apache::Dynagzip or
> Apache::Compress), I get the following in the error log:
> 
> [Sat Dec 25 01:36:32 2004] [error] Not a HASH reference at
> /usr/lib/perl5/site_perl/5.8.3/Apache/Filter.pm line 197.

Have you tried using Apache::RegistryFilter instead of Registry?  Or
try putting something like this at the top of your scripts:

my $r = shift;
$r->filter_register();

I don't think there's any reason for you to call $r->filter_input().

- Perrin

Re: Barrier to implementing web content compression in mod_perl
Perrin Harkins 20:34 on 31 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52