--- loncom/lonnet/perl/lonnet.pm 2002/05/13 09:32:56 1.219 +++ loncom/lonnet/perl/lonnet.pm 2002/05/17 14:03:04 1.223 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.219 2002/05/13 09:32:56 albertel Exp $ +# $Id: lonnet.pm,v 1.223 2002/05/17 14:03:04 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -77,7 +77,7 @@ use Apache::File; use LWP::UserAgent(); use HTTP::Headers; use vars -qw(%perlvar %hostname %homecache %hostip %spareid %hostdom +qw(%perlvar %hostname %homecache %badhomecache %hostip %spareid %hostdom %libserv %pr %prp %metacache %packagetab %courselogs %accesshash $processmarker $dumpcount %coursedombuf %coursehombuf %courseresdatacache); @@ -482,18 +482,23 @@ sub authenticate { sub homeserver { my ($uname,$udom)=@_; - my $index="$uname:$udom"; - if ($homecache{$index}) { return "$homecache{$index}"; } - + if ($homecache{$index}) { + return "$homecache{$index}"; + } my $tryserver; foreach $tryserver (keys %libserv) { + next if (exists($badhomecache{$index}->{$tryserver})); if ($hostdom{$tryserver} eq $udom) { my $answer=reply("home:$udom:$uname",$tryserver); if ($answer eq 'found') { - $homecache{$index}=$tryserver; + $homecache{$index}=$tryserver; return $tryserver; - } + } else { + $badhomecache{$index}->{$tryserver}=1; + } + } else { + $badhomecache{$index}->{$tryserver}=1; } } return 'no_host'; @@ -2799,12 +2804,12 @@ sub goodbye { } BEGIN { -# ------------------------------------------- Read access.conf and loncapa.conf +# ---------------------------------- Read loncapa_apache.conf and loncapa.conf # (eventually access.conf will become deprecated) unless ($readit) { { - my $config=Apache::File->new("/etc/httpd/conf/access.conf"); + my $config=Apache::File->new("/etc/httpd/conf/loncapa_apache.conf"); while (my $configline=<$config>) { if ($configline =~ /^[^\#]*PerlSetVar/) { @@ -2819,6 +2824,17 @@ BEGIN { while (my $configline=<$config>) { if ($configline =~ /^[^\#]*PerlSetVar/) { + my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); + chomp($varvalue); + $perlvar{$varname}=$varvalue; + } + } +} +{ + my $config=Apache::File->new("/etc/httpd/conf/loncapa_apache.conf"); + + while (my $configline=<$config>) { + if ($configline =~ /^[^\#]*PerlSetVar/) { my ($dummy,$varname,$varvalue)=split(/\s+/,$configline); chomp($varvalue); $perlvar{$varname}=$varvalue;