perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Moss <martin_m...@btopenworld.com>
Subject Multiple Handlers
Date Wed, 31 Aug 2005 16:06:39 GMT
All,

I'm trying to make something work in mod perl, and all
the docs seem to be pointing me in ways which just
don't work on our system...

Server version: Apache/1.3.33 (Unix)
SunOS 5.9
perl, v5.8.6

I wish to have a handler which sits after the
Authentication stage, which can choose whether to
display a HTML page instead of the originally
requested page.. 
The originally requested page will usually be served
via Embperl, or a method handler..

I originally tried using $r->set_handlers. in my
PerlAuthenHandler. But this made absolutely no
difference to the current request... 
e.g. if did a get_handlers call before and after using
set_handlers, it clearly showed me the handlers I'd
set using set_handlers, but apache ignored this and
carried on serving it's original get_handlers()
anyway.. 

I found many different people reporting bugs in the
set_handlers mechanism and push_handler (which worked
but couldn't help me as what I wanted to do was
unshift (not push) the handlers).

So I tried defining two handlers for the same request,
the first one my custom handler, the second one
Embperl as normal. Now when my custom handler returns
DECLINE the page requested displays
normally.GREAT:-)... 

But when my custom handler actually serves a page, and
returns OK, I actually see the custom handler page
being served, and then the original requested page
appears below with a load of headers and server error
messages....  So basically BOTH handlers are being
called....

Now, I was under the impression (but could be wrong)
that if 2 content PerlHandlers are defined for a
request, then if the first one returns OK then the
second handler doesn't get called, but if it returns
DECLINED then the second one gets called...

Can anybody throw some light on this? 
Why doesn't set_handlers (used in the
PerlAuthenHandler phase) allow me to define the
PerlHandler for the content phase?

How do I prevent other handlers (independant of my
custom handler) from being run if my Custom handler
decides to serve a page...

Kind regards

Marty





	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

Mime
View raw message