X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=1f2a642809e31b97637b3ea5b24e22fe74dcfd86;hb=c5e90df0d93d141f8687556a708068521b9b8f77;hp=60e0391f2e34e7e3bb73a061e40b7d0b274a9ea6;hpb=c6e8c95b161a1a19cc3cf194f1d12f874316935b;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 60e0391f..1f2a6428 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -178,15 +178,6 @@ sub init confess $@ if $@; $me->{sort} = 'S'; # S for spider - # now prime the spot and wwv duplicates file with data -# my @today = Julian::unixtoj(time); -# for (Spot::readfile(@today), Spot::readfile(Julian::sub(@today, 1))) { -# Spot::dup(@{$_}[0..3]); -# } -# for (Geomag::readfile(time)) { -# Geomag::dup(@{$_}[1..5]); -# } - # load the baddx file do "$baddxfn" if -e "$baddxfn"; print "$@\n" if $@; @@ -1362,19 +1353,22 @@ sub send_local_config sub route { my ($self, $call, $line) = @_; - my $cl = DXCluster->get_exact($call); - if ($cl) { # don't route it back down itself - if (ref $self && $call eq $self->{call}) { - dbg('chan', "Trying to route back to source, dropped"); - return; - } - my $hops; - my $dxchan = $cl->{dxchan}; - if ($dxchan) { - my $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name - if ($routeit) { - $dxchan->send($routeit) if $dxchan; - } + + if (ref $self && $call eq $self->{call}) { + dbg('chan', "Trying to route back to source, dropped"); + return; + } + + # always send it down the local interface if available + my $dxchan = DXChannel->get($call); + unless ($dxchan) { + my $cl = DXCluster->get_exact($call); + $dxchan = $cl->dxchan if $cl; + } + if ($dxchan) { + my $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name + if ($routeit) { + $dxchan->send($routeit); } } }