version 1.12, 2003/07/31 19:55:37
|
version 1.13, 2003/08/01 14:47:44
|
Line 47 sub hidden {
|
Line 47 sub hidden {
|
|
|
sub request { |
sub request { |
my ($local,$url,$cachetime)=@_; |
my ($local,$url,$cachetime)=@_; |
|
$cachetime*=(0.5+rand); |
my $key=&key($local,$url); |
my $key=&key($local,$url); |
my $reply=''; |
my $reply=''; |
if ($FORM{$key.'_time'}) { |
if ($FORM{$key.'_time'}) { |
Line 61 sub request {
|
Line 62 sub request {
|
$reply='local_unknown'; |
$reply='local_unknown'; |
} else { |
} else { |
|
|
my $ua=new LWP::UserAgent(timeout => 20); |
my $ua=new LWP::UserAgent(timeout => 15); |
|
|
my $request=new HTTP::Request('GET', |
my $request=new HTTP::Request('GET', |
"http://".$hostname{$local}.$url); |
"http://".$hostname{$local}.$url); |
Line 94 sub connected {
|
Line 95 sub connected {
|
# Slowly phase this in: if not cached, only do 10 percent of the cases |
# Slowly phase this in: if not cached, only do 10 percent of the cases |
# |
# |
unless ($FORM{&key($local,$url)}) { |
unless ($FORM{&key($local,$url)}) { |
unless (rand>0.9) { return 'not_yet'; } |
unless (rand>0.95) { return 'not_yet'; } |
} |
} |
# |
# |
# Actually do the query |
# Actually do the query |
Line 482 foreach $local (sort keys %hostname) {
|
Line 483 foreach $local (sort keys %hostname) {
|
print '<tr><th bgcolor="#DDDDBB">'.$local.'</th>'; |
print '<tr><th bgcolor="#DDDDBB">'.$local.'</th>'; |
foreach my $remote (sort keys %hostname) { |
foreach my $remote (sort keys %hostname) { |
if ($connectionstatus{$local.'_TO_'.$remote} eq 'not_yet') { |
if ($connectionstatus{$local.'_TO_'.$remote} eq 'not_yet') { |
print '<td bgcolor="#FFFFFF"> </td>'; |
print '<td bgcolor="#FFFFFF"><font color="#555522" size="-2">not yet tested</font></td>'; |
} elsif ($connectionstatus{$local.'_TO_'.$remote} eq 'ok') { |
} elsif ($connectionstatus{$local.'_TO_'.$remote} eq 'ok') { |
print |
print |
'<td bgcolor="#BBDDBB"><font color="#225522" face="arial"><b>ok</b></td>'; |
'<td bgcolor="#BBDDBB"><font color="#225522" face="arial"><b>ok</b></td>'; |
Line 573 foreach $local (sort keys %hostname) {
|
Line 574 foreach $local (sort keys %hostname) {
|
# ============================================================== Close, refresh |
# ============================================================== Close, refresh |
print "</form><script>"; |
print "</form><script>"; |
$runtime=time-$starttime; |
$runtime=time-$starttime; |
if ($runtime>=$refresh) { |
if (($refresh-$runtime)<30) { |
print 'document.status.submit();'; |
print "setTimeout('document.status.submit()',30000);\n". |
|
"document.prgstat.progress.value='Will automatically refresh.'"; |
} else { |
} else { |
$refreshtime=int(1000*($refresh-$runtime)); |
$refreshtime=int(1000*($refresh-$runtime)); |
print "setTimeout('document.status.submit()',$refreshtime);\n". |
print "setTimeout('document.status.submit()',$refreshtime);\n". |