Though I seem to be chasing it down to a possible problem with the method handler:

sub handler ($$)

But even with a change to:

sub handler : method


This is an interesting one. How to make the two coexist in the same code base. Ideally you want to do this:

sub handler1 ($$) {}
sub handler2 : method {}

*handler = MP2 ? \&handler2 : \&handler1;

But probably it'll complain about different prototypes. Or it might just work. Give it a try.


Hi!

Looks like your example will work, though, it is kind of messy, (probably because I don't completely follow the example). I basically added the handler code into the subroutines as defined:

sub handler1 ($$) { my ($class, $r) = @_ ;
my $type ;
my $nonce = '' ;
my $self ;
...
}


sub handler2 : method
  {
   my ($class, $r) = @_ ;
   my $type ;
   my $nonce = '' ;
   ...
}

*handler = MP2 ? \&handler2 : \&handler1;

I am leaving the MP2 code in both of the subroutines, as I don't know if there is a prettier way to do this... (I will remove it, if there is not)

Although this hasn't been tested extensively, it should be working fine now.

thanks for the help!
speeves
cws

PS It did complain about "Prototype mismatch: sub Apache::AuthenNTLM::handler vs ($$) at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm" until I added the code into both subroutines.




Reply via email to