version 1.250, 2002/07/04 15:47:18
|
version 1.252, 2002/07/17 18:01:33
|
Line 2278 sub courseresdata {
|
Line 2278 sub courseresdata {
|
if (time-$courseresdatacache{$hashid.'.time'}>300) { $dodump=1; } |
if (time-$courseresdatacache{$hashid.'.time'}>300) { $dodump=1; } |
} |
} |
if ($dodump) { |
if ($dodump) { |
my $coursehom=&homeserver($coursenum,$coursedomain); |
my %dumpreply=&dump('resourcedata',$coursedomain,$coursenum); |
if ($coursehom) { |
my ($tmp) = keys(%dumpreply); |
my $dumpreply=&reply('dump:'.$coursedomain.':'.$coursenum. |
if ($tmp !~ /^(con_lost|error|no_such_host)/i) { |
':resourcedata:.',$coursehom); |
$courseresdatacache{$hashid.'.time'}=time; |
if ($dumpreply!~/^error\:/) { |
$courseresdatacache{$hashid}=\%dumpreply; |
$courseresdatacache{$hashid.'.time'}=time; |
|
$courseresdatacache{$hashid}=$dumpreply; |
|
} |
|
} |
} |
} |
} |
my @pairs=split(/\&/,$courseresdatacache{$hashid}); |
foreach my $item (@which) { |
my %returnhash=(); |
if ($courseresdatacache{$hashid}->{$item}) { |
foreach (@pairs) { |
return $courseresdatacache{$hashid}->{$item}; |
my ($key,$value)=split(/=/,$_); |
} |
$returnhash{unescape($key)}=unescape($value); |
|
} |
|
my $item; |
|
foreach $item (@which) { |
|
if ($returnhash{$item}) { return $returnhash{$item}; } |
|
} |
} |
return ''; |
return ''; |
} |
} |
Line 2956 BEGIN {
|
Line 2948 BEGIN {
|
while (my $configline=<$config>) { |
while (my $configline=<$config>) { |
chomp($configline); |
chomp($configline); |
my ($id,$domain,$role,$name,$ip,$domdescr)=split(/:/,$configline); |
my ($id,$domain,$role,$name,$ip,$domdescr)=split(/:/,$configline); |
$hostname{$id}=$name; |
if ($id && $domain && $role && $name && $ip) { |
$hostdom{$id}=$domain; |
$hostname{$id}=$name; |
$hostip{$id}=$ip; |
$hostdom{$id}=$domain; |
if ($domdescr) { |
$hostip{$id}=$ip; |
$domaindescription{$domain}=$domdescr; |
if ($domdescr) { $domaindescription{$domain}=$domdescr; } |
|
if ($role eq 'library') { $libserv{$id}=$name; } |
|
} else { |
|
if ($configline) { |
|
&logthis("Skipping hosts.tab line -$configline-"); |
|
} |
} |
} |
if ($role eq 'library') { $libserv{$id}=$name; } |
|
} |
} |
} |
} |
|
|