]> dxcluster.org Git - spider.git/commitdiff
force route to always give the local channel if available
authorminima <minima>
Mon, 3 Sep 2001 14:06:17 +0000 (14:06 +0000)
committerminima <minima>
Mon, 3 Sep 2001 14:06:17 +0000 (14:06 +0000)
perl/Route.pm

index 7276c6979fc7f08510cb1d2df8328dae7a470996..ee84c1508b3bdd47e07edad8597845760a34ac19 100644 (file)
@@ -274,6 +274,7 @@ sub alldxchan
        my $self = shift;
        my @dxchan;
 #      dbg("Trying node $self->{call}") if isdbg('routech');
+
        my $dxchan = DXChannel->get($self->{call});
        push @dxchan, $dxchan if $dxchan;
        
@@ -301,12 +302,16 @@ sub alldxchan
 sub dxchan
 {
        my $self = shift;
+       
+       # ALWAYS return the locally connected channel if present;
+       my $dxchan = DXChannel->get($self->call);
+       return $dxchan if $dxchan;
+       
        my @dxchan = $self->alldxchan;
        return undef unless @dxchan;
        
        # determine the minimum ping channel
        my $minping = 99999999;
-       my $dxchan;
        foreach my $dxc (@dxchan) {
                my $p = $dxc->pingave;
                if (defined $p  && $p < $minping) {