[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
stredwic
lon-capa-cvs@mail.lon-capa.org
Wed, 22 May 2002 13:56:43 -0000
stredwic Wed May 22 09:56:43 2002 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
Changed caching of negative results such that it marks which servers don't respond. This was done in lonnet::homerserve.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.230 loncom/lonnet/perl/lonnet.pm:1.231
--- loncom/lonnet/perl/lonnet.pm:1.230 Tue May 21 11:00:05 2002
+++ loncom/lonnet/perl/lonnet.pm Wed May 22 09:56:43 2002
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.230 2002/05/21 15:00:05 stredwic Exp $
+# $Id: lonnet.pm,v 1.231 2002/05/22 13:56:43 stredwic Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -77,7 +77,7 @@
use LWP::UserAgent();
use HTTP::Headers;
use vars
-qw(%perlvar %hostname %homecache %badhomecache %hostip %spareid %hostdom
+qw(%perlvar %hostname %homecache %badServerCache %hostip %spareid %hostdom
%libserv %pr %prp %metacache %packagetab
%courselogs %accesshash $processmarker $dumpcount
%coursedombuf %coursehombuf %courseresdatacache);
@@ -489,17 +489,15 @@
my $tryserver;
foreach $tryserver (keys %libserv) {
next if ($ignoreBadCache ne 'true' &&
- exists($badhomecache{$index}->{$tryserver}));
+ exists($badServerCache{$tryserver}));
if ($hostdom{$tryserver} eq $udom) {
my $answer=reply("home:$udom:$uname",$tryserver);
if ($answer eq 'found') {
$homecache{$index}=$tryserver;
return $tryserver;
- } else {
- $badhomecache{$index}->{$tryserver}=1;
+ } elsif ($answer eq 'no_host') {
+ $badServerCache{$tryserver}=1;
}
- } else {
- $badhomecache{$index}->{$tryserver}=1;
}
}
return 'no_host';