Re: $r->handler() Issue

2001-09-09 Thread Doug MacEachern

On Sat, 18 Aug 2001, David Wheeler wrote:

> Hey All,
> 
> I've got a PerlTransHandler where I want to disable, under certain
> circumstances (that is, whenever the content type isn't 'text/html') the
> content handler. However, this code doesn't do the trick:
> 
> $r->handler('default-handler');
> 
> And neither does this:
> 
> $r->handler("perl-script");
> $r->set_handlers('PerlHandler' => [ \&OK ])
> 
> Or even this:
> 
> $r->handler("perl-script");
> $r->set_handlers('PerlHandler' => [ \&DECLINED ])
> 
> None of these snippets affects the content phase in any way; the
> PerlHandler I install in httpd.conf gets executed every time, no matter
> what. Can anyone tell me how I can disable my PerlHandler for the current
> request?

you either need to have a PerlTypeHandler that sets $r->handler and
returns OK (to prevent mod_mime from settting it) or set $r->handler with
a PerlFixupHandler.





RE: $r->handler() Issue

2001-08-18 Thread David Wheeler

On Sat, 18 Aug 2001, Geoffrey Young wrote:

> just return DONE - the request will go straight to the logging phase.

Well, that would be good if I didn't want *anything* to be served, but I
do - I just want Apache's default handler to handle it, instead.

But it turns out I was able to figure out the solution: I had to wait
until after the URI Translation phase to do this -- or else that phase
undid whatever I had done! So I added

   $r->handler('default-handler');

to the FixupHandler, and it works great!

Thanks!

David

-- 
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
   Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]




RE: $r->handler() Issue

2001-08-18 Thread Geoffrey Young



> -Original Message-
> From: David Wheeler [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, August 18, 2001 2:25 PM
> To: [EMAIL PROTECTED]
> Subject: $r->handler() Issue
> 
> 
> Hey All,
> 
> I've got a PerlTransHandler where I want to disable, under certain
> circumstances (that is, whenever the content type isn't 
> 'text/html') the
> content handler. However, this code doesn't do the trick:

just return DONE - the request will go straight to the logging phase.

HTH

--Geoff 



$r->handler() Issue

2001-08-18 Thread David Wheeler

Hey All,

I've got a PerlTransHandler where I want to disable, under certain
circumstances (that is, whenever the content type isn't 'text/html') the
content handler. However, this code doesn't do the trick:

$r->handler('default-handler');

And neither does this:

$r->handler("perl-script");
$r->set_handlers('PerlHandler' => [ \&OK ])

Or even this:

$r->handler("perl-script");
$r->set_handlers('PerlHandler' => [ \&DECLINED ])

None of these snippets affects the content phase in any way; the
PerlHandler I install in httpd.conf gets executed every time, no matter
what. Can anyone tell me how I can disable my PerlHandler for the current
request?

Thanks,

David

-- 
David Wheeler AIM: dwTheory
[EMAIL PROTECTED] ICQ: 15726394
   Yahoo!: dew7e
   Jabber: [EMAIL PROTECTED]