Update of /cvsroot/perl-ldap/sasl/lib/Authen/SASL
In directory sc8-pr-cvs1:/tmp/cvs-serv26237/lib/Authen/SASL
Modified Files:
Perl.pm
Log Message:
Add ordering so we always pich the best of the available methods instead of
just the first
Index: Perl.pm
===================================================================
RCS file: /cvsroot/perl-ldap/sasl/lib/Authen/SASL/Perl.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Perl.pm 17 Oct 2003 20:17:20 -0000 1.4
+++ Perl.pm 21 Oct 2003 18:59:47 -0000 1.5
@@ -8,7 +8,7 @@
use vars qw($VERSION);
use Carp;
-$VERSION = "1.02";
+$VERSION = "1.03";
my %secflags = (
noplaintext => 1,
@@ -27,9 +27,9 @@
host => $host || '',
};
- # Dumb selection;
-
- my @mpkg = grep {
+ my @mpkg = sort {
+ $b->_order <=> $a->_order
+ } grep {
eval "require $_;" && $_->_secflags(@sec) == @sec
} map {
(my $mpkg = __PACKAGE__ . "::$_") =~ s/-/_/g;
@@ -40,6 +40,7 @@
$mpkg[0]->_init($self);
}
+sub _order { 0 }
sub code { defined(shift->{error}) || 0 }
sub error { shift->{error} }
sub service { shift->{service} }
|