version 1.1120, 2011/07/28 18:22:44
|
version 1.1121, 2011/07/31 22:55:53
|
Line 306 sub get_server_homeID {
|
Line 306 sub get_server_homeID {
|
return &do_cache_new('serverhomeID',$hostname,$serverhomeID,$cachetime); |
return &do_cache_new('serverhomeID',$hostname,$serverhomeID,$cachetime); |
} |
} |
|
|
|
sub get_remote_globals { |
|
my ($lonhost,$whathash,$ignore_cache) = @_; |
|
my (%returnhash,%whatneeded); |
|
if (ref($whathash) eq 'ARRAY') { |
|
foreach my $what (sort(keys(%{$whathash}))) { |
|
my $type = $whathash->{$what}; |
|
my $hashid = $lonhost.'-'.$what; |
|
my ($result,$cached); |
|
unless ($ignore_cache) { |
|
($result,$cached)=&is_cached_new('lonnetglobal',$hashid); |
|
$returnhash{$what} = $result; |
|
} |
|
if (defined($cached)) { |
|
$returnhash{$what} = $result; |
|
} else { |
|
$whatneeded{$what} = $type; |
|
} |
|
} |
|
if (keys(%whatneeded) > 0) { |
|
my $requested = &freeze_escape(\%whatneeded); |
|
my $rep=&reply('readlonnetglobal:'.$requested,$lonhost); |
|
unless (($rep=~/^refused/) || ($rep=~/^rejected/) || $rep eq 'con_lost')) { |
|
my @pairs=split(/\&/,$rep); |
|
if ($rep !~ /^error/) { |
|
foreach my $item (@pairs) { |
|
my ($key,$value)=split(/=/,$item,2); |
|
my $what = &unescape($key); |
|
my $hashid = $lonhost.'-'.$what; |
|
$returnhash{$what}=&thaw_unescape($value); |
|
&do_cache_new('lonnetglobal',$hashid,$returnhash{$what},600); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return %returnhash; |
|
} |
|
|
# -------------------------------------------------- Non-critical communication |
# -------------------------------------------------- Non-critical communication |
sub subreply { |
sub subreply { |
my ($cmd,$server)=@_; |
my ($cmd,$server)=@_; |