RE: Apache::Filter upgrade issues...

2001-05-07 Thread Geoffrey Young



> -Original Message-
> From: Trevor Phillips [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 05, 2001 2:21 AM
> To: ModPerl Mail List
> Subject: Apache::Filter upgrade issues...
> 
> 
> Hi! I recently upgraded a test server to a recent 
> Apache::Filter, and hit
> problems due to the new dependency on filter_register() being 
> called. I
> don't mind upgrading my filters to call this, but I have one, 
> in which I
> use Apache::Request (a sub-class of Apache), which I cannot 
> seem to work
> around.
> 
> The guts of the code goes something like this:
> 
> sub handler
> {
>my $r = shift;
>my $IsFilter = ($r->dir_config('Filter') =~ /^on/i?1:0);
>$r = Apache::Request->new($r);
>if ($IsFilter)
>{
>   $r = $r->filter_register();
>   my ($fh, $status) = $r->filter_input();
>   return $status unless $status == OK;  # The Apache::Constants OK
>   my @file = <$fh>;
>}
> etc...
> }
> 
> The above code fails in that the extra methods provided by 
> Apache::Request
> are
> no longer there.
> 
> The above code worked fine previously (prior to the requirement of
> filter_register)...
> 
> Any ideas? How can I use both Apache::Filter and 
> Apache::Request together?

well, part of the problem is that Apache->request($r) doesn't bless a new
request properly.

I know that Ken has recently tried working on the problem and had placed it
on Doug's radar:
http://marc.theaimsgroup.com/?t=9860080401&w=2&r=1
(ping :)

at any rate, it probably won't work, but maybe try switching the order
around?  That is, maybe call Apache::Request->new on the request object
returned by filter_register?

HTH

--Geoff





RE: Apache::Filter upgrade issues...

2001-05-07 Thread Adam Prime


I've run into this before as well, and what i ended up doing to get around
it was keeping the original $r around long enough to call filter_register.  

my $r = shift;
my $req = Apache::Request->new($r);  
$r = $r->filter_register(); 

adam


> -Original Message-
> From: Trevor Phillips [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, May 05, 2001 2:21 AM
> To: ModPerl Mail List
> Subject: Apache::Filter upgrade issues...
> 
> 
> Hi! I recently upgraded a test server to a recent 
> Apache::Filter, and hit
> problems due to the new dependency on filter_register() being 
> called. I
> don't mind upgrading my filters to call this, but I have one, 
> in which I
> use Apache::Request (a sub-class of Apache), which I cannot 
> seem to work
> around.
> 
> The guts of the code goes something like this:
> 
> sub handler
> {
>my $r = shift;
>my $IsFilter = ($r->dir_config('Filter') =~ /^on/i?1:0);
>$r = Apache::Request->new($r);
>if ($IsFilter)
>{
>   $r = $r->filter_register();
>   my ($fh, $status) = $r->filter_input();
>   return $status unless $status == OK;  # The Apache::Constants OK
>   my @file = <$fh>;
>}
> etc...
> }
> 
> The above code fails in that the extra methods provided by 
> Apache::Request
> are
> no longer there.
> 
> The above code worked fine previously (prior to the requirement of
> filter_register)...
> 
> Any ideas? How can I use both Apache::Filter and 
> Apache::Request together?
> 
> --
> . Trevor Phillips -   
http://jurai.murdoch.edu.au/ . 
: CWIS Systems Administrator -   [EMAIL PROTECTED] : 
| IT Services   -   Murdoch University | 
 >--- Member of the #SAS# & #CFC# <
| On nights such as this, evil deeds are done. And good deeds, of /
| course. But mostly evil, on the whole. /
 \  -- (Terry Pratchett, Wyrd Sisters)  /