projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve talk logging to show orig or dest node.
[spider.git]
/
perl
/
RouteDB.pm
diff --git
a/perl/RouteDB.pm
b/perl/RouteDB.pm
index 0fe3ac25e863a189d894c97fc1deb639b86984c6..6a23a827856c38d9bfaedfd058ff78be45a31435 100644
(file)
--- a/
perl/RouteDB.pm
+++ b/
perl/RouteDB.pm
@@
-20,12
+20,14
@@
package RouteDB;
use DXDebug;
use DXChannel;
use DXDebug;
use DXChannel;
+use DXUtil;
use Prefix;
use strict;
use vars qw(%list %valid $default);
use Prefix;
use strict;
use vars qw(%list %valid $default);
+
%list = ();
$default = 99; # the number of hops to use if we don't know
%valid = (
%list = ();
$default = 99; # the number of hops to use if we don't know
%valid = (
@@
-84,7
+86,7
@@
sub update
my $interface = shift;
my $hops = shift || $default;
my $ref = $list{$call} || RouteDB->new($call);
my $interface = shift;
my $hops = shift || $default;
my $ref = $list{$call} || RouteDB->new($call);
- my $iref = $ref->{item}->{$interface} ||= RouteDB::Item->new($interface);
+ my $iref = $ref->{item}->{$interface} ||= RouteDB::Item->new($interface
, $hops
);
$iref->{count}++;
$iref->{hops} = $hops if $hops < $iref->{hops};
$iref->{t} = shift || $main::systime;
$iref->{count}++;
$iref->{hops} = $hops if $hops < $iref->{hops};
$iref->{t} = shift || $main::systime;
@@
-136,7
+138,8
@@
sub new
{
my $pkg = shift;
my $call = shift;
{
my $pkg = shift;
my $call = shift;
- return bless {call => $call, hops => $RouteDB::default}, (ref $pkg || $pkg);
+ my $hops = shift || $RouteDB::default;
+ return bless {call => $call, hops => $hops}, (ref $pkg || $pkg);
}
1;
}
1;